S3 HeadBucket 301 Error #5085
Labels
bug
This issue is a bug.
guidance
Question that needs advice or information.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
service:s3
Describe the bug
When I run the head-bucket command from CLI V2 with the bucket located in
us-east-1
,both region endpoint returns the correct result.
Now, do it the same thing in java sdk v2,
the second block throws an exception and so cannot get the correct region.
How do I get the bucket region info without it?
GetBucketLocation
is an legacy alternatives but when I read the documentation of it, I noticed that they recommend to move an api toHeadBucket
!As far as I know with the error, there is no way to replace the
GetBucketLocation
byHeadBucket
. Is that correct?Expected Behavior
Wherever I call the
HeadBucket
, it should return the bucket region info without exception.Current Behavior
When I call the
HeadBucket
through the different region endpoint from the bucket region, it throws an exception with the error code 301.Reproduction Steps
Place a bucket anywhere, and call the
HeadBucket
.Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
2.25.27
JDK version used
21
Operating System and version
M3 14.3.1
The text was updated successfully, but these errors were encountered: