Troubleshooting Parallel Drupal Solr Indexing

The message you see, and what to do

Troubleshooting

Find the message you see, or what happens, and do what its box says.

Messages

pcntl extension required

The command-line PHP has no pcntl. Install or enable it for the PHP version Drush uses, then check that both names appear:

php -m | grep -E '^(pcntl|posix)$'

See Requirements.

Failed to start background process

The background process stopped right after it started. Read the session's log for the reason, or run once in the terminal to see it on screen: drush ost --no-background. The usual cause: the vendor folder is not next to the Drupal web root, so the indexer cannot find vendor/bin/drush.php or vendor/bin/drush to start its processes.

Turbo indexer already running for '...'

That session is still running. Follow it with drush oss, or stop it with drush osstop. A file left by a process that no longer exists is cleared on its own.

ERROR: No Solr server found

Also ERROR: No enabled indexes found. These lines appear in the log, or on screen in the terminal mode. Check the machine names you passed:

drush search-api:server-list
drush search-api:list

The server must be enabled and run on Search API Solr; the index must be enabled and belong to that server.

Allowed memory size ... exhausted

A worker ran out of memory with its batch. Use a smaller --batch, or give the command-line PHP more memory.

drush ost --server=my_solr_server --batch=100

Symptoms

Rounds repeat, but the remaining count does not go down

Some items never get marked as indexed, and the indexer takes them again in every round. It does not stop on its own here.

  1. Look for worker errors:
    grep 'OpenSolr Worker' /tmp/opensolr_turbo_my_solr_server.log
    An error such as Solr not answering: fix the cause, and the next rounds index the items.
  2. No errors: the tracker lists content that no longer loads. Run drush osstop, then drush osrb, then drush ost.
http://default in indexed fields

The workers did not know your site's address. Set it as shown in Background mode, under Your site's address, then rebuild the documents: drush osri and drush ost.

Wrong counts in drush oss

Rebuild the tracker: drush osrb.

Slower than you expected
Processes left after a crash

drush osstop ends every worker on the machine and cleans the session files. If a main process is still there after that:

pkill -f 'opensolr:turbo-daemon'
drush osstop

Reference