(400) Bad Request - The specified block list is invalid. ErrorCode:InvalidBlockList
See original GitHub issueWhich service(blob, file, queue, table) does this issue concern?
Blob
Which version of the SDK was used?
WindowsAzure.Storage 6.2.0
Which platform are you using? (ex: .NET Core 2.1)
.Net Framework 4.5.1
What problem was encountered?
Getting this 400 Bad Request with message in transient fashion randomly.
The specified block list is invalid.
ErrorCode: InvalidBlockList
API being used:
public virtual void UploadFromByteArray(byte[] buffer, int index, int count, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null);
How can we reproduce the problem in the simplest way?
Execute this scenario and run multiple times with different threads uploading together 100MB or so type of data.
Have you found a mitigation/solution?
Not Yet
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:37 (11 by maintainers)
Top Results From Across the Web
Troubleshooting InvalidBlock 'The specified block list is ...
This can occur if the application / client specify a block size that is not supported. Reference link for the Put Block REST...
Read more >"The specified block list is invalid" while uploading blobs in ...
The specified block list is invalid. System. Net. WebException: The remote server returned an error: (400) Bad Request.
Read more >The specified block list is invalid. ErrorCode:InvalidBlockList
Javascript Required. · (400) Bad Request - The specified block list is invalid. · Which service(blob, file, queue, table) does this issue concern?...
Read more >Dealing With “The specified blob or block content is invalid ...
If you're uploading blobs by splitting blobs into blocks and you get the error – The specified blob or block content is invalid,...
Read more >Untitled
The specified block list is invalid Put Block List (REST API) - Azure Storage Microsoft Learn ... the request will fail with status...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are also facing the same issue and have done a little bit of an investigation in the application insights. Here is what we have found.
Trivia
The
Put Block
operation creates a new block to be committed as part of a blob.The
Put Block List
operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation.Successful upload
Consists of 1-n
Put Block
operations and finalPut Block List
operation.Failed upload
In the failed upload the final
Put Block List
fails with messageThe specified block list is invalid.
Possible cause
It seems that storage SDK is executing the
Put Block List
in parallel with thePut Block
and does not wait for thePut Block
to finish.Successful upload timeline Upload #1 - 1 block 2020-12-07T12:53:09.8442922Z + 0.01 2020-12-07T12:53:09.854617Z
Upload #2 - many blocks 2020-12-07T13:17:51.3556283Z + 0.371 2020-12-07T13:17:51.7276951Z
Failed upload timeline Upload #3 - 2 blocks 2020-11-27T13:27:44.3833279Z + 0.03 2020-11-27T13:27:44.3835717Z
Upload #4 - 2 blocks 2020-11-27T13:38:11.1370163Z + 0.105 2020-11-27T13:38:11.1372083Z
We are also using
OpenWriteAsync()
as was @angelcalvasp in their example, so my guess is the problem lies in theBlobWriteStream
.CommitAsync
is callingPutBlockListAsync
(the final operation) and before that it runsFlushAsync
. It appears theFlushAsync
should block until all pending block writes are finished, but I guess it doesn’t work properly.Edited: SDK Version: 11.2.2 Platform: .Net Framework 4.7.2
The fix is available on Nuget. Version
11.2.3
.