You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Forrest Townsend <fo...@gmail.com> on 2015/12/02 19:17:23 UTC

jclouds 1.8.1 to Openstack Swift3 object store

Hey,

I have done some investigation on getting communication setup to my object
store on my Openstack machine using Swift3. Using Swift3 to emulate s3
calls for testing before I start getting billed against the real S3. Does
anyone have any recommendations on connecting to Swift3?

Have this override set --
overrides.put( "jclouds.s3.virtual-host-buckets", "false" );

been playing with these as well --
// overrides.put( "jclouds.trust-all-certs", "true" );
// overrides.put( "jclouds.relax-hostname", "true" );
// overrides.setProperty(PROPERTY_S3_SERVICE_PATH, "/");

Been looking through user submitted recommendations like these (Not sure if
I should be looking into Walrus?):
- https://groups.google.com/forum/#!topic/jclouds/y4FzL8UpnW4
-
http://stackoverflow.com/questions/9389840/use-jclouds-to-talk-to-non-aws-cloud-with-s3-api

Also have tried using the 'aws-s3' as well as 's3' flags for the Blobstore
contextBuilder.

Keep getting these kinds of errors on *createContainerInLocation(null,
containerName)* --

2015-12-02 10:53:06.995 DEBUG [Thread-6]
o.j.l.s.f.RegionIdsFromConfiguration no jclouds.regions configured for
provider s3
2015-12-02 10:53:07.143 DEBUG [Thread-8]
o.j.l.s.f.RegionIdsFromConfiguration no jclouds.regions configured for
provider s3
2015-12-02 10:53:07.151 DEBUG [Thread-9] o.j.l.s.f.ZoneIdsFromConfiguration
no jclouds.zones configured for provider s3
2015-12-02 10:53:07.196 DEBUG [Thread-9] o.j.r.i.InvokeHttpMethod >>
invoking CreateBucket
2015-12-02 10:53:07.198 DEBUG [Thread-9] j.signature >> PUT
http://<url>:8080/225-b7ff7d008a2711e5bbb9080027001c70
HTTP/1.1
2015-12-02 10:53:07.199 DEBUG [Thread-9] j.signature >> Date: Wed, 02 Dec
2015 17:53:07 GMT
2015-12-02 10:53:07.201 DEBUG [Thread-9] j.signature >> "PUT[\n]"
2015-12-02 10:53:07.201 DEBUG [Thread-9] j.signature >> "[\n]"
2015-12-02 10:53:07.201 DEBUG [Thread-9] j.signature >> "[\n]"
2015-12-02 10:53:07.201 DEBUG [Thread-9] j.signature >> "Wed, 02 Dec 2015
17:53:07 GMT[\n]"
2015-12-02 10:53:07.201 DEBUG [Thread-9] j.signature >>
"/225-b7ff7d008a2711e5bbb9080027001c70"
2015-12-02 10:53:07.563 DEBUG [Thread-9] j.signature <<
"NadVulYEvHDTE7L3XgBRAgfrZDM="
2015-12-02 10:53:07.564 DEBUG [Thread-9] j.signature << PUT
http://<url>:8080/225-b7ff7d008a2711e5bbb9080027001c70
HTTP/1.1
2015-12-02 10:53:07.564 DEBUG [Thread-9] j.signature << Date: Wed, 02 Dec
2015 17:53:07 GMT
2015-12-02 10:53:07.564 DEBUG [Thread-9] j.signature << Authorization: AWS
4390335ffca74ff6a317377cc9f27914:NadVulYEvHDTE7L3XgBRAgfrZDM=
2015-12-02 10:53:07.565 DEBUG [Thread-9]
o.j.h.i.JavaUrlHttpCommandExecutorService Sending request -1334102125: PUT
http://<url>:8080/225-b7ff7d008a2711e5bbb9080027001c70 HTTP/1.1
2015-12-02 10:53:07.565 DEBUG [Thread-9] j.headers >> PUT
http://<url>:8080/225-b7ff7d008a2711e5bbb9080027001c70
HTTP/1.1
2015-12-02 10:53:07.565 DEBUG [Thread-9] j.headers >> Date: Wed, 02 Dec
2015 17:53:07 GMT
2015-12-02 10:53:07.565 DEBUG [Thread-9] j.headers >> Authorization: AWS
4390335ffca74ff6a317377cc9f27914:NadVulYEvHDTE7L3XgBRAgfrZDM=
2015-12-02 10:53:07.593 DEBUG [Thread-9]
o.j.h.i.JavaUrlHttpCommandExecutorService Receiving response -1334102125:
HTTP/1.1 412 Precondition Failed
2015-12-02 10:53:07.593 DEBUG [Thread-9] j.headers << HTTP/1.1 412
Precondition Failed
2015-12-02 10:53:07.593 DEBUG [Thread-9] j.headers << Connection: keep-alive
2015-12-02 10:53:07.593 DEBUG [Thread-9] j.headers << X-Trans-Id:
txca0fc76b1a864a02a704e-00565f3004
2015-12-02 10:53:07.593 DEBUG [Thread-9] j.headers << Date: Wed, 02 Dec
2015 17:53:08 GMT
2015-12-02 10:53:07.593 DEBUG [Thread-9] j.headers << Content-Type:
text/html; charset=UTF-8
2015-12-02 10:53:07.594 DEBUG [Thread-9] j.headers << Content-Length: 7
2015-12-02 10:53:07.594 DEBUG [Thread-9] j.wire << "Bad URL"


------

2015-12-02 10:56:09.973 DEBUG [Thread-16]
o.j.l.s.f.RegionIdsFromConfiguration no jclouds.regions configured for
provider s3
2015-12-02 10:56:10.051 DEBUG [Thread-17]
o.j.l.s.f.RegionIdsFromConfiguration no jclouds.regions configured for
provider s3
2015-12-02 10:56:10.057 DEBUG [Thread-18]
o.j.l.s.f.ZoneIdsFromConfiguration no jclouds.zones configured for provider
s3
2015-12-02 10:56:10.061 DEBUG [Thread-18] o.j.r.i.InvokeHttpMethod >>
invoking CreateBucket
2015-12-02 10:56:10.062 DEBUG [Thread-18] j.signature >> PUT
http://<url>:8080/226-b7ff7d008a2711e5bbb9080027001c70
HTTP/1.1
2015-12-02 10:56:10.062 DEBUG [Thread-18] j.signature >> Date: Wed, 02 Dec
2015 17:56:10 GMT
2015-12-02 10:56:10.063 DEBUG [Thread-18] j.signature >> "PUT[\n]"
2015-12-02 10:56:10.063 DEBUG [Thread-18] j.signature >> "[\n]"
2015-12-02 10:56:10.063 DEBUG [Thread-18] j.signature >> "[\n]"
2015-12-02 10:56:10.063 DEBUG [Thread-18] j.signature >> "Wed, 02 Dec 2015
17:56:10 GMT[\n]"
2015-12-02 10:56:10.063 DEBUG [Thread-18] j.signature >>
"/226-b7ff7d008a2711e5bbb9080027001c70"
2015-12-02 10:56:10.063 DEBUG [Thread-18] j.signature <<
"5RaoUn0skxX8fyl6gSdz8Klx4rU="
2015-12-02 10:56:10.064 DEBUG [Thread-18] j.signature << PUT
http://<url>:8080/226-b7ff7d008a2711e5bbb9080027001c70
HTTP/1.1
2015-12-02 10:56:10.064 DEBUG [Thread-18] j.signature << Date: Wed, 02 Dec
2015 17:56:10 GMT
2015-12-02 10:56:10.064 DEBUG [Thread-18] j.signature << Authorization: AWS
4390335ffca74ff6a317377cc9f27914:5RaoUn0skxX8fyl6gSdz8Klx4rU=
2015-12-02 10:56:10.064 DEBUG [Thread-18]
o.j.h.i.JavaUrlHttpCommandExecutorService Sending request -346231187: PUT
http://<url>:8080/226-b7ff7d008a2711e5bbb9080027001c70 HTTP/1.1
2015-12-02 10:56:10.064 DEBUG [Thread-18] j.headers >> PUT
http://<url>:8080/226-b7ff7d008a2711e5bbb9080027001c70
HTTP/1.1
2015-12-02 10:56:10.064 DEBUG [Thread-18] j.headers >> Date: Wed, 02 Dec
2015 17:56:10 GMT
2015-12-02 10:56:10.064 DEBUG [Thread-18] j.headers >> Authorization: AWS
4390335ffca74ff6a317377cc9f27914:5RaoUn0skxX8fyl6gSdz8Klx4rU=
2015-12-02 10:56:10.074 DEBUG [Thread-18]
o.j.h.i.JavaUrlHttpCommandExecutorService Receiving response -346231187:
HTTP/1.1 412 Precondition Failed
2015-12-02 10:56:10.074 DEBUG [Thread-18] j.headers << HTTP/1.1 412
Precondition Failed
2015-12-02 10:56:10.074 DEBUG [Thread-18] j.headers << Connection:
keep-alive
2015-12-02 10:56:10.074 DEBUG [Thread-18] j.headers << X-Trans-Id:
txa21b9b72aa4a40ddb3d3d-00565f30ba
2015-12-02 10:56:10.074 DEBUG [Thread-18] j.headers << Date: Wed, 02 Dec
2015 17:56:10 GMT
2015-12-02 10:56:10.075 DEBUG [Thread-18] j.headers << Content-Type:
text/html; charset=UTF-8
2015-12-02 10:56:10.075 DEBUG [Thread-18] j.headers << Content-Length: 7
2015-12-02 10:56:10.075 DEBUG [Thread-18] j.wire << "Bad URL"


Thanks,
Forrest T.

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Andrew Phillips <an...@apache.org>.
Hi Forrest

Thanks for the update!

> Am able to communicate against the containers/buckets that I
> had problems with on jclouds using boto.

Aha, interesting. From the wire logs, we should hopefully be able to 
figure out what the difference is between the calls that boto and 
jclouds are making.

To try to rule out issues around possible eventual consistency, it would 
be great if, in your testing, you could try making the equivalent boto 
calls as soon as possible after the corresponding (failed) call from 
jclouds.

Looking forward to the next round of test results!

ap

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Forrest Townsend <fo...@gmail.com>.
Hey Andrew,

Am able to communicate against the containers/buckets that I had problems
with on jclouds using boto.

Will be taking another look at the jclouds implementation we have sometime
this week and try debugging then.

Thanks,
Forrest T.


On Thu, Dec 3, 2015 at 12:30 PM Andrew Phillips <an...@apache.org> wrote:

> > Calling get_acl()  on the bucket.
>
> That looks good, indeed. Are you able to try the same call that was
> failing from jclouds, i.e. against the same bucket that jclouds had
> created?
>
> Regards
>
> ap
>

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Andrew Phillips <an...@apache.org>.
> Calling get_acl()  on the bucket.

That looks good, indeed. Are you able to try the same call that was 
failing from jclouds, i.e. against the same bucket that jclouds had 
created?

Regards

ap

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Forrest Townsend <fo...@gmail.com>.
Calling get_acl()  on the bucket.

>> Get ACL for dummy bucket
send: 'GET /boto-demo-1449167038/?acl HTTP/1.1\r\nHost:
{URL}:8080\r\nAccept-Encoding: identity\r\nDate: Thu, 03 Dec 2015 18:23:59
GMT\r\nContent-Length: 0\r\nAuthorization: AWS
{ACCESS-KEY-ID}:9/Iz9Ac+lpflrlcI/xJgr+F7xkc=\r\nUser-Agent: Boto/2.38.0
Python/2.7.10 Windows/7\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: x-amz-id-2: txf15941b17a7e4247b39d1-00566088be

header: Content-Length: 450

header: x-amz-request-id: txf15941b17a7e4247b39d1-00566088be

header: Content-Type: text/plain

header: X-Trans-Id: txf15941b17a7e4247b39d1-00566088be

header: Date: Thu, 03 Dec 2015 18:23:58 GMT

On Thu, Dec 3, 2015 at 11:11 AM Andrew Phillips <an...@apache.org> wrote:

> Hi Forrest
>
> > Here is the code I used to generate results file,
> > http://pastebin.com/x85yHTHW
>
> Looking at the code snippet, it doesn't seem like we're actually making
> an ACL call with boto. Could you see what happens if you add that?
>
>
> http://boto.cloudhackers.com/en/latest/ref/s3.html?highlight=get_acl#boto.s3.bucket.Bucket.get_acl
>
> Regards
>
> ap
>

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Andrew Phillips <an...@apache.org>.
Hi Forrest

> Here is the code I used to generate results file,
> http://pastebin.com/x85yHTHW

Looking at the code snippet, it doesn't seem like we're actually making 
an ACL call with boto. Could you see what happens if you add that?

http://boto.cloudhackers.com/en/latest/ref/s3.html?highlight=get_acl#boto.s3.bucket.Bucket.get_acl

Regards

ap

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Andrew Phillips <an...@apache.org>.
> Could this be related to the fact that I'm using the 's3'
> builder versus the 'aws-s3'?

Intuitively, that seems unlikely: if anything, I'd expect calls made 
using the aws-s3 provider to be *more* AWS-specific than the more 
generic S3 API.

What we'd ideally like to find out is how the boto call is different 
from the call that jclouds is making. Are you able to capture some 
logging for that, and/or make successful calls using cURL?

Regards

ap

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Forrest Townsend <fo...@gmail.com>.
Hi,

Thanks for the quick response.

Am able to get the bucket's acl using the boto3 library.

I could get you the acl output if you would like, if you think that would
be any helpful..

Could this be related to the fact that I'm using the 's3' builder versus
the 'aws-s3'?

Thanks,
Forrest T.

On Wed, Dec 2, 2015, 6:13 PM Andrew Phillips <an...@apache.org> wrote:

> Hi Forrest
>
> Thanks for the update!
>
> > Where it looks like I fail is when I am doing a GET
> > request on this, http://<url>:8080/<bucket_name>?acl, more
> > than once and eventually getting an Internal Server Error --
> >
> > 2015-12-02 17:06:31.095 DEBUG [Thread-12] j.headers >> GET
> >
> http://vcloud210.storage.tucson.ibm.com:8080/418-b7ff7d008a2711e5bbb9080027001c70?acl
>
>  From your code snippets, I would guess that the ACL calls are coming
> from the putBlob call, since createContainerInLocation for the S3 API
> [1] resolves more or less to a straight putBucketInRegion call [2],
> whereas putBlob includes a call to get the bucket's ACL [3].
>
> Having said that, the getBucketACL call [4] is a call that, according to
> these OpenStack docs [5], is "known to be supported". If that call is
> actually blowing up for some reason, that would initially seem to point
> towards a bug on the OpenStack side.
>
> Are you able to make a successful call to get the bucket's ACL with cURL
> or similar, or do you get the same error?
>
> Regards
>
> ap
>
> [1]
>
> https://github.com/jclouds/jclouds/blob/master/apis/s3/src/main/java/org/jclouds/s3/S3Client.java
> [2]
>
> https://github.com/jclouds/jclouds/blob/master/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java#L433
> [3]
>
> https://github.com/jclouds/jclouds/blob/master/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java#L277
> [4]
>
> https://jclouds.apache.org/reference/javadoc/1.8.x/org/jclouds/s3/S3Client.html#getBucketACL(java.lang.String)
> [5] https://wiki.openstack.org/wiki/Swift/APIFeatureComparison
>

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Andrew Phillips <an...@apache.org>.
Hi Forrest

Thanks for the update!

> Where it looks like I fail is when I am doing a GET
> request on this, http://<url>:8080/<bucket_name>?acl, more
> than once and eventually getting an Internal Server Error --
> 
> 2015-12-02 17:06:31.095 DEBUG [Thread-12] j.headers >> GET
> http://vcloud210.storage.tucson.ibm.com:8080/418-b7ff7d008a2711e5bbb9080027001c70?acl

 From your code snippets, I would guess that the ACL calls are coming 
from the putBlob call, since createContainerInLocation for the S3 API 
[1] resolves more or less to a straight putBucketInRegion call [2], 
whereas putBlob includes a call to get the bucket's ACL [3].

Having said that, the getBucketACL call [4] is a call that, according to 
these OpenStack docs [5], is "known to be supported". If that call is 
actually blowing up for some reason, that would initially seem to point 
towards a bug on the OpenStack side.

Are you able to make a successful call to get the bucket's ACL with cURL 
or similar, or do you get the same error?

Regards

ap

