Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker AWS ECR error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"

Had an issue with not being able to push or pull from an AWS ECR registry with the following cryptic error:

error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"

Several hours of googling indicated it was a protocol issue. It turns out the image name:

xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/snowshu__test

was the issue: AWS ECR errors when the image name contains double underscores.

This contradicts ECR naming documentation.

like image 327
EthanK Avatar asked Jan 29 '20 20:01

EthanK


2 Answers

You cannot have two underscores next to each other in a repository name.

As per the Docker Registry API:

A component of a repository name must be at least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. More strictly, it must match the regular expression [a-z0-9]+(?:[._-][a-z0-9]+)*.

like image 177
Richard Nguyen Avatar answered Oct 17 '22 22:10

Richard Nguyen


Renaming the image to

xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/snowshu_test

solved the issue.

like image 31
EthanK Avatar answered Oct 17 '22 21:10

EthanK