Open bentohset opened 2 days ago
Hello @bentohset, thanks for reaching out. As of the update from S3 Service (September 23, 2020) - S3 have transitioned to virtual-hosted–style URLs. This would mean that any buckets outside of US-EAST-1, you would need to add the region on the endpoint URL. https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html and https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/ . Please let me know if you have further questions. Thanks.
Describe the bug
When using the boto3 client for s3 ListObjects with
endpoint_url
without region inside (eg.https://s3.amazonaws.com
and nothttps://s3.ap-southeast-1.amazonaws.com
) results in ClientError PermanentRedirectRegression Issue
Expected Behavior
S3 objects should be listed without issue while using the current environment variables (without editing them if possible)
Current Behavior
Using the below configuration of the SDK results in a PermanentRedirect error
Error:
The issue occurs only in
boto3
versions of1.25.0
onwards. Previously we were usingboto3==1.18.18
which had no issue. Region was not required to list objects in the bucket in this earlier version.We need to use the
endpoint_url
parameter as we are supporting customers who are using non-AWS S3 storage. The issue is resolved when theregion
is inserted into theendpoint_url
(eg.https://aws.ap-southeast-1.amazonaws.com
) or theAWS_DEFAULT_REGION
environment variable is not provided but some of our current users are using endpoint urls without the region. Would there be a way to resolve this error?Reproduction Steps
Run the following code using latest version of
boto3
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.35.23
Environment details (OS name and version, etc.)
MacOS Sonoma 14.6.1 Apple M2 Max