[1] 
https://github.com/jclouds/jclouds/blob/master/apis/s3/src/main/java/org/jclouds/s3/S3Client.java
[2] 
https://github.com/jclouds/jclouds/blob/master/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java#L433
[3] 
https://github.com/jclouds/jclouds/blob/master/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java#L277
[4] 
https://jclouds.apache.org/reference/javadoc/1.8.x/org/jclouds/s3/S3Client.html#getBucketACL(java.lang.String)
[5] https://wiki.openstack.org/wiki/Swift/APIFeatureComparison

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Forrest Townsend <fo...@gmail.com>.
Hi

I played around with it more today and got further. Found that using 's3'
instead of 'aws-s3' worked for me (followed this --
http://stackoverflow.com/a/13433822/1348957) . I have been able to create
buckets. Where it looks like I fail is when I am doing a GET request on
this, http://<url>:8080/<bucket_name>?acl, more than once and eventually
getting an Internal Server Error --

2015-12-02 17:06:31.095 DEBUG [Thread-12] j.headers >> GET
http://vcloud210.storage.tucson.ibm.com:8080/418-b7ff7d008a2711e5bbb9080027001c70?acl
HTTP/1.1
2015-12-02 17:06:31.095 DEBUG [Thread-12] j.headers >> Date: Thu, 03 Dec
2015 00:06:31 GMT
2015-12-02 17:06:31.095 DEBUG [Thread-12] j.headers >> Authorization: AWS
4390335ffca74ff6a317377cc9f27914:XFQll6Pnu6zpBhs5Jh/sKn0pgzI=
2015-12-02 17:06:31.288 DEBUG [Thread-12]
o.j.h.i.JavaUrlHttpCommandExecutorService Receiving response -175630661:
HTTP/1.1 500 Internal Server Error
2015-12-02 17:06:31.289 DEBUG [Thread-12] j.headers << HTTP/1.1 500
Internal Server Error
2015-12-02 17:06:31.289 DEBUG [Thread-12] j.headers << Transfer-Encoding:
chunked
2015-12-02 17:06:31.290 DEBUG [Thread-12] j.headers << Connection:
keep-alive
2015-12-02 17:06:31.291 DEBUG [Thread-12] j.headers << x-amz-request-id:
tx643b9995c89941b7b6608-00565f8787
2015-12-02 17:06:31.292 DEBUG [Thread-12] j.headers << x-amz-id-2:
tx643b9995c89941b7b6608-00565f8787
2015-12-02 17:06:31.292 DEBUG [Thread-12] j.headers << X-Trans-Id:
tx643b9995c89941b7b6608-00565f8787
2015-12-02 17:06:31.292 DEBUG [Thread-12] j.headers << Date: Thu, 03 Dec
2015 00:06:31 GMT
2015-12-02 17:06:31.293 DEBUG [Thread-12] j.headers << Content-Type:
application/xml
2015-12-02 17:06:31.294 DEBUG [Thread-12] j.wire << "<?xml version='1.0'
encoding='UTF-8'?>[\n]"
2015-12-02 17:06:31.294 DEBUG [Thread-12] j.wire <<
"<Error><Code>InternalError</Code><Message>unexpected status code
406</Message><RequestId>tx643b9995c89941b7b6608-00565f8787</RequestId></Error>"


What part of the process is this acl checked in jclouds? My project is
doing a    createContainerInLocation(..)   and then that container will get
written to using something like this --
http://pastebin.com/zuMFsf96


Here are some snippets on how we arrange the connection.
http://pastebin.com/LSDVU09w




Thanks,
Forrest T.




On Wed, Dec 2, 2015 at 11:36 AM Andrew Phillips <an...@apache.org> wrote:

> Hi Forrest
>
> Thanks for getting in touch! Could you share the part of the code where
> you're creating the jclouds context in a Gist or Pastie?
>
> And just to clarify: you're trying to connect to an *OpenStack*
> instance, but using the S3 API?
>
> Regards
>
> ap
>
> [1] http://pastie.org
>

Re: jclouds 1.8.1 to Openstack Swift3 object store

Posted by Andrew Phillips <an...@apache.org>.
Hi Forrest

Thanks for getting in touch! Could you share the part of the code where 
you're creating the jclouds context in a Gist or Pastie?

And just to clarify: you're trying to connect to an *OpenStack* 
instance, but using the S3 API?

Regards

ap

[1] http://pastie.org