Troubleshooting Drupal Solr Indexing Issues

Fix common indexing problems

Troubleshooting

Workers Not Starting

Check that the pcntl extension is enabled:

php -m | grep pcntl

If missing, see the Requirements page for installation instructions.

Zombie Processes

The module handles zombie cleanup automatically. If you see zombies, run:

drush osstop

If zombies persist:

# Force kill all worker processes
pkill -9 -f 'opensolr:worker'

# Clean up PID files
rm -f /tmp/opensolr_turbo*.pid

"Class does not exist" Errors

This can happen if workers spawn too quickly. The module uses staggered spawning (200ms between workers) to prevent this. If it persists, try reducing worker count:

drush ost --workers=2 --batch=100

Memory Issues

Reduce batch size if workers run out of memory:

drush ost --batch=50 --workers=4

Also check PHP memory limit for CLI:

php -i | grep memory_limit

Slow Indexing

If indexing is slower than expected:

  1. Check system resources: htop or top
  2. Check database load: mysqladmin processlist
  3. Check Solr response time: Look at request duration in Solr admin
  4. Content complexity: Nodes with many fields/references are slower
💡 Content Type Speed
Taxonomy terms typically index at ~300/s while nodes index at ~100-150/s. This is normal due to the complexity difference.

Background Process Not Starting

Check if one is already running:

cat /tmp/opensolr_turbo_master.pid
ps aux | grep opensolr

If a stale PID file exists, remove it:

rm /tmp/opensolr_turbo_master.pid

Wrong Site URL in Indexed Documents (Fixed in 2.5.1)

If your Solr documents contain http://default/... in URL-dependent fields (e.g. ss_index_source, site, ss_url) instead of your actual site hostname, this was caused by a bug in versions prior to 2.5.1.

Root cause: Forked worker processes spawned via pcntl_exec() were only receiving the --root flag but not --uri from the parent Drush process. Without --uri, Drush defaults to http://default as the base URL, so any field configuration using URL-dependent tokens like [site:url-brief] or [site:url] would resolve incorrectly. Every document indexed by a Turbo Indexer worker would get the wrong provenance metadata.

Who is affected: Any site whose Search API index configuration uses URL-based tokens in indexed fields. Sites that don't use such tokens are unaffected.

Fix: Update to version 2.5.1 or later. The current request URI is now propagated to all spawned worker processes via the --uri flag, ensuring consistent URL resolution between the master process and its workers.

⚠️ After Updating
Reindex all affected indexes after upgrading to 2.5.1 to correct any documents that were indexed with the wrong URL metadata. Make sure you pass --uri when running Drush:
drush --uri=https://your-site.com ost

Index Not Updating

If items are being processed but Solr isn't updating:

  1. Check Solr connection: drush search-api:server-status
  2. Check for errors in Drupal logs: drush watchdog:show
  3. Verify Solr is receiving requests (check Solr admin logs)

Tracker Shows Wrong Counts

Rebuild the tracker to fix sync issues:

drush osrb --index=my_solr_index

Debug Mode

For detailed debugging, run in foreground and watch for errors:

# Run single worker manually
drush opensolr:worker --index=my_solr_index --batch=10

# Check Drupal logs
drush watchdog:show --count=50

Getting Help

If you're still stuck:

  1. Check the log file: /tmp/opensolr_turbo.log
  2. Check Drupal watchdog: drush watchdog:show
  3. Check Solr logs in the Solr admin panel
  4. Enable verbose Drush output: drush ost -v