[ 
https://issues.apache.org/jira/browse/JCLOUDS-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16023849#comment-16023849
 ] 

Dilip Simha commented on JCLOUDS-1251:
--------------------------------------

An NPE doesn't sound good. I happened to see this bug too and after digging 
deeper discovered that Openstack-Swift sent a 404 error since it could not find 
the requested object. Surprised that Jclouds throws an NPE instead of relaying 
the 404 error for the removeBlob case.

More importantly, the API for removeBlob is insufficient as it cannot handle 
the case where the blob is not present.
I would opt to see either an exception or return a success/failure value to 
confirm if blob was not removed or not.

Any comments ?

> Swift removeBlob
> ----------------
>
>                 Key: JCLOUDS-1251
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1251
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 2.0.0
>         Environment: RHEL 7
> Java 1.7
>            Reporter: Archana Chinnaiah
>            Assignee: Andrew Gaul
>              Labels: openstack-swift
>
> RemoveBlob for swift is unsuccessful, and fails with the following error
> {code}
> Mar 01, 2017 12:08:50 PM org.jclouds.logging.jdk.JDKLogger logError
> SEVERE: Error parsing input: null
> java.lang.NullPointerException
>       at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:60)
>       at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:41)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
>       at 
> org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
>       at 
> com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
>       at com.sun.proxy.$Proxy73.delete(Unknown Source)
>       at 
> org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.removeBlob(RegionScopedSwiftBlobStore.java:393)
>       at main.java.s3_19.App.main(App.java:106)
> Exception in thread "main" org.jclouds.http.HttpResponseException: Error 
> parsing input: null
> {statusCode=204, message=No Content, headers={Date=[Wed, 01 Mar 2017 06:46:49 
> GMT], X-Trans-Id=[txa66b195a2b4b4723931ca-0058b66e59], 
> Connection=[keep-alive]}}
>       at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:67)
>       at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:41)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
>       at 
> org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
>       at 
> com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
>       at com.sun.proxy.$Proxy73.delete(Unknown Source)
>       at 
> org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore.removeBlob(RegionScopedSwiftBlobStore.java:393)
>       at main.java.s3_19.App.main(App.java:106)
> Caused by: java.lang.NullPointerException
>       at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:60)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to