You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Biswa Ranjan Ray (JIRA)" <ji...@apache.org> on 2019/01/07 08:04:00 UTC

[jira] [Created] (JCLOUDS-1483) Removing a blob from a Swift container using BlobStore.removeBlob fails.

Biswa Ranjan Ray created JCLOUDS-1483:
-----------------------------------------

             Summary: Removing a blob from a Swift container using BlobStore.removeBlob fails.
                 Key: JCLOUDS-1483
                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1483
             Project: jclouds
          Issue Type: Improvement
          Components: jclouds-blobstore
    Affects Versions: 2.1.1
            Reporter: Biswa Ranjan Ray
         Attachments: stacktrace.txt

Hi Team,

I set the issue type to Improvement as I'm not sure if its a bug in jclouds library. :)

*Usecase*: Try to delete a blob (size ~ 107kb) from a swift container using BlobStore.removBlob() api of jclouds.

*Issue*: Following exception is  obtained: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: *Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $*.

*Code*: The below code snippet shows how a blob is deleted from a swift container.

BlobStore blobStore = getBlobStoreContext();              blobStore.removeBlob(containerName, fileName);

**
//To get the BlobStoreContext for OpenStack Swiftprivate BlobStoreContext getBlobStoreContext() { final Properties override = new Properties();
 override.put(KeystoneProperties.KEYSTONE_VERSION, "3");
 override.put(KeystoneProperties.SCOPE, "project:" + swiftConfig.getProject());  final String credential = swiftConfig.getPassword(); final String identity = swiftConfig.getUserDomain() + ":" + swiftConfig.getUsername(); final String authUrl = swiftConfig.getAuthUrl();  return ContextBuilder.newBuilder("openstack-swift")
 .endpoint(authUrl+"/v3")
 .credentials(identity,credential)
 .overrides(override)
 .buildApi(BlobStoreContext.class);
 }
*Debug:* Following are my observations after debugging the code.
 # got the BlobStore. The blobstore type is found to be RegionScopedSwiftBlobStore.
 # stepinto blobStore.removeBlob(containerName, fileName);                                          at line 396 in *RegionScopedSwiftBlobStore* class, it expects a response from *StaticLargeObjectApi* and this is where it throws the exception. DeleteStaticLargeObjectResponse response = api.getStaticLargeObjectApi(regionId, container).delete(name);

*Analysis*: While the api BlobStore.removeBlob fails in a Swift container, it works fine in AWS S3 and GCS container. I also observed that if I use *ObjectApi.delete(objectName)* instead of BlobStore.removeBlob then the blob gets deleted from the swift container. I believe its the StaticLargeObjectApi that's causing issue. As per the java doc of StaticLargeObjectApi, it is in beta and still under evaluation. 

Any help is highly appreciated.

Thank you.

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)