Getting error - The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-south-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed)

0

I'm trying to get region-wise buckets using getBucketLocation() method in AWS S3 SDK, for all the regions it returns proper outputs but for the region us-east-1 it throws the error.

Tried few solutions such as changing the bucket name, deleting the bucket etc. but still the error persists.

asked a year ago3090 views
2 Answers
0
Accepted Answer

getBucketLocation() returns a region ID like "af-south-1" for all regions except us-east-1, when it returns null. Are you sure it's getBucketLocation() returning the error rather than something using its output that's getting tripped up by the null?

EXPERT
answered a year ago
0

I debugged the code and as per you were saying getBucketLocation() returns "US" for us-east-1, so I was getting that error. Problem has been resolved. Thank you.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions