rui
rui

Reputation: 11284

StorageException: Blob data corrupted. Incorrect number of bytes received - is this a bug in my code or azure server problems?

I am getting the occasional exception downloading block blobs in Azure. The exception message goes like this:

StorageException: Blob data corrupted. Incorrect number of bytes received

My questions are:

  1. Is this a problem on the Azure server side or could it be due to a bug in my client code?
  2. Has anyone seen this before and has any idea what the fix should be?

A bit more info on this problem - it seems like that if I try reading the same BlockBlob moments later it downloads it just fine with the same exact code.

Thanks, rui

Upvotes: 1

Views: 1944

Answers (2)

rui
rui

Reputation: 11284

I just got confirmation that this was not due to user code. The download connections the Azure APIs make to download blobs were being severed to early causing the incorrect number of bytes problem.

My servers have been running untouched ever since I've filed this question and the problem has completely disappeared. My servers are running exactly at the same volume of requests are before.

Thanks, rui

Upvotes: 1

Fernando Correia
Fernando Correia

Reputation: 22365

This exception indicates data integrity problems during transport. Check the ErrorCode, ExtendedErrorInformation and StatusCode properties for additional details.

Windows Azure Blob MD5 Overview explains how the optional MD5 checking may be applied to ensure data integrity. This applies only to HTTP connections; since HTTPS provides transport layer security additional MD5 checking is not needed while connecting over HTTPS as it would be redundant.

The most appropriate way to handle this is probably through transient fault handling. Enterprise Library 6 provides the Transient Fault Handling Application Block that can be used for achieving fault-tolerance. For additional information refer to Dealing with Windows Azure Storage transient faults.

Upvotes: 1

Related Questions