Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.8k stars 320 forks source link

Azurite returns an error when `filter` is empty while querying table entities #1573

Open craxal opened 2 years ago

craxal commented 2 years ago

Which service(blob, file, queue, table) does this issue concern?

Table

Which version of the Azurite was used?

3.18.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

npm

What's the Node.js version?

16.14.2

What problem was encountered?

When an empty filter parameter is used to query entities, the following error is returned:

{"odata.error":{"code":"InvalidInput","message":{"lang":"en-US","value":"The query condition specified in the request is invalid.\nRequestId:9c789a8e-5989-41c7-8180-b853dee771ec\nTime:2022-06-27T22:01:15.449Z"}}}

Azurite outputs this as well:

127.0.0.1 - - [27/Jun/2022:22:01:15 +0000] "GET /devstoreaccount1/test03()?$select=&$filter= HTTP/1.1" 400 -

Public Azure does not return an error when the filter is empty.

Steps to reproduce the issue?

  1. Install and launch Azurite from the command line.
  2. Install and launch Storage Explorer.
  3. In Storage Explorer, create an emulator table and open it.
  4. Open the Query Builder and remove the default clauses.
  5. Run the query.

Have you found a mitigation/solution?

No

edwin-huber commented 2 years ago

Hi @craxal thanks for raising this. It looks like an edge case, can you confirm? It will help us prioritize. Thanks!

craxal commented 2 years ago

I would consider this an edge case, yes. Technically, it shouldn't be possible to have a no-clause query in Storage Explorer; we auto-generate a clause if that happens. That code wasn't working, which is how we found this bug.