Reputation: 424
I have one EC2 machine and 2 repositories in ECR with the same permissions. I have docker on this machine. I successfully log into this ECR.
If I build an image for one of the repositories, it is successfully pushed to ECR. If I do the same for another repository, I am stuck on this:
The push refers to repository [repo_url/repo_name]
43e0534dbd78: Retrying in 4 seconds
90e3aa0f1f3b: Retrying in 4 seconds
30e0d794ab25: Retrying in 4 seconds
7c03fd789dab: Retrying in 4 seconds
71091a0088fb: Retrying in
...
He can't push and retries this over and over again. In the docker logs, I see these:
level=debug msg="Failed to check for presence of layer sha256:6f37ca73c74f2cef0ddefd960260f2033c16c84583c5507a4f37b1cf7631dc20 (sha256:99803d4b97f3db529ae9ca4174b0951afac6b309e7deaa8ec3214c584e02b3a8) in repo_url/repo_name" error="error parsing HTTP 403 response body: unexpected end of JSON input: \"\""
and
level=info msg="failed to mount layer sha256:6f37ca73c74f2cef0ddefd960260f2033c16c84583c5507a4f37b1cf7631dc20 (sha256:99803d4b97f3db529ae9ca4174b0951afac6b309e7deaa8ec3214c584e02b3a8) from url_name/another_repo_name: Post https://url_name/v2/repo_name/blobs/uploads/?from=another_repo_name&mount=sha256%3A99803d4b97f3db529ae9ca4174b0951afac6b309e7deaa8ec3214c584e02b3a8: EOF"
As far as I can understand, he fails to mount a layer from another image (since they are similar) but he fails. What I need to check and how to debug further?
Upvotes: 1
Views: 675
Reputation: 424
The problem was in AMI policy, which allowed push only to one specific repository.
Upvotes: 0