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

API search query returns "error 500", when searching for number with more than 10 digits #18466

Closed
pyderman opened this issue May 3, 2023 · 2 comments

Comments

@pyderman
Copy link

pyderman commented May 3, 2023

Describe the Bug

I am querying a Directus collection for a 13 digit barcodes (set up as a string) from Postman and Flutterflow (same result) -> Error 500

This happens in 2 different independent collections. In another I query for another 13 digit number set up as string

Query without search parameter: Fine
Query_no_search

Query with 10 characters: Fine
Query_search_10digits

Query with 11 characters that match a result (correct digit added in the front): Error 500
Query_search_11digits

Query with 11 characters that do not match any result (not matching digit added in the end): Empty list
query_search_no_match

To Reproduce

Try a search query for a field with a number with more than 10 digits.

Directus Version

v9.25.2

Hosting Strategy

Directus Cloud

@shipsides-sparknel
Copy link

@pyderman do you also have one or more integer fields in the same collection?

i encounter the same issue but my long number is stored as bigint instead of string. dissecting the error message i get, it is something to do with how the search api translates itself into an SQL query. if you search for 2147483647 (max int value for postgres and 10 digits) it works, but as soon as you flick it to 2147483648 the query breaks despite still being 10 digits

this is an edited version of the error message i get

{ "errors": [ { "message": "select "collection"."bigintfield", "collection"."string", "collection"."integer", ...... etc ..... value \"75657862765\" is out of range for type integer", "extensions": { "code": "INTERNAL_SERVER_ERROR" } } ] }

@paescuj
Copy link
Member

paescuj commented May 4, 2023

Thanks for opening this issue! However this is a duplicate of an existing issue #17946, so I'll proceed to close this but if you think this is actually a different issue, then please do not hesitate to comment. Otherwise you may subscribe to #17946 for future updates.

@paescuj paescuj closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants