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

Fails to filter blobs by tags - HTTP 500 with multiple conditions on single tag #2514

Open
aaronenberg-msft opened this issue Dec 12, 2024 · 0 comments

Comments

@aaronenberg-msft
Copy link

aaronenberg-msft commented Dec 12, 2024

I am testing azurite 3.33.0 support for finding blobs by index tags and it is failing with a HTTP 500 with this WHERE clause:

@container='mycontainer' AND MyTag >= 'Foo/296ab642-162c-4db8-a4ae-9517189e411d/' AND MyTag < 'Foo/296ab642-162c-4db8-a4ae-9517189e411d/zzzzzzzzzzzzzzzzzzzzzzz'

The error message is:
Error: can't have multiple conditions for a single tag unless they define a range

My expectation is that this should succeed given this is the same format used with Azure Blob Storage.

Here is the full debug log for the request:

2024-12-12T19:23:26.907Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: BlobStorageContextMiddleware: RequestMethod=GET RequestURL=http://127.0.0.1/devstoreaccount1/?comp=blobs&where=%40container%3D%27mycontainer%27%20AND%20MyTag%20%3E%3D%20%27Foo%2F296ab642-162c-4db8-a4ae-9517189e411d%2F%27%20AND%20MyTag%20%3C%20%27Foo%2F296ab642-162c-4db8-a4ae-9517189e411d%2Fzzzzzzzzzzzzzzzzzzzzzzz%27&maxresults=100 RequestHeaders:{"host":"127.0.0.1:10000","x-ms-version":"2021-12-02","accept":"application/xml","x-ms-client-request-id":"d132709d-3f10-4efe-86f5-012ada151d3c","x-ms-return-client-request-id":"true","user-agent":"azsdk-net-Storage.Blobs/12.15.1 (.NET 8.0.11; Microsoft Windows 10.0.22631)","x-ms-date":"Thu, 12 Dec 2024 19:23:26 GMT","authorization":"SharedKey devstoreaccount1:19ZJUVfGgitMomyBXGP8nQJ6+hyxu+SLqhHuhNoTijs=","traceparent":"00-3ea7bda368499cfd04c59fd7c1f64610-1307d5eb337eea57-01"} ClientIP=172.17.0.1 Protocol=http HTTPVersion=1.1
2024-12-12T19:23:26.908Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: BlobStorageContextMiddleware: Account=devstoreaccount1 Container= Blob=
2024-12-12T19:23:26.908Z e639ab74-1c14-41ac-97ca-86d1587c49f1 verbose: DispatchMiddleware: Dispatching request...
2024-12-12T19:23:26.909Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: DispatchMiddleware: Operation=Service_FilterBlobs
2024-12-12T19:23:26.910Z e639ab74-1c14-41ac-97ca-86d1587c49f1 verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications.
2024-12-12T19:23:26.910Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: PublicAccessAuthenticator:validate() Start validation against public access.
2024-12-12T19:23:26.910Z e639ab74-1c14-41ac-97ca-86d1587c49f1 debug: PublicAccessAuthenticator:validate() Getting account properties...
2024-12-12T19:23:26.910Z e639ab74-1c14-41ac-97ca-86d1587c49f1 debug: PublicAccessAuthenticator:validate() Retrieved account name from context: devstoreaccount1, container: , blob:
2024-12-12T19:23:26.912Z e639ab74-1c14-41ac-97ca-86d1587c49f1 debug: PublicAccessAuthenticator:validate() Skip public access authentication. Cannot get public access type for container
2024-12-12T19:23:26.913Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: BlobSharedKeyAuthenticator:validate() Start validation against account shared key authentication.
2024-12-12T19:23:26.914Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: BlobSharedKeyAuthenticator:validate() [STRING TO SIGN]:"GET\n\n\n\n\n\n\n\n\n\n\n\nx-ms-client-request-id:d132709d-3f10-4efe-86f5-012ada151d3c\nx-ms-date:Thu, 12 Dec 2024 19:23:26 GMT\nx-ms-return-client-request-id:true\nx-ms-version:2021-12-02\n/devstoreaccount1/devstoreaccount1/\ncomp:blobs\nmaxresults:100\nwhere:@container='mycontainer' AND MyTag >= 'Foo/296ab642-162c-4db8-a4ae-9517189e411d/' AND MyTag < 'Foo/296ab642-162c-4db8-a4ae-9517189e411d/zzzzzzzzzzzzzzzzzzzzzzz'"
2024-12-12T19:23:26.915Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: BlobSharedKeyAuthenticator:validate() Calculated authentication header based on key1: SharedKey devstoreaccount1:19ZJUVfGgitMomyBXGP8nQJ6+hyxu+SLqhHuhNoTijs=
2024-12-12T19:23:26.915Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: BlobSharedKeyAuthenticator:validate() Signature 1 matched.
2024-12-12T19:23:26.915Z e639ab74-1c14-41ac-97ca-86d1587c49f1 verbose: DeserializerMiddleware: Start deserializing...
2024-12-12T19:23:26.916Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: HandlerMiddleware: DeserializedParameters={"options":{"where":"@container='mycontainer' AND MyTag >= 'Foo/296ab642-162c-4db8-a4ae-9517189e411d/' AND MyTag < 'Foo/296ab642-162c-4db8-a4ae-9517189e411d/zzzzzzzzzzzzzzzzzzzzzzz'","maxresults":100,"include":[],"requestId":"d132709d-3f10-4efe-86f5-012ada151d3c"},"comp":"blobs","version":"2021-12-02"}
2024-12-12T19:23:26.917Z e639ab74-1c14-41ac-97ca-86d1587c49f1 error: ErrorMiddleware: Received an error, fill error information to HTTP response
2024-12-12T19:23:26.918Z e639ab74-1c14-41ac-97ca-86d1587c49f1 error: ErrorMiddleware: ErrorName=Error ErrorMessage=can't have multiple conditions for a single tag unless they define a range ErrorStack="Error: can't have multiple conditions for a single tag unless they define a range\n    at QueryParser.validateWithPreviousComparison (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:81:27)\n    at QueryParser.visitBinary (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:245:26)\n    at QueryParser.visitExpressionGroup (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:208:25)\n    at QueryParser.visitUnary (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:189:28)\n    at QueryParser.visitAnd (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:170:27)\n    at QueryParser.visitAnd (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:173:32)\n    at QueryParser.visitAnd (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:173:32)\n    at QueryParser.visitOr (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:149:27)\n    at QueryParser.visitExpression (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:139:21)\n    at QueryParser.visitQuery (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:126:27)"
2024-12-12T19:23:26.918Z e639ab74-1c14-41ac-97ca-86d1587c49f1 error: ErrorMiddleware: Set HTTP code: 500
2024-12-12T19:23:26.918Z e639ab74-1c14-41ac-97ca-86d1587c49f1 info: EndMiddleware: End response. TotalTimeInMS=11 StatusCode=500 StatusMessage=undefined Headers={"server":"Azurite-Blob/3.33.0"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant