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

[azblob] container Client.FilterBlobs returns error is the query contains a space character #23546

Open
ryepup opened this issue Oct 4, 2024 · 2 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 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@ryepup
Copy link

ryepup commented Oct 4, 2024

Bug Report

  • import path of package in question: github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container

  • SDK version: 1.4.1

  • go version: 1.21.2

  • What happened?

Tried to use container/Client.FilterBlobs with the following query: "deploymentID"='id' AND "sha256hash"='hash'

This returned a 400:

  • RESPONSE 400: 400 Error parsing query at or near character position 20: unexpected '1'
  • ERROR CODE: InvalidQueryParameterValue
<?xml version="1.0" encoding="utf-8"?>
<Error>
    <Code>InvalidQueryParameterValue</Code>
    <Message>Error parsing query at or near character position 20: unexpected &apos;1&apos;
        RequestId:4f294f5a-001e-0005-4e90-16410a000000
        Time:2024-10-04T19:08:44.6743253Z</Message>
    <QueryParameterName>where</QueryParameterName>
    <QueryParameterValue>
        &quot;sha256hash&quot;=&apos;hash&apos;+AND+&quot;deploymentID&quot;=&apos;id&apos;</QueryParameterValue>
    <Reason>This query parameter value is invalid.</Reason>
</Error>
  • What did you expect or want to happen?

To get back a list of blobs with matching tags.

  • How can we reproduce it?

Call FilterBlobs with a query containing spaces anywhere: "test"='I have a space' will also do it

cred, err := azidentity.NewDefaultAzureCredential(nil)
client, err := container.NewClient("MY STORAGE URL", cred, nil)
resp, err := client.FilterBlobs(ctx, `"sha256hash"='hash' AND "deploymentID"='id'`, nil)

Looks like the same issue as #17421, which was fixed for another client in #19742

  • Anything we should know about your environment.

No

@github-actions github-actions bot added 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 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

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

@ryepup
Copy link
Author

ryepup commented Oct 8, 2024

We did find a workaround using the fixed service.Client.FilterBlobs from #19742 and adding a @container clause to our filter query:

cred, err := azidentity.NewDefaultAzureCredential(nil)
client, err := azblob.NewClient("MY STORAGE URL", cred, nil)
resp, err := client.ServiceClient().FilterBlobs(ctx, `@container='MY CONTAINER NAME' AND "sha256hash"='hash' AND "deploymentID"='id'`, nil)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

2 participants