aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

forceGlobalBucketAccessEnabled does not work when dualstackEnabled is set for S3

Open kwadhwa18 opened this issue 3 years ago • 2 comments

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

kwadhwa18 avatar Jul 11 '22 19:07 kwadhwa18

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

yasminetalby avatar Jul 19 '22 20:07 yasminetalby

thanks @yasminetalby

kwadhwa18 avatar Jul 20 '22 00:07 kwadhwa18

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

islamismailov avatar Feb 18 '23 04:02 islamismailov

A fix was released in SDK version 1.12.440, please check it out.

debora-ito avatar Apr 03 '23 18:04 debora-ito

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.

github-actions[bot] avatar Apr 08 '23 21:04 github-actions[bot]