-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
generate_presigned_url for put_bucket_cors fails for non-AWS region #2943
Comments
Hi @philipnbbc thanks for reaching out. Here is the CHANGELOG entry for botocore version 1.28.0. As noted there, updates to the endpoint rule system were made:
Here is the rule set for S3 that was added. This may be some sort of third-party compatibility issue. Could you explain more what you mean by using a non-AWS region? |
Hi @tim-finnigan. It had another closer look and have created #2962 after finding that a request using the presigned URL fails for AWS S3 (e.g. "eu-west-1"). By non-AWS region I mean our Openstack deployment which has a Ceph / Rados gateway S3 storage backend. The region name it uses is "default". If I set the region name to "default" then it returns the error reported in this issue. If I set it to "eu-west-1" (with or without the fix from #2962) the presigned URL is generated but our deployment reports "AccessDenied" - which probably makes sense as the region is incorrect. The secondary issue is that it used to work for botocore version <1.28.0 using a V2 signature ( |
Hi @philipnbbc thanks for following up. Regarding v2 signatures, it notes here in the S3 documentation:
You can refer to this page for regions mapping to valid S3 endpoints. I'm not familiar with OpenStack but for using boto3 you should configure a valid region for your requests. The |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
I'm aware that the V2 signature is deprecated, which is why I wanted to instead see in this issue whether the V4 signature in pre-signed URLs can be made to work for |
Thanks for following up. I'm not familiar with Ceph but yes this seems to be some kind of third-party incompatibility regarding how regions are handled. If you have any updates on what you have found please let us know. I'm still looking into the related issue you opened (#2962). |
Thanks for your help. I'll probably not have the time to get an update on findings within 5 days, but will re-open an issue once I do. |
Describe the bug
Using
generate_presigned_url
for theput_bucket_cors
method fails for a non-AWS region.Expected Behavior
It should succeed and return the presigned URL string.
Current Behavior
It produces these DEBUG log messages and finally the error stack trace:
Reproduction Steps
It can be reproduced using this code below. Change the
region_name
toeu-west-1
for example and it succeeds.Possible Solution
The workaround prior to botocore version 1.28.0 was to add
config=botocore.config.Config(signature_version="s3")
to thesession.client()
call. Unfortunately something changed from botocore version 1.27.96 to 1.28.0 and the S3 service now returns an "AccessDenied" / 403 error.Additional Information/Context
The target of this presigned URL is a Ceph / Radosgw s3 deployment, hence the change in endpoint URL and region.
SDK version used
botocore 1.29.135
Environment details (OS name and version, etc.)
Code was tested in a Python 3.10.9 virtualenv
The text was updated successfully, but these errors were encountered: