You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Archana Chinnaiah (JIRA)" <ji...@apache.org> on 2016/03/10 12:29:40 UTC

[jira] [Created] (JCLOUDS-1090) jClouds not using AWS S3 V4 signature for Frankfurt region

Archana Chinnaiah created JCLOUDS-1090:
------------------------------------------

             Summary: jClouds not using AWS S3 V4 signature for Frankfurt region
                 Key: JCLOUDS-1090
                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1090
             Project: jclouds
          Issue Type: Bug
          Components: jclouds-blobstore
    Affects Versions: 2.0.0
            Reporter: Archana Chinnaiah
            Priority: Blocker


>From the amazon documentation, we understand that the region eu-central-1 (Frankfurt) supports only AWS signature version 4, and from https://issues.apache.org/jira/browse/JCLOUDS-480 we understand the jclouds already has the support added for version 4 signature. 

we have pulled the latest jclouds from master, and used the following client code, but it is not working.

                BlobStoreContext context = ContextBuilder.newBuilder("aws-s3")
                        .credentials("XXXXXXXXXXX", "YYYYYYYYYYYYYYYYYYY")
                        .buildView(BlobStoreContext.class);
           
                // Access the BlobStore
                BlobStore blobStore = context.getBlobStore();
                Location loc = new LocationBuilder().scope(LocationScope.REGION)
                        .id("eu-central-1")
                        .description("region")
                        .build();

                // Create a Container
                blobStore.createContainerInLocation(loc, containername);

                // Create a Blob
                File input = new File("sample.txt");
                long length = input.length();
                // Add a Blob
                Blob blob = blobStore.blobBuilder(objectname).payload(Files.asByteSource(input)).contentLength(length)
                        .contentDisposition(objectname).build();

                // Upload the Blob
                String eTag = blobStore.putBlob(containername, blob);

we see the requests sent is using V2 signature, and the server is rejecting them for "eu-central-1". 

2016-03-08 14:57:57,044 DEBUG [jclouds.wire] [main] >> "Test[\n]"
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> PUT https://testcontainer3.s3-eu-central-1.amazonaws.com/file1 HTTP/1.1
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Expect: 100-continue
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Host: testcontainer3.s3-eu-central-1.amazonaws.com
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Date: Tue, 08 Mar 2016 09:27:50 GMT
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Authorization: AWS AKIAISCW6DRRITWR6IWQ:6AndVHQV2w75OXQDq/9sWt37KN0=
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Content-Type: application/unknown
2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Content-Length: 5

org.jclouds.http.HttpResponseException: Server rejected operation connecting to PUT https://testcontainer3.s3-eu-central-1.amazonaws.com/file1 HTTP/1.1
at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:118)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)


Thanks!





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)