Return a clear 503 response when Smart Search cannot reach any ML server #30954
Replies: 3 comments 1 reply
|
This discussion has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary. |
|
The discussion was created through the API, which unintentionally omitted the required duplicate-search checkbox from the feature-request form. I have now added the checkbox and platform fields. I searched open and closed feature requests and issues before posting. The closest matches I found were #28289, which concerns background queue behavior with an offline ML worker, and #16215, which concerns reporting failed background jobs. Neither covers the synchronous Smart Search API returning a generic HTTP 500 when every configured ML endpoint is unavailable. Please reopen this discussion if it is not considered a duplicate. If there is an existing request that covers this exact API and user-facing error behavior, a link would be appreciated. |
|
Following up after the v3.2.x releases: is this expected to be fixed now, or is it still open? I checked v3.2.2 and |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
Platform
Problem
When all configured machine-learning URLs are unavailable, a text Smart Search request returns a generic internal-server error:
The server log contains the actual cause:
This was reproduced on Immich v3.1.0 with a single remote ML URL configured through the admin UI and the remote worker intentionally offline. The local database and Immich containers were healthy.
The current
MachineLearningRepository.predictimplementation tries all configured URLs and then throws a regularError.ErrorInterceptortreats it as an unknown error and replaces it with the route-level generic 500 message. The web error handler already displays a server-provided message, so a more specific API response should also give the user an actionable toast.Relevant code:
Reproduction
{"message":"Failed to search smart"}even though the failure is a temporary dependency outage.Suggested behavior
Return a dependency-specific response when every configured ML endpoint has failed, for example:
A narrowly scoped implementation could:
MachineLearningRepositoryexhausts all configured URLs;ServiceUnavailableExceptionat the Smart Search HTTP boundary;This request does not propose automatic fallback, queue changes, or exposing endpoint details. It only makes the temporary ML dependency failure distinguishable from an unexpected server bug.
Related issue #28289 discusses background queue behavior with an offline ML worker; this request is limited to the synchronous Smart Search API response and user-facing error.
All reactions