[ 
https://issues.apache.org/jira/browse/JCLOUDS-1364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Deyan updated JCLOUDS-1364:
---------------------------
    Description: 
When I try to retrieve an object from default region (s3.amazonaws.com) and the 
object is located on another region I am getting the following response:

Response:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to 
access must be addressed using the specified endpoint. Please send all future 
requests to this 
endpoint.</Message><Bucket>tactical-123-456</Bucket><Endpoint>tactical-123-456.s3-ap-southeast-1.amazonaws.com</Endpoint><RequestId>91190A5E9A8C0110</RequestId><HostId>/Zg8SRJuO6fhm9vcaQ+aYqLg0jHjS52Sol2wmIa5GIQLM2vWwK8aSwiVNN7vnNesay4KiJK8DuE=</HostId></Error>
{code}

That's fine. But then jclouds triggers another call pointed to the right region 
with the following request body:

{code:java}

GET 
http://tactical-123-456.s3-ap-southeast-1.amazonaws.com/tactical-123-456/table.PNG
 HTTP/1.1
Date: Mon, 04 Dec 2017 09:43:50 GMT
Authorization: AWS {token}
User-Agent: jclouds/2.0.2 java/1.8.0_131
Host: tactical-123-456.s3-ap-southeast-1.amazonaws.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

{code}

and then response from aws s3 service is:

{code:java}

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we 
calculated does not match the signature you provided. Check your key and 
signing 
method.</Message><AWSAccessKeyId>AKIAJJ6ITRWPND6R7ZRA</AWSAccessKeyId><StringToSign>GET


Mon, 04 Dec 2017 09:43:50 GMT
/tactical-123-456/tactical-123-456/table.PNG</StringToSign><SignatureProvided>nAwL9IovpYhFI4psYKlR/Gna51Y=</SignatureProvided><StringToSignBytes>47
 45 54 0a 0a 0a 4d 6f 6e 2c 20 30 34 20 44 65 63 20 32 30 31 37 20 30 39 3a 34 
33 3a 35 30 20 47 4d 54 0a 2f 74 61 63 74 69 63 61 6c 2d 31 32 33 2d 34 35 36 
2f 74 61 63 74 69 63 61 6c 2d 31 32 33 2d 34 35 36 2f 74 61 62 6c 65 2e 50 4e 
47</StringToSignBytes><RequestId>6BDA40D7997B95FA</RequestId><HostId>vmXs0sSYKD1+93y8U1ki9XOdUkk5ySwvBlaBQ9y3fVQqXkW6eH8Jr+ueUrWX45m6kfbLo5bAmDs=</HostId></Error>

{code}

It seems jclouds does not sign the seconds request properly.

*Edit*: Actually the second request header field is:


{code:java}
GET 
http://tactical-123-456.s3-ap-southeast-1.amazonaws.com/tactical-123-456/table.PNG
 HTTP/1.1

{code}
 







  was:
When I try to retrieve an object from default region (s3.amazonaws.com) and the 
object is located on another region I am getting the following response:

Response:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to 
access must be addressed using the specified endpoint. Please send all future 
requests to this 
endpoint.</Message><Bucket>tactical-123-456</Bucket><Endpoint>tactical-123-456.s3-ap-southeast-1.amazonaws.com</Endpoint><RequestId>91190A5E9A8C0110</RequestId><HostId>/Zg8SRJuO6fhm9vcaQ+aYqLg0jHjS52Sol2wmIa5GIQLM2vWwK8aSwiVNN7vnNesay4KiJK8DuE=</HostId></Error>
{code}

That's fine. But then jclouds triggers another call pointed to the right region 
with the following request body:

{code:java}

GET 
http://tactical-123-456.s3-ap-southeast-1.amazonaws.com/tactical-123-456/table.PNG
 HTTP/1.1
Date: Mon, 04 Dec 2017 09:43:50 GMT
Authorization: AWS {token}
User-Agent: jclouds/2.0.2 java/1.8.0_131
Host: tactical-123-456.s3-ap-southeast-1.amazonaws.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

{code}

and then response from aws s3 service is:

{code:java}

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we 
calculated does not match the signature you provided. Check your key and 
signing 
method.</Message><AWSAccessKeyId>AKIAJJ6ITRWPND6R7ZRA</AWSAccessKeyId><StringToSign>GET


Mon, 04 Dec 2017 09:43:50 GMT
/tactical-123-456/tactical-123-456/table.PNG</StringToSign><SignatureProvided>nAwL9IovpYhFI4psYKlR/Gna51Y=</SignatureProvided><StringToSignBytes>47
 45 54 0a 0a 0a 4d 6f 6e 2c 20 30 34 20 44 65 63 20 32 30 31 37 20 30 39 3a 34 
33 3a 35 30 20 47 4d 54 0a 2f 74 61 63 74 69 63 61 6c 2d 31 32 33 2d 34 35 36 
2f 74 61 63 74 69 63 61 6c 2d 31 32 33 2d 34 35 36 2f 74 61 62 6c 65 2e 50 4e 
47</StringToSignBytes><RequestId>6BDA40D7997B95FA</RequestId><HostId>vmXs0sSYKD1+93y8U1ki9XOdUkk5ySwvBlaBQ9y3fVQqXkW6eH8Jr+ueUrWX45m6kfbLo5bAmDs=</HostId></Error>

{code}

It seems jclouds does not sign the seconds request properly








> Get object fails when Permanent Redirect is in place from aws
> -------------------------------------------------------------
>
>                 Key: JCLOUDS-1364
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1364
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 2.0.2
>            Reporter: Deyan
>
> When I try to retrieve an object from default region (s3.amazonaws.com) and 
> the object is located on another region I am getting the following response:
> Response:
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting 
> to access must be addressed using the specified endpoint. Please send all 
> future requests to this 
> endpoint.</Message><Bucket>tactical-123-456</Bucket><Endpoint>tactical-123-456.s3-ap-southeast-1.amazonaws.com</Endpoint><RequestId>91190A5E9A8C0110</RequestId><HostId>/Zg8SRJuO6fhm9vcaQ+aYqLg0jHjS52Sol2wmIa5GIQLM2vWwK8aSwiVNN7vnNesay4KiJK8DuE=</HostId></Error>
> {code}
> That's fine. But then jclouds triggers another call pointed to the right 
> region with the following request body:
> {code:java}
> GET 
> http://tactical-123-456.s3-ap-southeast-1.amazonaws.com/tactical-123-456/table.PNG
>  HTTP/1.1
> Date: Mon, 04 Dec 2017 09:43:50 GMT
> Authorization: AWS {token}
> User-Agent: jclouds/2.0.2 java/1.8.0_131
> Host: tactical-123-456.s3-ap-southeast-1.amazonaws.com
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Connection: keep-alive
> {code}
> and then response from aws s3 service is:
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we 
> calculated does not match the signature you provided. Check your key and 
> signing 
> method.</Message><AWSAccessKeyId>AKIAJJ6ITRWPND6R7ZRA</AWSAccessKeyId><StringToSign>GET
> Mon, 04 Dec 2017 09:43:50 GMT
> /tactical-123-456/tactical-123-456/table.PNG</StringToSign><SignatureProvided>nAwL9IovpYhFI4psYKlR/Gna51Y=</SignatureProvided><StringToSignBytes>47
>  45 54 0a 0a 0a 4d 6f 6e 2c 20 30 34 20 44 65 63 20 32 30 31 37 20 30 39 3a 
> 34 33 3a 35 30 20 47 4d 54 0a 2f 74 61 63 74 69 63 61 6c 2d 31 32 33 2d 34 35 
> 36 2f 74 61 63 74 69 63 61 6c 2d 31 32 33 2d 34 35 36 2f 74 61 62 6c 65 2e 50 
> 4e 
> 47</StringToSignBytes><RequestId>6BDA40D7997B95FA</RequestId><HostId>vmXs0sSYKD1+93y8U1ki9XOdUkk5ySwvBlaBQ9y3fVQqXkW6eH8Jr+ueUrWX45m6kfbLo5bAmDs=</HostId></Error>
> {code}
> It seems jclouds does not sign the seconds request properly.
> *Edit*: Actually the second request header field is:
> {code:java}
> GET 
> http://tactical-123-456.s3-ap-southeast-1.amazonaws.com/tactical-123-456/table.PNG
>  HTTP/1.1
> {code}
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to