Skip to content

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

Closed
@ryepup

Description

@ryepup

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

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)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 teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions