immich icon indicating copy to clipboard operation
immich copied to clipboard

API: POST /search/random returns internal server error

Open JW-CH opened this issue 4 months ago • 0 comments

The bug

https://demo.immich.app/doc#/Search/searchRandom

calling the POST /search/random endpoint with parameters like withExif or personIds returns an internal server error

The OS that Immich Server is running on

Unraid

Version of Immich Server

v1.116

Version of Immich Mobile App

Platform with the issue

  • [X] Server
  • [ ] Web
  • [ ] Mobile

Your docker-compose.yml content

not needed

Your .env content

not needed

Reproduction steps

  1. Go to https://demo.immich.app/doc#/Search/searchRandom (make sure you are logged in)
  2. use request body:
{
  "withExif": true,
  "page": 1,
  "size": 100
}
  1. Execute

Relevant log output

Immich Logs:
ERROR [Api:ErrorInterceptor~2tquej6l] Database error: QueryFailedError: for SELECT DISTINCT, ORDER BY expressions must appear in select list


Server Response:
Error: response status is 500

{
  "message": "Failed to search random",
  "error": "Internal Server Error",
  "statusCode": 500,
  "correlationId": "p93x6n1q"
}

Additional information

curl -X 'POST' \
  'https://demo.immich.app/api/search/random' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "withExif": true,
  "page": 1,
  "size": 100
}'

JW-CH avatar Sep 28 '24 13:09 JW-CH