s3 client region header getBucketLocation - not authorized in all regions #260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the time of writing this, the getBucketLocation(bucket), when querying a bucket at the ap-southeast-1 with the default region (us-east-01) is failing with:
com.amazonaws.services.s3.model.AmazonS3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-southeast-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 7MS6DSEXVCGSDAMC; S3 Extended Request ID: W+TtTvGGr631WQusxuCjqbwNqVbMYxOroPzHKGXIMuJZe28Z4mGbWM5wCyr94U1q7kAUoT9ccHw=; Proxy: null), S3 Extended Request ID: W+TtTvGGr631WQusxuCjqbwNqVbMYxOroPzHKGXIMuJZe28Z4mGbWM5wCyr94U1q7kAUoT9ccHw=
I found a couple of reports in the past that this was a temporary issue, but it has lasted more than 48 hours.
This doesn't affect other regions. Tested sa-east-1, eu-central-1 and us-east-1.
I've also tried to play with different s3 URLs, by providing a specific region endpoint.
Not sure if this behavior is going to be rolled out to other regions or what. This fix isn't ideal if the stack is not in the same region as the bucket but I'm counting on the header will be accepted.
Feel free to tune in @tarunmenon95 and @jaredbrook