Indexing on disabled servers during cron

Created on 21 March 2025, about 2 months ago

Problem/Motivation

I am wondering whether it is intentional, that indexes on disabled servers are handled in cron.

Steps to reproduce

an index on a disabled server is still tried to be indexed in cron.

Proposed resolution

One could probably do something like this to exclude indexes on disabled servers (starting line 69 in search_api.module):

$indexes = $index_storage->loadByProperties($conditions);
foreach ($indexes as $index_id => $index) {
  if ($index->hasValidServer() && !$index->isServerEnabled()) {
    unset($indexes($index_id));
  }
}

Remaining tasks

πŸ’¬ Support request
Status

Active

Version

1.0

Component

General code

Created by

πŸ‡©πŸ‡ͺGermany stefan.korn Jossgrund

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

Comments & Activities

  • Issue created by @stefan.korn
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    Indexes on disabled servers should always be disabled themselves, so should not be returned by the loadByProperties() call. (See \Drupal\search_api\Entity\Server::preSave().)
    Something seems to have gone wrong when disabling the server, or maybe you imported faulty config. Anyways, just disabling the affected indexed manually should resolve this problem for you. And if you do find out why the indexes weren’t correctly disabled, please file a separate bug report for that problem.

  • πŸ‡©πŸ‡ͺGermany stefan.korn Jossgrund

    Oh yes, it is resulting from faulty config. We only disabled the server via config (as config override), but not the indexes.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024