forceGlobalBucketAccessEnabled does not work when dualstackEnabled is set for S3
Describe the bug
I'm trying to use dual stack for S3 . Here is how I'm constructing the client:
s3 =
AmazonS3ClientBuilder.standard()
.withClientConfiguration(configuration)
.withCredentials(credentialsProvider)
.withForceGlobalBucketAccessEnabled(true)
.withDualstackEnabled(true)
.build();
accessing a bucket with this client fails with the following error message:
The bucket is in this region: us-east-2. Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect; Request ID: .....; S3 Extended Request ID: .....
Although, if I don't set dual stack like below, accessing a bucket in any region is successful:
s3 =
AmazonS3ClientBuilder.standard()
.withClientConfiguration(configuration)
.withCredentials(credentialsProvider)
.withForceGlobalBucketAccessEnabled(true)
.build();
Expected Behavior
The client should be able to access bucket/object in any region with forceGlobalBucketAccessEnabled set to true (even when dual stack is set)
Current Behavior
operation fails with error code 301
Reproduction Steps
Mentioned above in the description
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
1.12.130
JDK version used
java version "17.0.2" 2022-01-18 LTS
Operating System and version
macOS Monterey 12.0.1
Hello @kwadhwa18 ,
Thank you very much for your submission. I was able to reproduce this issue and confirm that it is a bug. We will be adding this bug fix to our backlog, however as we are currently focusing our effort on SDK v2, I would advise to not use forceGlobalBucketAccessEnabled with dual stack.
Best,
Yasmine
thanks @yasminetalby
This issue still persists on the latest version of v1 SDK. This SDK is still widely used by a lot of software. Can we prioritize the fix please? @yasminetalby
A fix was released in SDK version 1.12.440, please check it out.
It looks like this issue has not been active for more than five days. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it.