Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipe "atlassian/aws-ecr-push-image:2.0.0" fails to push the image to ECR

Arman Koradia April 5, 2023

Pipe "atlassian/aws-ecr-push-image:2.0.0" fails to push the image to ECR even when login to ECR is successful.

Below is the step that I have for building the docker image, tagging it and pushing it to ECR. Please let me know if I am missing anything here.

- step:
name: Build Docker image
script:
- IMAGE_NAME="aws_account_number.dkr.ecr.us-east-1.amazonaws.com/tn-springboot-bitbucket-demo"
- docker build -t ${IMAGE_NAME} .
after-script:
- pipe: atlassian/aws-ecr-push-image:2.0.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_REGION
IMAGE_NAME: $ECR_REPOSITORY
TAGS: latest

The logs that are generated are as follows:

Status: Downloaded newer image for bitbucketpipelines/aws-ecr-push-image:2.0.0
INFO: Using default authentication with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
INFO: Executing the aws-ecr-push-image pipe...
INFO: Found credentials in environment variables.
INFO: Successfully logged in to https://aws_account_number.dkr.ecr.us-east-1.amazonaws.com
INFO: {'status': 'The push refers to repository [aws_account_number.dkr.ecr.us-east-1.amazonaws.com/<aws_account_number>.dkr.ecr.us-east-1.amazonaws.com/tn-springboot-bitbucket-demo]'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '25428ec2c0ce'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '6b5aaff44254'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '53a0b163e995'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': 'b626401ef603'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '9b55156abf26'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '293d5db30c9f'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '03127cdb479b'}
INFO: {'status': 'Preparing', 'progressDetail': {}, 'id': '9c742cd6c7a5'}
INFO: {'status': 'Waiting', 'progressDetail': {}, 'id': '293d5db30c9f'}
INFO: {'status': 'Waiting', 'progressDetail': {}, 'id': '03127cdb479b'}
INFO: {'status': 'Waiting', 'progressDetail': {}, 'id': '9c742cd6c7a5'}
INFO: {'status': 'Retrying in 5 seconds', 'progressDetail': {}, 'id': '25428ec2c0ce'}
INFO: {'status': 'Retrying in 5 seconds', 'progressDetail': {}, 'id': 'b626401ef603'}
INFO: {'status': 'Retrying in 5 seconds', 'progressDetail': {}, 'id': '6b5aaff44254'}
INFO: {'status': 'Retrying in 5 seconds', 'progressDetail': {}, 'id': '53a0b163e995'}
INFO: {'status': 'Retrying in 5 seconds', 'progressDetail': {}, 'id': '9b55156abf26'}
INFO: {'status': 'Retrying in 4 seconds', 'progressDetail': {}, 'id': '25428ec2c0ce'}
INFO: {'status': 'Retrying in 4 seconds', 'progressDetail': {}, 'id': 'b626401ef603'}
INFO: {'status': 'Retrying in 4 seconds', 'progressDetail': {}, 'id': '6b5aaff44254'}
INFO: {'status': 'Retrying in 4 seconds', 'progressDetail': {}, 'id': '53a0b163e995'}
INFO: {'status': 'Retrying in 4 seconds', 'progressDetail': {}, 'id': '9b55156abf26'}
INFO: {'status': 'Retrying in 3 seconds', 'progressDetail': {}, 'id': '25428ec2c0ce'}
INFO: {'status': 'Retrying in 3 seconds', 'progressDetail': {}, 'id': 'b626401ef603'}
INFO: {'status': 'Retrying in 3 seconds', 'progressDetail': {}, 'id': '6b5aaff44254'}
INFO: {'status': 'Retrying in 3 seconds', 'progressDetail': {}, 'id': '53a0b163e995'}
INFO: {'status': 'Retrying in 3 seconds', 'progressDetail': {}, 'id': '9b55156abf26'}
INFO: {'status': 'Retrying in 2 seconds', 'progressDetail': {}, 'id': '25428ec2c0ce'}
INFO: {'status': 'Retrying in 2 seconds', 'progressDetail': {}, 'id': 'b626401ef603'}
INFO: {'status': 'Retrying in 2 seconds', 'progressDetail': {}, 'id': '6b5aaff44254'}
INFO: {'status': 'Retrying in 2 seconds', 'progressDetail': {}, 'id': '53a0b163e995'}
INFO: {'status': 'Retrying in 2 seconds', 'progressDetail': {}, 'id': '9b55156abf26'}
INFO: {'status': 'Retrying in 1 second', 'progressDetail': {}, 'id': '25428ec2c0ce'}
INFO: {'status': 'Retrying in 1 second', 'progressDetail': {}, 'id': 'b626401ef603'}
INFO: {'status': 'Retrying in 1 second', 'progressDetail': {}, 'id': '6b5aaff44254'}
INFO: {'status': 'Retrying in 1 second', 'progressDetail': {}, 'id': '53a0b163e995'}
INFO: {'errorDetail': {'message': 'EOF'}, 'error': 'EOF'}
✖ Docker push error: EOF

 
Despite this failure, the pipeline is shown as "Successful" which is terribly wrong. This consumed most of my Premium Trial Build Limits. :(
Attaching multiple instances of the same as screenshot below:
Screenshot 2023-04-05 at 5.35.43 PM.pngScreenshot 2023-04-05 at 5.36.12 PM.png
 

1 answer

0 votes
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 7, 2023

Hi @Arman Koradia 

Thank you for your question!

We'll investigate the issue and notify you.

Please, pay attention that IMAGE_NAME variable for the pipe should be IMAGE_NAME that you build according to the documentation in the readme. (i.e. "tn-springboot-bitbucket-demo" according to the logs you provided)

Also, have you tried push the image with the pipe in the same step and script section instead of after-script section?

- step:
name: Build Docker image
script:
- IMAGE_NAME="aws_account_number.dkr.ecr.us-east-1.amazonaws.com/tn-springboot-bitbucket-demo"
- docker build -t ${IMAGE_NAME} .
- pipe: atlassian/aws-ecr-push-image:2.0.0
variables:
IMAGE_NAME: $IMAGE_NAME
TAGS: latest

 

Best regards,
Oleksandr Kyrdan

rmontano August 17, 2023

I hit the same issue. My problem was that the IMAGE_NAME was incorrect.

Like 이용주 likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events