question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content-MD5 should always be returned when listing blobs

See original GitHub issue

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

blob

Which version of the Azurite was used?

3.14.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

npm

What’s the Node.js version?

16.13.1

What problem was encountered?

When listing blobs, it occasionally return blobs without a Content-MD5 property in the XML response if the MD5 is empty. Maybe having an empty MD5 value is not the exact cause but that’s my observation so far.

Steps to reproduce the issue?

Upload an append blob to azurite instance with an empty MD5 value. Try to list the blob container which should return that blob.

In the response, the Content-MD5 property is missing.

Actual response:

<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="" ContainerName="">
    <MaxResults>1000</MaxResults>
    <Delimiter>/</Delimiter>
    <Blobs>
        <Blob>
            <Name>blob</Name>
            <Properties>
                <Creation-Time>Thu, 11 Mar 2021 23:09:53 GMT</Creation-Time>
                <Last-Modified>Sat, 07 Aug 2021 00:19:39 GMT</Last…>
                <Content-CRC64 />
                <Cache-Control />
                <Content-Disposition />
                <BlobType>BlockBlob</BlobType>
                <AccessTier>Hot</AccessTier>
                <AccessTierInferred>true</AccessTierInferred>
                <LeaseStatus>unlocked</LeaseStatus>
                <LeaseState>available</LeaseState>
                <ServerEncrypted>true</ServerEncrypted>
            </Properties>
            <Metadata />
            <OrMetadata />
        </Blob>
    </Blobs>
    <NextMarker />
</EnumerationResults>

Expected response:

<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="" ContainerName="">
    <MaxResults>1000</MaxResults>
    <Delimiter>/</Delimiter>
    <Blobs>
        <Blob>
            <Name>blob</Name>
            <Properties>
                <Creation-Time>Thu, 11 Mar 2021 23:09:53 GMT</Creation-Time>
                <Last-Modified>Sat, 07 Aug 2021 00:19:39 GMT</Last…>
                <Content-CRC64 />
                <Content-MD5/>   ------------------> This is missing
                <Cache-Control />
                <Content-Disposition />
                <BlobType>BlockBlob</BlobType>
                <AccessTier>Hot</AccessTier>
                <AccessTierInferred>true</AccessTierInferred>
                <LeaseStatus>unlocked</LeaseStatus>
                <LeaseState>available</LeaseState>
                <ServerEncrypted>true</ServerEncrypted>
            </Properties>
            <Metadata />
            <OrMetadata />
        </Blob>
    </Blobs>
    <NextMarker />
</EnumerationResults>

The public Azure blob service always returns the empty Content-MD5 in its list blob responses.

Have you found a mitigation/solution?

People can manually parse the response and handle that. However, the @azure/storage-blob sdk currently cannot handle this situation because it uses NodeJS standard library to process that property value which will throw if the value is undefined. Due to that, such blob can cause the SDK to not be able to list any blobs if the response contains those problematic blobs.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bluewwcommented, Jul 12, 2022

could you help double check if the API spec needs an update?

[Wei] in the blob rest API doc, it says

The Content-MD5 element appears in the response body only if it has been set on the blob using version 2009-09-19 or later.

So I believe this is expected contentMD5 is not required.

0reactions
bluewwcommented, Sep 30, 2022

Close this issue as JS SDK is already fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure blob content-md5 property is null while reading it using ...
We are trying to get content-md5 property from azure blob, it is always returning null even we see the content-md5 value in azure...
Read more >
Put Blob (REST API) - Azure Storage - Microsoft Learn
The x-ms-content-crc64 value returned is computed by the Blob service. This header will always be returned starting from version 2019-02-02.
Read more >
Operations on a blob container or blob - R-Project.org
Upload, download, or delete a blob; list blobs in a container; ... For list_blobs , level of detail about each blob to return:...
Read more >
How CrowdStrike Detects Cloud Storage Misconfigurations
Azure Blob Storage is one example of such storage services which can, ... This request with the comp=list query parameter returns XML data ......
Read more >
blob package - github.com/sraphs/gdk/blob - Go Packages
SingleKeyBucket returns a *Bucket based on b that always references singleKey. List methods will not work. singleKey acts as srcKey for Copy.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found