jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-1213) S3: Region is not respected
Date Thu, 12 Jan 2017 06:54:52 GMT

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

ASF subversion and git services commented on JCLOUDS-1213:

Commit 3668a9905b4667fa6b9ca47e894a96abd182ea93 in jclouds's branch refs/heads/2.0.x from
[ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=3668a99 ]

GetBucketLocation should use path-style requests.

When making a GetBucketLocation request, Amazon may route the request
to the bucket region. When making it with v4 signer, the request may
fail because of the region mismatch. Concretely, a request to
test.s3.amazonaws.com may resolve to s3-us-west-2-w.amazonaws.com. The
request itself is prepared for the us-east-1 region (s3.amazonaws.com
endpoint), but then fails when the DNS resolution points to a
us-west-2 endpoint.

Bucket-in-path works around this for the GetBucketLocation requests.
That means that every GetBucketLocation request will be of the form:
https://s3.amazonaws.com/{bucket}?location. This ensures that jclouds
requests will not be subjected to Amazon's routing/DNS pointers.

Fixes: JCLOUDS-1213

> 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
>            Assignee: Timur Alperovich
>              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
> 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

View raw message