You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the boto3 client for s3 ListObjects with endpoint_url without region inside (eg. https://s3.amazonaws.com and not https://s3.ap-southeast-1.amazonaws.com) results in ClientError PermanentRedirect
Regression Issue
Select this option if this issue appears to be a regression.
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
Traceback (most recent call last):
File "/REDACTED/testing/s3.py", line 89, in <module>
for obj in bucket.objects.filter(Prefix=bucket_path):
File "/REDACTED/.pyenv/versions/3.10.15/lib/python3.10/site-packages/boto3/resources/collection.py", line 79, in __iter__
for page in self.pages():
File "/REDACTED/.pyenv/versions/3.10.15/lib/python3.10/site-packages/boto3/resources/collection.py", line 169, in pages
for page in pages:
File "/REDACTED/.pyenv/versions/3.10.15/lib/python3.10/site-packages/botocore/paginate.py", line 269, in __iter__
response = self._make_request(current_kwargs)
File "/REDACTED/pyenv/versions/3.10.15/lib/python3.10/site-packages/botocore/paginate.py", line 357, in _make_request
return self._method(**current_kwargs)
File "/REDACTED/pyenv/versions/3.10.15/lib/python3.10/site-packages/botocore/client.py", line 569, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/REDACTED/.pyenv/versions/3.10.15/lib/python3.10/site-packages/botocore/client.py", line 1023, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (PermanentRedirect) when calling the ListObjects operation: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endp
oint.
The issue occurs only in boto3 versions of 1.25.0 onwards. Previously we were using boto3==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 the region is inserted into the endpoint_url (eg. https://aws.ap-southeast-1.amazonaws.com) or the AWS_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
bentohset
changed the title
s3 client endpoint_url results in PermanentRedirect if no region specified
s3 client global endpoint_url results in PermanentRedirect when region provided
Nov 27, 2024
adev-code
added
investigating
This issue is being investigated and/or work is in progress to resolve the issue.
p3
This is a minor priority issue
s3
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Nov 27, 2024
The issue occurs only in boto3 versions of 1.25.0 onwards. Previously we were using boto3==1.18.18 which had no issue. Region was not required to list objects in the bucket in this earlier version.
Hi @adev-code , is there a way to use https://s3.amazonaws.com + region in the new version of SDK for backward compatibility?
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: