Skip to content

blob.Client.DownloadStream does not return error on unmet access conditions #24566

Open
@justinrush

Description

@justinrush

Bug Report

  • import path of package in question, e.g. .../services/compute/mgmt/2018-06-01/compute
	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
  • SDK version e.g. master, latest, 18.1.0
    • Specify the exact commit if possible; one way to get this is the REVISION
      column output by go list -m <module>, for example go list -m github.com/Azure/azure-sdk-for-go/sdk/azcore.
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0
  • output of go version
go version go1.24.0 darwin/arm64

I'm specifying an access condition with an etag on a call to DownloadStream:

	bc := client.NewBlobClient("my-blob")

	etag := azcore.ETag(`"0x8DD8C0399EDF92B"`)

	resp, err := bc.DownloadStream(context.Background(), &blob.DownloadStreamOptions{
		AccessConditions: &blob.AccessConditions{
			ModifiedAccessConditions: &blob.ModifiedAccessConditions{
				IfNoneMatch: &etag,
			},
		},
	})
	if err != nil {
		fmt.Println("Error downloading stream:", err)
		return
	}

This does not print an error even when the tag matches. The resulting blob.DownloadStreamResponse is a very thinly populated object that basically only has the ErrorCode property set "ConditionNotMet". I expected this to return a *azcore.ResponseError like other parts of the SDK do. We use a generic adapter to translate errors from the SDK into internal errors our code understands. I can check the DownloadStreamResponse.ErrorCode, but it feels like this should return an error.

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.StorageStorage Service (Queues, Blobs, Files)bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions