s3 client global endpoint_url results in PermanentRedirect when region provided #4360
Labels
bug
This issue is a confirmed bug.
p3
This is a minor priority issue
response-requested
Waiting on additional information or feedback.
s3
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
The text was updated successfully, but these errors were encountered: