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

Metadata not uploaded with UploadStreamToBlockBlob #17061

Closed
patrickrad opened this issue Feb 14, 2022 · 4 comments
Closed

Metadata not uploaded with UploadStreamToBlockBlob #17061

patrickrad opened this issue Feb 14, 2022 · 4 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)

Comments

@patrickrad
Copy link

Bug Report

"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
sdk/storage/azblob/v0.3.0
go version go1.16.3 linux/amd64

When using UploadStreamToBlockBlob to upload a blob, any added metadata is not uploaded. If I instead use UploadBufferToBlockBlob it works as expected and the metadata is uploaded as expected.

The following code demonstrates the problem. The stream upload will not result in any metadata being uploaded, but the buffer upload will. I have verified that the metadata is missing both with listing the objects as well as by inspecting the object via the Azure portal.

    data := []byte("hello world this is a blob")
    md := make(map[string]string)
    md["key1"] = "value1"

    // stream upload
    opts1 := azblob.UploadStreamToBlockBlobOptions{Metadata: md}
    blobClient1 := containerClient.NewBlockBlobClient("blob-stream")
    _, err = blobClient1.UploadStreamToBlockBlob(ctx, bytes.NewReader(data), opts1)
    if err != nil {
            log.Fatalf("Failure to stream upload to blob: %+v", err)
    }

    // buffer upload
    opts2 := azblob.HighLevelUploadToBlockBlobOption{Metadata: md}
    blobClient2 := containerClient.NewBlockBlobClient("blob-buffer")
    _, err = blobClient2.UploadBufferToBlockBlob(ctx, data, opts2)
    if err != nil {
            log.Fatalf("Failure to stream upload to blob: %+v", err)
    }
@msftbot msftbot bot added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 14, 2022
@jhendrixMSFT jhendrixMSFT added the Storage Storage Service (Queues, Blobs, Files) label Feb 14, 2022
@msftbot msftbot bot removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Feb 14, 2022
@RickWinter RickWinter added the Client This issue points to a problem in the data-plane of the library. label Feb 14, 2022
@msftbot msftbot bot added the needs-team-attention This issue needs attention from Azure service team or SDK team label Feb 14, 2022
@amishra-dev
Copy link

Thanks for the bug report @patrickrad
As you are aware this is a prerelease SDK, we are continuously working on improving the quality of the SDK, we will pick this up as soon as we can.

@amishra-dev amishra-dev added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 16, 2022
@zezha-msft
Copy link

@mohsha-msft
Copy link
Contributor

Hey @patrickrad ,

Thanks a lot for reaching out!
Yes, this is indeed a bug at our end. I apologize for inconvenience.

I've raised a request to fix it and added more tests to make sure this doesn't happen in future. We'll ship it in next release. In the meantime, you can pull the changes from my branch by using the command

go get github.com/Azure/azure-sdk-for-go/sdk/storage/azblob@mohsha-msft-azblob-fix-upload-stream

Please reach out for any clarification!

@mohsha-msft mohsha-msft self-assigned this Apr 19, 2022
@mohsha-msft
Copy link
Contributor

Hey @patrickrad ,

azblob v0.4.0 is now publically available. I have fixed the issue here and here.

Please reach out and reopen the issue if it still persists.

Thanks a lot for your feedbacks!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants