-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 existence - unexpected behavior #1161
Comments
I am able to replicate the regression, taking a look. |
Interestingly, the exact choice of bucket name here matters. The bucket 'test-issue-s3' is in the ap-northeast-1 region. So, for example, this code works: Aws::S3::Resource.new(region: "ap-northeast-1").bucket('test-issue-s3').exists? #=> true The issue here comes from the |
Looking back at some previous versions, I don't think this is a regression, I don't think this particular case has ever worked. Looking at fix options. I don't think I want to add |
Fixed the following issue: s3 = Aws::S3::Resource.new(region: 'us-west-1') s3.bucket('us-west-2-bucket-you-dont-own').exists? #=> raises Aws::S3::Errors::BadRequest If the bucket exists, but you are configured for the incorrect region, the SDK fails to extract the actual bucket region from the 400 response. This is due to the fact that HEAD reponses do not have a body. Added a check for the "x-amz-bucket-region" header before checking the body. This the SDK to determine the proper signing region for the request. This change currently lacks tests. See #1161
So, the fix here (as Trevor is wrapping up) is to check for the bucket region in headers as well as the body. That will resolve this issue and similar. It's not often encountered because this particular failure modality was not hit by most client methods. |
Resolved the following issues: s3 = Aws::S3::Client.new(region: 'us-west-1') s3.head_bucket(bucket: 'us-west-2-bucket') #=> raises Aws::S3::Errors::BadRequest (without a message) If the bucket exists, but you are configured for the incorrect region, the SDK fails to extract the actual bucket region from the 400 response. This results in an empty error message. Added support for loading the bucket region from the "x-amz-bucket-region" header, which is necessary for all HEAD responses. Fixes #1161
Thanks for the report! |
@awood45 Awesome thanks for the quick fix ! |
I get this error for the region "ap-south-1" - Should I raise a new issue? S3 client configured for "ap-south-1" but the bucket "dev-embryo-ui" is in "ap-south-1"; Please configure the proper region to avoid multiple unnecessary redirects and signing attempts
I've created the bucket in the same region as I ask Travis to deploy. Despite that, I run into this issue. |
@ravsom did you ever get solution to above error ? i'm saving same issue |
Not really. I changed the workflow to use s3 directly for static web
hosting instead of directing it to eb.
…On 24 Nov 2017 10:34 am, "raheel0452" ***@***.***> wrote:
@ravsom <https://github.com/ravsom> did you ever get solution to above
error ? i'm saving same issue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1161 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADwkltSF_ivsEB0UprDE_1uDLcltT_ABks5s5k5KgaJpZM4IKK5f>
.
|
Same issue as #796, looks like a regression (aws-sdk (2.2.34))
The text was updated successfully, but these errors were encountered: