HP-Cloud Storage: cannot upload a blob with payload

429 Views Asked by At

Here is an Example of my code:

    Properties props = new Properties();
    props.setProperty(KeystoneProperties.CREDENTIAL_TYPE, CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
    context = ContextBuilder.newBuilder("hpcloud-objectstorage")
        .overrides(props)
        .credentials(api_key, api_secret)
        .buildView(BlobStoreContext.class);
    store = context.getBlobStore();

    // this works
    Blob blob1 = store.blobBuilder("file1")
        .payload("")
        .build();

    String blobName1 = store.putBlob(remoteFolderName, blob1);

    // this crashes with the message, you can see below
    Blob blob2 = store.blobBuilder("file2")
        .payload("a")
        .build();

    String blobName1 = store.putBlob(remoteFolderName, blob2);

the exception message I get after executing this code is following:

    Nov 07, 2012 7:08:44 PM org.jclouds.logging.jdk.JDKLogger logError
    Schwerwiegend: Cannot retry after server error, command has exceeded retry limit 5: [method=HPCloudObjectStorageAsyncApi.putObject, request=PUT https://region-a.geo-1.objects.hpcloudsvc.com/v1/82797321453196/cloudstoretest/file2 HTTP/1.1]

an here is the stacktrace:

    org.jclouds.http.HttpResponseException: Unexpected end of file from server connecting to PUT https://region-a.geo-1.objects.hpcloudsvc.com/v1/82797321453196/cloudstoretest/tada%21 HTTP/1.1
    at org.jclouds.http.internal.BaseHttpCommandExecutorService$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:179)
    at org.jclouds.http.internal.BaseHttpCommandExecutorService$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:135)
    ...

I dont have any clue, what the problem could be. I'm searching for 2 days for possible solutions, but without any result. I would be very happy, if someone has an idea, what i am doing wrong...

1

There are 1 best solutions below

2
On

looks like the name of your blob is literally "tada!" based on the url encoded "tada%21"

it is quite possible that the openstack swift implementation doesn't support blobs with names including a trailing '!'. Can you try other naming conventions and see if you have the same error?