Error while uploading blocks in Windows Azure blob storage

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives


When trying to upload multiple blocks in the blob storage, following error can occur:

HTTP/1.1 400 The value for one of the HTTP headers is not in the correct format.
Content-Length: 321
Content-Type: application/xml
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 3bc0487c-edb7-4d36-8243-1f39ed692ea9
x-ms-version: 2011-08-18
Date: Sat, 19 May 2012 11:13:53 GMT

<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
RequestId:3bc0487c-edb7-4d36-8243-1f39ed692ea9
Time:2012-05-19T11:13:54.4935587Z</Message><HeaderName>Content-Length</HeaderName><HeaderValue>0</HeaderValue></Error>

The reason why this error is related to the length of the specified block identifier. By default all block identifiers must be of the same length. However all blocks can be of different length.

For example if you have 11 blocks then identifiers should be in following format: 01, 02,..10, 11.
Following is not allowed: 1,2,3,..,10,11. In this case blocks with id 10 and 11 will fail on upload, assuming that blocks 1,2,.. etc. have already been uploaded.


Posted May 19 2012, 01:21 PM by Damir Dobric
Filed under: , ,

Comments

Hrvoje wrote re: Error while uploading blocks in Windows Azure blob storage
on 01-21-2013 23:20

I checked my blockid names, but they're same length! I use this formula to get blockid string:

string blockId = Convert.ToBase64String(BitConverter.GetBytes(_id));

_id goes 1,2,3 ...

and blockId is something like AAAAA==, AwAAA==, AqAAA==, so size is equal for all.

error is this:

Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (400) Bad Request. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.

StatusMessage:The value for one of the HTTP headers is not in the correct format.

ErrorCode:InvalidHeaderValue

but, what's interesting, everything is saved to blob! Why this 400 error then?

thanx Damir!

developers.de is a .Net Community Blog powered by daenet GmbH.