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

Error while pushing image to ecr

Avanesyan95
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 14, 2022
INFO: Using default authentication with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
INFO: Executing the aws-ecr-push-image pipe...
Traceback (most recent call last):
File "/usr/bin/pipe.py", line 225, in <module>
pipe.run()
File "/usr/bin/pipe.py", line 197, in run
registry = self.docker_login(docker_client)
File "/usr/bin/pipe.py", line 135, in docker_login
client = self.get_client()
File "/usr/bin/pipe.py", line 125, in get_client
return boto3.client(self.boto3_client_name, region_name=self.region)
File "/usr/local/lib/python3.9/site-packages/boto3/__init__.py", line 93, in client
return _get_default_session().client(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/boto3/session.py", line 270, in client
return self._session.create_client(
File "/usr/local/lib/python3.9/site-packages/botocore/session.py", line 841, in create_client
client = client_creator.create_client(
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 91, in create_client
client_args = self._get_client_args(
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 360, in _get_client_args
return args_creator.get_client_args(
File "/usr/local/lib/python3.9/site-packages/botocore/args.py", line 99, in get_client_args
endpoint = endpoint_creator.create_endpoint(
File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 286, in create_endpoint
raise ValueError("Invalid endpoint: %s" % endpoint_url)
ValueError: Invalid endpoint: https://api.ecr..amazonaws.com

2 answers

1 vote
peter.anderson March 20, 2023

Hi Avanesyan95 - i fixed this by making sure my region was set correctly - using AWS_DEFAULT_REGION gave me this error.  Passing a new repository variable AWS_REGION into my pipe saw it come to life.

In my case, AWS_REGION was 'eu-west-2'.

 
- pipe: atlassian/aws-ecr-push-image:2.0.0

            variables:

              AWS_DEFAULT_REGION: $AWS_REGION

              AWS_OIDC_ROLE_ARN: 'arn:aws:iam::accountnumber:role/role-arn-for oidc'

              IMAGE_NAME: myimage

              TAGS: 'mytag'

**I'm using OIDC, so you can simply swap out that line for you ACCESS TOKEN and SECRET lines 

0 votes
Norbert C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2022

HI @Avanesyan95 

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

Based on my observation the build is failing with the following error message:

ValueError: Invalid endpoint: https://api.ecr..amazonaws.com

Can you double-check whether if you're providing the correct endpoint with your configuration? Based on the error message, you provided a faulty one

Please let us know how it goes.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events