jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yao, Julie" <julie....@hpe.com>
Subject RE: Use JClouds to talk to non AWS cloud with S3 API
Date Sun, 31 Jan 2016 19:53:21 GMT
Debug the code
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();

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())
                .credentials(username, password)

        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


-----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?

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 connected
* Connected to jag-itop-svr.dev.opsware.com ( 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.


-----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,

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:


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.



View raw message