Unhandled exception breaks the entire site

Created on 30 October 2024, about 2 months ago

Problem/Motivation

Under certain circumstances, when a server config is broken (a regression, wrong config or anything else) - the Index entity throws SearchApiException while trying to retrieve server info an index is attached to. The exception is not handled anywhere and brings the entire site down.

The following message is then displayed:

The website encountered an unexpected error. Try again later.

Drupal\search_api\SearchApiException: The server with ID 'server name' could not be retrieved for index 'index_label'. in Drupal\search_api\Entity\Index->getServerInstance() (line 505 of modules/contrib/search_api/src/Entity/Index.php).

Steps to reproduce

Not sure, as this happened randomly and was quickly fixed with disabling and re-enabling the server in question.

Proposed resolution

Handle the exception and report an error in the watchdog.

πŸ› Bug report
Status

Active

Version

1.35

Component

General code

Created by

πŸ‡ΊπŸ‡ΈUnited States euk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024