skip to Main Content

I’m referring to the official github guide to set up automated deploy to ECS
https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/deploying-to-amazon-elastic-container-service

My deploy.yaml workflow looks identical to the one in the above link, only with the correct environment variables substituted

i’ve completed all the steps as required and have all the necessary infrastructure on AWS up and running.
But when the workflow get’s triggered, it always fails at pushing the docker image to ECR.
After retrying for a couple of times, it exits with

EOF
Error: Process completed with exit code 1.

From the output i can see on the github actions, I believe the login to ecr step succeeded and also can confirm that it’s pushing to the right ECR repository, but for some reason the push fails.

I’ve already pushed images to the repository locally and it works, so I don’t think anything is wrong on the AWS side of things.

5

Answers


  1. Chosen as BEST ANSWER

    I realized my own mistake with this. In the environment file where i'm supposed to specify the repository-name i had instead specified the full repository ID meaning if the repository is named my-ecr-repo, i had instead accidentally written .dkr.ecr.us-east-1.amazonaws.com/my-ecr-repo setting the name to just my-ecr-repo solved the problem


  2. I had this problem when my IAM user did not have sufficient permissions to write to the repository. My updated permissions were as follows, which worked.

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "ecr:CompleteLayerUpload",
                    "ecr:GetAuthorizationToken",
                    "ecr:UploadLayerPart",
                    "ecr:InitiateLayerUpload",
                    "ecr:BatchCheckLayerAvailability",
                    "ecr:PutImage"
                ],
                "Resource": "*"
            }
        ]
    }
    
    Login or Signup to reply.
  3. While logging into AWS account using the aws-actions/configure-aws-credentials@v1, I was specifying wrong aws-region.

    AWS region should be same as the ecr repo region. Else, even if login is successful, push will fail.

    Login or Signup to reply.
  4. Had the same issue. Saw here that you can lookup the logs for this issue in Cloudtrail. After doing so I saw that my user was missing the ecr:InitiateLayerUpload action. After updating my user I was able to push to ECR

    Login or Signup to reply.
  5. I also faced the same problem, but what I found that, the ECR repo where I was trying to push doesn’t exist. I deleted the repo for some testing purpose and forgot to re-create and trying docker push and it was failing like below :

    f9cb3f1f1d3d: Retrying in 1 second

    EOF

    Error: Process completed with exit code 1.

    I re-created the ECR repo and able to do docker push successfully.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search