azure-sdk-for-go icon indicating copy to clipboard operation
azure-sdk-for-go copied to clipboard

In FindBlobsByTags API it encode space character to + which result in error from Azure

Open ketanpp opened this issue 2 years ago • 5 comments

Bug Report

  • import path of package azblob/url_service.go
  • SDK version e.g. master, latest, 18.1.0

Description:

We are using FindBlobsByTags API in our application and we have an blob in Azure which have following tags TagKey Tag1 TagValue Val 1

After executing API we are getting following error FindBlobsByTag github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /extsrc/go_sdk/azure/0.14e/src/github.com/Azure/azure-storage-blob-go/azblob/zc_storage_error.go:42\n===== RESPONSE ERROR (ServiceCode=AuthenticationFailed) =====\nDescription=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. The MAC signature found in the HTTP request is not the same as any computed signature. Server used following string to sign: 'GET\n\n\n\n\n\n\n\n\n\n\n\nx-ms-client-request-id:bcd44ba7-54e3-443e-4aa3-58c33b55bf65\nx-ms-date:Sat, 05 Mar 2022 13:49:37 GMT\nx-ms-version:2020-10-02\n/{storage_account_name}/\ncomp:blobs\nwhere:@container={container_name}AND"Tag"='Val+1''.\n

ketanpp avatar Apr 01 '22 05:04 ketanpp

Thank you for your feedback. This has been routed to the support team for assistance.

msftbot[bot] avatar Apr 04 '22 16:04 msftbot[bot]

@ketanpp We are looking into it and get back to you for any additional information.

SaurabhSharma-MSFT avatar Apr 05 '22 17:04 SaurabhSharma-MSFT

Just FYI. I have gone through code and one thing i found in filterBlobsCreateRequest it is Encoding param for Url using Encode method as follows req.Raw().URL.RawQuery = reqQP.Encode() as Encode() converts space to + which making problem at Azure I have tried to query blobs by tags using azure cli which invoke azure REST API and encode query parameter space to %20 So we can use url.PathEscape instead of Encode() method

ketanpp avatar Apr 14 '22 07:04 ketanpp

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details

Bug Report

  • import path of package azblob/url_service.go
  • SDK version e.g. master, latest, 18.1.0

Description:

We are using FindBlobsByTags API in our application and we have an blob in Azure which have following tags TagKey Tag1 TagValue Val 1

After executing API we are getting following error FindBlobsByTag github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /extsrc/go_sdk/azure/0.14e/src/github.com/Azure/azure-storage-blob-go/azblob/zc_storage_error.go:42\n===== RESPONSE ERROR (ServiceCode=AuthenticationFailed) =====\nDescription=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. The MAC signature found in the HTTP request is not the same as any computed signature. Server used following string to sign: 'GET\n\n\n\n\n\n\n\n\n\n\n\nx-ms-client-request-id:bcd44ba7-54e3-443e-4aa3-58c33b55bf65\nx-ms-date:Sat, 05 Mar 2022 13:49:37 GMT\nx-ms-version:2020-10-02\n/{storage_account_name}/\ncomp:blobs\nwhere:@container={container_name}AND"Tag"='Val+1''.\n

Author: ketanpp
Assignees: -
Labels:

question, Storage, Service Attention, customer-reported, needs-team-attention

Milestone: -

msftbot[bot] avatar May 23 '22 17:05 msftbot[bot]

Hi, I think I'm getting this one too (our tag values also contain space)

dave-f avatar Oct 01 '22 14:10 dave-f

Hi @ketanpp, could you post the expression parameter you are passing into FindBlobsByTag?

seanmcc-msft avatar Dec 06 '22 16:12 seanmcc-msft