Getting HTTP 403 "unexpected end of JSON input" when pushing to AWS ECR

ecr
docker

#1

Here is the code in the deploy section:

aws ecr get-login|sh
docker tag some-site:latest 315XXXXXXXXX.dkr.ecr.eu-west-1.amazonaws.com/some-site:latest
docker push 315XXXXXXXXX.dkr.ecr.eu-west-1.amazonaws.com/some-site:latest

And, in the end, I get an:

error parsing HTTP 403 response body: unexpected end of JSON input: ""
Exited with code 1

This does not seem related to the auth problem I am seeing around.


#2

Can you try adding ecr:BatchCheckLayerAvailability? This seems related: https://github.com/moby/moby/issues/19010


#3

Thanks a lot. As a reference for others here is the complete policy.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetAuthorizationToken",
                "ecr:InitiateLayerUpload",
                "ecr:UploadLayerPart",
                "ecr:CompleteLayerUpload",
                "ecr:BatchCheckLayerAvailability",
                "ecr:PutImage"
            ],
            "Resource": "*"
        }
    ]
}

#4

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.