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

S3 Bucket created in ap-south-2 location is breaking s3 client command #3931

Closed
eldos-dl opened this issue Nov 14, 2023 · 3 comments
Closed
Assignees
Labels

Comments

@eldos-dl
Copy link

Describe the bug

The following code is giving error for buckets in ap-south-2 region

import boto3
client = session.client('s3')
client.list_objects_v2(Bucket=bucket_name)

Expected Behavior

We should be able to get normal response based on bucket contents, provided user has permissions.

Current Behavior

Getting the following error:
ClientError: An error occurred (IllegalLocationConstraintException) when calling the ListObjectsV2 operation: The ap-south-2 location constraint is incompatible for the region specific endpoint this request was sent to.

Reproduction Steps

Create a bucket in ap-south-2, Hyderabad region. And try to access it programmatically with boto3

Possible Solution

Add ap-south-2 to the validation

Additional Information/Context

No response

SDK version used

boto3==1.28.85

Environment details (OS name and version, etc.)

Linux/6.2.0-36-generic exe/x86_64.ubuntu.22 prompt/off

@eldos-dl eldos-dl added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Nov 14, 2023
@tim-finnigan tim-finnigan self-assigned this Nov 14, 2023
@tim-finnigan
Copy link
Contributor

Hi @eldos-dl thanks for reaching out. I commented here on the other issue you just opened: aws/aws-cli#8326 (comment). As mentioned there, you'll need to set the region name to ap-south-2 in order to correctly route the request. For example:

import boto3
client = boto3.client('s3', region_name='ap-south-2')
client.list_objects_v2(Bucket='bucket-name')

@tim-finnigan tim-finnigan added s3 and removed bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Nov 14, 2023
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@eldos-dl
Copy link
Author

@tim-finnigan So for opt-in regions like ap-south-2, it is mandatory to mention region_name while creating the client, unlike buckets in other regions where it is automatically inferred?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants