Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response have metadata always when using List Containers API #2382

Closed
SugaMi opened this issue Mar 28, 2024 · 4 comments
Closed

Response have metadata always when using List Containers API #2382

SugaMi opened this issue Mar 28, 2024 · 4 comments
Assignees
Labels
alignment Alignment between Azurite with Azure Storage production blob-storage bug Something isn't working

Comments

@SugaMi
Copy link

SugaMi commented Mar 28, 2024

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

blob service

Which version of the Azurite was used?

Azurite v3.29.0

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

VScode extension

What's the Node.js version?

What problem was encountered?

When we call List Containers API, response body has metadata even if request dosen't have include=metadata.

https://learn.microsoft.com/en-us/rest/api/storageservices/list-containers2?tabs=microsoft-entra-id

Steps to reproduce the issue?

Issue request and response

Request doesn't have include=metadata but response body has metadata

http://127.0.0.1:10000/devstoreaccount1/?comp=list&include=&sv=2023-01-03&ss=b&srt=sco&st=2024-03-27T14%3A25%3A53Z&se=2024-03-28T14%3A25%3A53Z&sp=rl&sig=xxxxxx

<EnumerationResults ServiceEndpoint="http://127.0.0.1:10000/devstoreaccount1">
<Prefix/>
<MaxResults>5000</MaxResults>
<Containers>
<Container>
<Name>tetete</Name>
<Properties>
<Last-Modified>Wed, 27 Mar 2024 12:52:35 GMT</Last-Modified>
<Etag>"0x1BDDB154194EDE0"</Etag>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<HasImmutabilityPolicy>false</HasImmutabilityPolicy>
<HasLegalHold>false</HasLegalHold>
</Properties>
<Metadata>
<Metadata11111>valueeee</Metadata11111>
</Metadata>
</Container>
</Containers>
<NextMarker/>
</EnumerationResults>

correct request and response (using product

Request doesn't have include=metadata and response body doesn't have metadata.

https://xxxxxx.blob.core.windows.net/?comp=list&include=&sv=2022-11-02&ss=b&srt=sco&sp=rwdlaciytfx&se=2024-03-28T08:51:56Z&st=2024-03-28T00:51:56Z&spr=https&sig=xxxxxx

<Container>
<Name>test</Name>
<Properties>
<Last-Modified>Thu, 28 Mar 2024 00:51:19 GMT</Last-Modified>
<Etag>"0x8DC4EC12E8DA4B5"</Etag>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<DefaultEncryptionScope>$account-encryption-key</DefaultEncryptionScope>
<DenyEncryptionScopeOverride>false</DenyEncryptionScopeOverride>
<HasImmutabilityPolicy>false</HasImmutabilityPolicy>
<HasLegalHold>false</HasLegalHold>
<ImmutableStorageWithVersioningEnabled>false</ImmutableStorageWithVersioningEnabled>
</Properties>
</Container>

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

@blueww blueww self-assigned this Mar 28, 2024
@blueww blueww added bug Something isn't working blob-storage alignment Alignment between Azurite with Azure Storage production labels Mar 28, 2024
@blueww
Copy link
Member

blueww commented Mar 28, 2024

@SugaMi

Thanks for raising this issue!

It looks caused by :in list container API , we don't cleanup container metadata even Request doesn't have include=metadata, before return it in the request responds:

containerItems: containers[0],

Would you please share you scenario impacted by this issue? Then we can evaluate the priority for this issue accordingly.

Azurite welcome contribution!
It would be great if you can raise a PR to fix it!

@SugaMi
Copy link
Author

SugaMi commented Mar 29, 2024

@blueww

Thank you for your cheking.

We cannot share detailed senario but our system use this metadata.

@blueww
Copy link
Member

blueww commented Apr 12, 2024

A fix PR is already raised in #2389

blueww added a commit to blueww/Azurite that referenced this issue Apr 12, 2024
blueww added a commit that referenced this issue Apr 16, 2024
…have include=metadata (issue #2382) (#2389)

* Fixed issue of list container contains metadata even request doesn't have include=metadata (issue #2382)

* Fix a test issue
@blueww
Copy link
Member

blueww commented Apr 16, 2024

The fix is merged, and normally will be include in the next Azurite release.

@blueww blueww closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alignment Alignment between Azurite with Azure Storage production blob-storage bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants