Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.2
-
None
-
None
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:
<?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>
That's fine. But then jclouds triggers another call pointed to the right region with the following request body:
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
and then response from aws s3 service is:
<?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>
It seems jclouds does not sign the seconds request properly.
Edit: Actually the second request header field is:
GET http://tactical-123-456.s3-ap-southeast-1.amazonaws.com/tactical-123-456/table.PNG HTTP/1.1