Azure / Azure/Azurite

Invalid behavior when doing full upload after non-committed multipart upload

Open
#531 2 comments 0 reactions 1 assignee Claimed by @Poku8 View on GitHub
alignment blob-storage enhancement NewArch
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

### Which service(blob, file, queue, table) does this issue concern?
Blob

### Which version of the Azurite was used?
3.8.0

### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
We use docker container from `mcr.microsoft.com/azure-storage/azurite@sha256:f1fdee4a45226659c5afa30b8d8d3a479037c701826d32448078f22a7cd011a4`

### What's the Node.js version?
Whatever comes in the container

### What problem was encountered?
There is a discrepancy in how Azurite and Azure Blob store handle full blob upload that happens after multi part upload if multipart upload was not committed and full blob size exceeds 4Mb. Azure Blob throws `Microsoft.Azure.Storage.StorageException: 'The specified blob or block content is invalid.'` while Azurite performs upload with no error. See repro code below.

Note that full blob upload must be over 4Mb. If you set it to 4Mb or smaller then Azure Blob Storage would not throw. And Azurite would not throw either.

### Steps to reproduce the issue?
```
CloudBlobContainer c = blobClient.GetContainerReference(Guid.NewGuid().ToString("N"));
await c.CreateIfNotExistsAsync();
CloudBlockBlob b = c.GetBlockBlobReference(Guid.NewGuid().ToString("N"));
string bid = Convert.ToBase64String(Encoding.UTF8.GetBytes("00000"));
await b.PutBlockAsync(bid, new MemoryStream(new byte[10]), contentMD5: null, accessCondition: default, options: null, operationContext: null);
await b.UploadFromStreamAsync(new MemoryStream(new byte[1024 * 1024 * 8])); <--- Azure Blob Store throws here
```

### Have you found a mitigation/solution?
No

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.