jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <andr...@apache.org>
Subject RE: Use JClouds to talk to non AWS cloud with S3 API
Date Sun, 31 Jan 2016 20:26:37 GMT
Hi Julie

Thanks for the additional details! Good to see we're now trying to 
connect to the same URL in both cases (i.e. 
http://jag-itop-svr.dev.opsware.com:8080/public).

Could you attach the wire and header logs from *this* failed jclouds 
call? Now that we have the details from s3curl, we should be able to see 
what is different about the request jclouds is sending.

Regards

ap

On 2016-01-31 14:53, Yao, Julie wrote:
> Debug the code
> org.jclouds.http.internal.JavaUrlHttpCommandExecutorService
> protected HttpResponse invoke(HttpURLConnection connection) throws
> IOException, InterruptedException {
>       HttpResponse.Builder<?> builder = HttpResponse.builder();
>       InputStream in = null;
>       try {
>          in = connection.getInputStream();
>       } catch (IOException e) {
>          in = connection.getErrorStream();
> 
> detailmessage:
> Server returned HTTP response code: 500 for URL:
> http://jag-itop-svr.dev.opsware.com:8080/public
> I checked connection.authObj: null
> Is connection.authObj correct?
> 
> Here is my code:
> String username = "test:tester";
>         String password = "testing";
>         Properties overrides = new Properties();
>         overrides.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, 
> "false");
>        overrides.setProperty(PROPERTY_S3_SERVICE_PATH, "/");
> 
>         BlobStoreContext context = ContextBuilder.newBuilder(new
> S3ApiMetadata())
>                 .endpoint("http://jag-itop-svr.dev.opsware.com:8080")
>                 .credentials(username, password)
>                 .overrides(overrides)
>                 .modules(modules)
>                 .buildView(BlobStoreContext.class);
> 
>         BlobStore blobStore = context.getBlobStore();
>         String bucket="public";
>         boolean exist = blobStore.containerExists(bucket);
> 
> I also have VM args:
> -Djclouds.trust-all-certs=true -Djclouds.relax-hostname=true
> -Djclouds.provider=s3
> 
> Thanks!
> 
> -----Original Message-----
> From: Yao, Julie
> Sent: Sunday, January 31, 2016 10:01 AM
> To: Andrew Phillips; user@jclouds.apache.org
> Subject: RE: Use JClouds to talk to non AWS cloud with S3 API
> 
>> Ah, OK. To confirm: are we calling a Walrus installation here?
> No
> 
> I got s3curl.pl working. I have a bucket called 'public'. The rest api
> to see if the bucket 'public' exist:
> HEAD /public
> 
> ./s3curl.pl --id 'test:tester' --key 'testing' --head --  -v  http://
> jag-itop-svr.dev.opsware.com:8080/public
> * About to connect() to jag-itop-svr.dev.opsware.com port 8080
> *   Trying 192.168.34.176... connected
> * Connected to jag-itop-svr.dev.opsware.com (192.168.34.176) port 8080
>> HEAD /public HTTP/1.1
>> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5
>> OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
>> Host: jag-itop-svr.dev.opsware.com:8080
>> Accept: */*
>> Date: Sun, 31 Jan 2016 17:54:30 +0000
>> Authorization: AWS test:tester:K4fukbjysjqzsArmq8EXHnc/tnE=
>> 
> < HTTP/1.1 200 OK
> HTTP/1.1 200 OK
> < x-amz-id-2: tx29a5adaa1d8345c882658-0056ae4ab0
> x-amz-id-2: tx29a5adaa1d8345c882658-0056ae4ab0
> < Content-Length: 0
> Content-Length: 0
> < x-amz-request-id: tx29a5adaa1d8345c882658-0056ae4ab0
> x-amz-request-id: tx29a5adaa1d8345c882658-0056ae4ab0
> < Content-Type: text/plain; charset=utf-8
> Content-Type: text/plain; charset=utf-8
> < X-Trans-Id: tx29a5adaa1d8345c882658-0056ae4ab0
> X-Trans-Id: tx29a5adaa1d8345c882658-0056ae4ab0
> < Date: Sun, 31 Jan 2016 17:56:00 GMT
> Date: Sun, 31 Jan 2016 17:56:00 GMT
> 
> I will download source code to debug.
> 
> Thanks!
> 
> 
> -----Original Message-----
> From: Andrew Phillips [mailto:andrewp@apache.org]
> Sent: Friday, January 29, 2016 6:35 PM
> To: user@jclouds.apache.org
> Cc: Yao, Julie
> Subject: RE: Use JClouds to talk to non AWS cloud with S3 API
> 
>> I guess
>> overrides.setProperty(PROPERTY_S3_SERVICE_PATH, "/services/Walrus");
>> is not correct.
>> Without it, it will throw exception.
> 
> Ah, OK. To confirm: are we calling a Walrus installation here?
> 
> Also, in your boto code snippet:
> 
>      def connect(self):
>          self.connection = boto.connect_s3 (
>              aws_access_key_id = self.access_key_id,
>              aws_secret_access_key = self.secret_access_key,
>              port = self.port,
>              host= self.host,
>              is_secure=False,
>              calling_format=boto.s3.connection.OrdinaryCallingFormat()
>          )
> 
> What are the values of "self.host" and "self.port"? I'm assuming they
> are "myserver" and "8080", or so? In that case, boto should also be
> looking for http://myserver:8080/julie, and not
> http://myserver:8080/services/Walrus/julie, which the jclouds settings
> are causing us to call.
> 
> Please see if you can make a successful HEAD Bucket call using cURL or
> other web request generator:
> 
> http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketHEAD.html
> 
> It will be much easier to determine the correct settings for jclouds
> once we have an actual example of an HTTP request to your service that
> is successful.
> 
> Regards
> 
> ap

Mime
View raw message