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

404 Not found when Downloading Blob w SAS client #19324

Closed
somtochiama opened this issue Oct 10, 2022 · 4 comments
Closed

404 Not found when Downloading Blob w SAS client #19324

somtochiama opened this issue Oct 10, 2022 · 4 comments
Assignees
Labels
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 Workflow: This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)

Comments

@somtochiama
Copy link

Bug Report

  • import path of package in question: "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
  • SDK version : v0.5.0
    • Specify the exact commit if possible; one way to get this is the REVISION
      column output by dep status "github.com/Azure/azure-sdk-for-go.
  • output of go version
    go version go1.19.1 darwin/amd64
  • What happened?
    Downloading Blobs with a client created with a SAS query URL fails with a 404 (BlobNotFound) error
  • What did you expect or want to happen?
    For it to succeeded. This isn't an authentication issue as the sas query has all permissions and attempting to download with one that doesn't returns an AuthenticationFailed error
  • How can we reproduce it?
// create client with sas query: full path => <account>.blob.core.windows.net/<sasKey>
c, err = azblob.NewClientWithNoCredential(fullPath, &azblob.ClientOptions{})

// Listing the blobs work as expacted
items := c.NewListBlobsFlatPager(bucketName, nil)
for items.More() {
resp, err := items.NextPage(ctx)
if err != nil {
	err = fmt.Errorf("listing objects from bucket '%s' failed: %w", bucketName, err)
	return err
}
for _, blob := range resp.Segment.BlobItems {
	fmt.Println(*blob.Name)
}

// attempt to download w any of the Download functions returns 404 error
_, err = c.DownloadFile(ctx, bucketName, objectName, f, nil)
fmt.Println(err) // 404 Blob Not Found
if err != nil {
return "", err
}

Taking a look at the response error, there's a slash before the sas query which seems to be the cause of the problem. Path from (responeError.RawReqquest.Path )=> https://testfluxsaas.blob.core.windows.net/flux/notification.yml/?se=2022-10-11T04.. (extra slash after notification yaml).

Testing on Postman
GET https://testfluxsaas.blob.core.windows.net/flux/notification.yml?se=2022-10-11T04 (successful)
GET https://testfluxsaas.blob.core.windows.net/flux/notification.yml/?se=2022-10-11T04 (extra slash, BlobNotFound)

  • Anything we should know about your environment.
@ghost ghost added needs-triage Workflow: 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 Oct 10, 2022
@ghost
Copy link

ghost commented Oct 10, 2022

Hi @somtochiama. Thank you for your feedback and we will look into it soon. Meanwhile, feel free to share your experience using the Azure SDK in this survey.

@somtochiama
Copy link
Author

Digging further, the problem comes from the azcore/runtime function for JoinPath

if qps != "" {
if !strings.HasSuffix(root, "/") {
	root += "/"
}
return root + "?" + qps
}

It seems this is fixed in main?? Perhaps a new release then.

@jhendrixMSFT
Copy link
Member

You should be able to update your dependency on azcore to v1.1.4 to resolve this. We'll also be releasing an updated [email protected] tomorrow (10/11/2022) that defaults to this version.

@jhendrixMSFT jhendrixMSFT added Storage Storage Service (Queues, Blobs, Files) and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Oct 10, 2022
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Oct 10, 2022
@jhendrixMSFT jhendrixMSFT added Client This issue points to a problem in the data-plane of the library. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Oct 10, 2022
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Oct 10, 2022
@jhendrixMSFT jhendrixMSFT self-assigned this Oct 10, 2022
@jhendrixMSFT
Copy link
Member

[email protected] is now available.

@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
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 Workflow: This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

2 participants