[
https://issues.apache.org/jira/browse/JCLOUDS-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819568#comment-15819568
]
Timur Alperovich commented on JCLOUDS-1213:
-------------------------------------------
Thanks for checking. I can reproduce this consistently with 2.1.0-SNAPSHOT, as
well. I'll attempt to debug this locally. The specific difference that I'm
observing is the response to the bucket location request against the EU bucket:
{code}
>> GET https://timur-test-ireland.s3.amazonaws.com/?location HTTP/1.1
>> Host: timur-test-ireland.s3.amazonaws.com
>> x-amz-content-sha256:
>> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
>> X-Amz-Date: 20170111T233842Z
>> Authorization: AWS4-HMAC-SHA256
>> Credential=AKIAIT4YWLZX26RHCRKQ/20170111/us-east-1/s3/aws4_request,
>> SignedHeaders=host;x-amz-content-sha256;x-amz-date,
>> Signature=2ca401371c162bd8e08fd161c2c330d5f887d08ae4f5996d3d2040e9032be86d
<< HTTP/1.1 400 Bad Request
<< Transfer-Encoding: chunked
<< Server: AmazonS3
<< Connection: close
<< x-amz-request-id: 580278C04C186502
<< x-amz-id-2:
1lEvRCBWBmb3Tt/xe8T7u7HVuUNCT3hNWfzfd3VwKFWhmE56rf2y2iaRk1UCT1YkMK78Q+hpKlI=
<< Date: Wed, 11 Jan 2017 23:37:57 GMT
<< Content-Type: application/xml
org.jclouds.aws.AWSResponseException: request GET
https://timur-test-ireland.s3.amazonaws.com/?location HTTP/1.1 failed with code
400, error: AWSError{requestId='580278C04C186502',
requestToken='1lEvRCBWBmb3Tt/xe8T7u7HVuUNCT3hNWfzfd3VwKFWhmE56rf2y2iaRk1UCT1YkMK78Q+hpKlI=',
code='AuthorizationHeaderMalformed', message='The authorization header is
malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1'',
context='{Region=eu-west-1,
HostId=1lEvRCBWBmb3Tt/xe8T7u7HVuUNCT3hNWfzfd3VwKFWhmE56rf2y2iaRk1UCT1YkMK78Q+hpKlI=}'}
{code}
> S3: Region is not respected
> ---------------------------
>
> Key: JCLOUDS-1213
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1213
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 2.0.0
> Reporter: Halvdan Hoem Grelland
> Labels: aws-s3
>
> When using a BlobStore configured for the 'aws-s3' provider and with an
> explicit region ('eu-west-1' in this case),
> _BlobStore.createContainerInLocation(Location location, String container)_
> fails with a 400 when attempting to create an already existing bucket on that
> location.
> The error message from AWS claims the cause to be
> _AuthorizationHeaderMalformed_, and says that 'eu-west-1' was expected, but
> that 'us-east-1' was supplied in the PUT request.
> I have confirmed that 'eu-west-1' is, in fact, given to the method call, but
> it does not seem to be respected when forming and signing the request.
> This does not happen on 1.9.x.
> From the debugging i have done a likely culprit seems to be
> _Aws4SignerForAuthorizationHeader_ which resolves a _ServiceAndRegion_
> instance, which in turn seem to attempt parsing the region from the hostname
> URL (_AWSHostNameUtils.parseRegionName(..)_). I cannot see the region set for
> the provider being respected in this case.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)