-
Notifications
You must be signed in to change notification settings - Fork 183
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
Error when using AWS SDK 2.18 for S3 operations #880
Comments
@bpfoster S3Mock currently does not support bucket access by subdomain, only path style access is supported. It seems that up until 2.18, the SDKv2 used path style access as a default, or maybe used some negotiation to find out if path style access is needed.
This is not a breaking change for clients of the SDK if you use S3 as a backend, but it is if you are using any backend that does not support subdomain access like S3Mock... |
Just realized: this one will be a pain in the neck - it will essentially break every integration test in existence where the service accessing S3 is using AWS SDKv2 for Java... :( |
Ah, sorry I missed #144, that's definitely related. Please feel free to close this if you see it as a duplicate. That's good to know that we can force path style access like in your sample, though the further my test client configuration gets from the production client configuration, the less faith I have in the test... If I read the release notes correctly, it seems that prior to 2.18, SDKv2 would use subdomain style access as a default, unless an endpoint override was configured - which obviously all S3Mock uses would have set. I think you're right that SDK v2.18+ will break all existing tests using S3Mock which is not great. If I completely ignore the complexities of actually doing it 😄 , ideally I think you would want to support both subdomain and path style access. |
This was the default in 2.17.x, changed in 2.18.x S3Mock currently does not support subdomain style access to buckets. Fixes #880
I just updated the usages of AWS SDKv2 in S3Mock, fixing our immediate problem allowing us to update the SDK version. |
Fixes #22731 - Switched test s3 client to use pathstyle urls ([Default behaviour has changed in AWS SDK 2.18](adobe/S3Mock#880)) - Made S3 tests more isolated - Cleaned up dependency and remove home-made S3MockContainer - Update S3Mock to newer version 2.4.14. Starting from 2.4.16 it fails when using `GetBucketLocation` operation
Upgrading to the newly release SDK 2.18, S3Mock is returning an error when our tests create a bucket on setup:
software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 405, Request ID: null)
.Our client is created like:
The SDK release notes for 2.18.0 mention:
Turning on request logging, I see a difference between requests issued with client 2.17:
and those issued with client 2.18:
Note that the bucket name is now in the DNS address and not the HTTP path. The S3 docs also now reflect that.
I suspect, but haven't confirmed, that other operations besides CreateBucket will be affected by this as well.
Looks like dependabot has created you a PR to upgrade the client, which appears to be failing with the same error:
#878
The text was updated successfully, but these errors were encountered: