Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECR client no longer respects the endpoint_url parameter #3326

Closed
1 task done
bblommers opened this issue Dec 27, 2024 · 2 comments
Closed
1 task done

ECR client no longer respects the endpoint_url parameter #3326

bblommers opened this issue Dec 27, 2024 · 2 comments
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. potential-regression Marking this issue as a potential regression to be checked by team member

Comments

@bblommers
Copy link

bblommers commented Dec 27, 2024

Describe the bug

When invoking ECR methods on a client with the endpoint_url configured, the configured endpoint is ignored, and all requests are actually send to ecr.amazonaws.com.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I would expect the request to go to that endpoint url. This worked with botocore 1.35.87, so this is a recent regression.

Current Behavior

An error occurred (UnrecognizedClientException) when calling the CreateRepository operation: The security token included in the request is invalid.

This error tells me that the requests are actually send through to AWS, and not to the configured endpoint. (The endpoint in my case is Moto, which accepts any request, regardless of the security token included.)

Reproduction Steps

import os

import boto3
from botocore.exceptions import EndpointConnectionError

os.environ["AWS_ACCESS_KEY_ID"] = 'testing'
os.environ["AWS_SECRET_ACCESS_KEY"] = 'testing'
os.environ["AWS_DEFAULT_REGION"] = 'us-east-1'


def test_create_repository():
    # given
    client = boto3.client("ecr", endpoint_url="http://localhost:5000")

    try:
        client.create_repository(repositoryName="myrepo")
    except EndpointConnectionError as e:
        # Expected, as nothing is running on localhost
        pass

Running this test passes against 1.35.87, as expected, but fails against 1.35.88 with an UnrecognizedClientException - because botocore is trying to reach out to AWS instead.

Possible Solution

No response

Additional Information/Context

I've created a very simple GitHub repo if you want to see the above test in action, against both botocore versions:
bblommers/botocore-ecr-endpoint#1

Note that also fails against other methods, like DescribeRepositories and PutReplicationConfiguration

SDK version used

1.35.88

Environment details (OS name and version, etc.)

Ubuntu

@bblommers bblommers added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Dec 27, 2024
@github-actions github-actions bot added the potential-regression Marking this issue as a potential regression to be checked by team member label Dec 27, 2024
@SamRemis
Copy link
Contributor

@bblommers,

Thank you for bringing this to our attention. We have confirmed the issue and are working on a fix

@bblommers
Copy link
Author

Looks like this is already fixed with 1.35.90. Thank you for looking into this and for the quick fix @SamRemis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. potential-regression Marking this issue as a potential regression to be checked by team member
Projects
None yet
Development

No branches or pull requests

2 participants