Search API sync breaks site

Created on 21 September 2023, 12 months ago

Problem/Motivation

Related to 3218868, but this happens directly after a config sync, not during general site usage. I can create the issue in Seach API if needed, but I am not sure if the issue is a problem with Search API.

When performing a sync between sites, if the Search API configuration is synced it will case a WSOD with an error after cache clear:
In Index.php line 505: The server with ID '[servername]' could not be retrieved for index 'ContentIndex'.

It appears that the Content Index is being synced, but the server it is associated with is not. I am using Solr for search.
In the attached image, the line in red is not present after sync.

If the Search API configs are ignored using Config Ignore this does not occur. The only way I have found to fix it is to either:
1 - roll back the database
2 - if able to log into site (before a cache rebuild), going to Search API configuration (/admin/config/search/search-api) and adding the missing server.
3 - delete all index configs associated to the server (drush config:delete search_api.index._____) and recreate them manually.

It is inconvenient to ignore Search API from the sync, since this is information I would partially like to sync at the very least.

Steps to reproduce

Have two identical sites using Search API and with a server/content index configured
Make some change in site A, config export.
Config import to site B
After sync, clear the cache
Site B will white-screen (An unexpected error has occurred).

Investigating database, the server config is missing but the index is present (and referencing the server), leading to the indicated issue.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SteelStrung

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

Comments & Activities

Production build 0.71.5 2024