You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Zhen-Huan HWANG (Jira)" <ji...@apache.org> on 2020/11/09 20:31:00 UTC

[jira] [Created] (JCLOUDS-1556) Trying to parse S3 HEAD error response causes IllegalArgumentException: not an xml document

Zhen-Huan HWANG created JCLOUDS-1556:
----------------------------------------

             Summary: Trying to parse S3 HEAD error response causes IllegalArgumentException: not an xml document
                 Key: JCLOUDS-1556
                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1556
             Project: jclouds
          Issue Type: Bug
          Components: jclouds-blobstore
    Affects Versions: 2.2.1
            Reporter: Zhen-Huan HWANG


When a HEAD call to S3 results in error the attempt to parse response body causes an exception and an error to be logged.
{code:java}
2020/11/09 20:20:00.000205 WARN  <org.jclouds.aws.util.AWSUtils taskScheduler-3> error parsing error
java.lang.RuntimeException: request: HEAD https://<REDACTED> HTTP/1.1; response: HTTP/1.1 404 Not Found; cause: java.lang.RuntimeException: request: HEAD https://<REDACTED> HTTP/1.1; response: HTTP/1.1 404 Not Found; source:
; cause: java.lang.IllegalArgumentException: not an xml document []
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:174)
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:146)
        at org.jclouds.http.functions.ParseSax.apply(ParseSax.java:86)
        at org.jclouds.aws.util.AWSUtils.parseAWSErrorFromContent(AWSUtils.java:90)
        at org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError(ParseAWSErrorFromXmlContent.java:73)
        at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
        at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:138)
        at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:107)
        at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:91)
        at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
        at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
        at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
        at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
        at com.sun.proxy.$Proxy180.objectExists(Unknown Source)
        at org.jclouds.s3.blobstore.S3BlobStore.blobExists(S3BlobStore.java:208)
        <REDACTED>...
Caused by: java.lang.RuntimeException: request: HEAD https://<REDACTED> HTTP/1.1; response: HTTP/1.1 404 Not Found; source:
; cause: java.lang.IllegalArgumentException: not an xml document []
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:174)
        at org.jclouds.http.functions.ParseSax.convertStreamToStringAndParse(ParseSax.java:102)
        at org.jclouds.http.functions.ParseSax.apply(ParseSax.java:82)
        ... 31 more
Caused by: java.lang.IllegalArgumentException: not an xml document []
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:164)
        at org.jclouds.http.functions.ParseSax.validateXml(ParseSax.java:117)
        at org.jclouds.http.functions.ParseSax.convertStreamToStringAndParse(ParseSax.java:98)
        ... 32 more
{code}
According to RFC 2616, "... The HEAD method is identical to GET except that the server *MUST NOT* return a message-body in the response. ..."



--
This message was sent by Atlassian Jira
(v8.3.4#803005)