Search code examples
amazon-web-servicesdockerdocker-registryamazon-ecr

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.


Solution

  • 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]+)*.