[ 
https://issues.apache.org/jira/browse/JCLOUDS-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819686#comment-15819686
 ] 

Timur Alperovich commented on JCLOUDS-1213:
-------------------------------------------

Reading more about this, I suspect I'm bumping into an issue similar to the one 
reported here: https://github.com/aws/aws-sdk-js/issues/462.

Specifically, when I attempt to resolve the bucket in question, I get back the 
following for a bucket in US-West-2:
{code}
timur-test.s3.amazonaws.com is an alias for s3-us-west-2-w.amazonaws.com.
s3-us-west-2-w.amazonaws.com has address 54.231.184.246
{code}

At this point the GetBucketLocation request, which is meant to go to 
timur-test.s3.amazonaws.com in us-east-1 gets re-routed to a us-west-2 endpoint 
and results in the error I'm seeing. I investigated how the boto3 library 
handles this and they use bucket in-path requests. I'm going to submit a pull 
request for jclouds to do the same. For the particular failure, I suspect the 
difference in networking resulted in my issue, which was not reproducible by 
Andrew.

> 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)

Reply via email to