Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Storage ExecutionEngine.executeWithRetry with error in exception handling #297

JMayrbaeurl opened this Issue · 3 comments

5 participants


The method, PARENT_TYPE, StorageOperation, RetryPolicyFactory, OperationContext) indirectly uses, OperationContext) in case of IOException handling (line 147 in the source file for ExecutionEngine) that doesn't check the errorResponse stream from the HTTP request. In case of e.g. time outs, the errorResponse stream can be null, causing a 'java.lang.IllegalArgumentException: Null InputStream is not a valid argument' at com.ctc.wstx.stax.WstxInputFactory.createSR(

Can be easily fixed by changing, OperationContext) to:

protected static StorageExtendedErrorInformation getErrorDetailsFromRequest(final HttpURLConnection request,
        final OperationContext opContext) {
    if (request == null) {
        return null;
    try {
        // First check the existence of an error stream
        InputStream err = request.getErrorStream();
        if (err != null) {
            final StorageErrorResponse response = new StorageErrorResponse(request.getErrorStream());
            return response.getExtendedErrorInformation();
            return null;
    catch (final XMLStreamException e) {
        return null;

BTW. The root cause is that doesn't check the input parameter for null values


Root cause of the problem comes from using other XML stream reader implementations than the default one from the standard Java SDK. E.g. with Woodstox (see, quite popular) you'll get an IllegalArgumentException, if you pass null as the value for the input stream on creating a XML stream reader.

@JMayrbaeurl JMayrbaeurl referenced this issue from a commit in JMayrbaeurl/azure-sdk-for-java
@JMayrbaeurl JMayrbaeurl Fixes issue #297 Storage ExecutionEngine.executeWithRetry with error in
exception handling

@jeffreyjirwin please take a look.

@andrerod andrerod closed this
@azuresdkci azuresdkci removed this from the Backlog milestone
@azuresdkci azuresdkci removed the storage label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.