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.

gefragt vor einem Jahr3211 Aufrufe
2 Antworten
0
Akzeptierte Antwort

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?

EXPERTE
beantwortet vor einem Jahr
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.

beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen