Implement error handling when the backend search is not available
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3546175. --> Reported by: [codebymikey](https://www.drupal.org/user/3573206) Related to !872 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Search API provides API to handle situations where the backend may be offline or misconfigured.</p> <p>However those have not been implemented, and can cause module installations to fail.</p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>Attempt to install distribution which includes an ai search_api backend, but the backend is not currently available.</p> <p>It should gracefully fail without leaving the installation in an unstable state.</p> <p>For my specific use case, it was because the <code>ai_vdb_provider_postgres</code> credentials/connection might not yet be available to connect to.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Implement the <code>\Drupal\search_api\Backend\BackendSpecificInterface::isAvailable()</code> interface, as well as other error handling such as <code>\Drupal\ai_search\EventSubscriber\NewServerEventSubscriber::onConfigSave()</code> to ensure that if the backend is unable to create the collection, it still gracefully errors out.</p> <p>It'll also include a summary of any errors on the status page:<br> <img src="https://www.drupal.org/files/issues/2025-09-11/ai-3546175-status-with-error-handle.png" alt="updated ai search server status"></p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p><del>Add error handling.</del></p> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue