Is there a way to stop a magento indexer process?

First, try to set the index mode to manual:

php indexer.php --mode-manual catalog_product_attribute
php indexer.php --mode-manual catalog_product_price
php indexer.php --mode-manual catalog_url
php indexer.php --mode-manual catalog_product_flat
php indexer.php --mode-manual catalog_category_flat
php indexer.php --mode-manual catalog_category_product
php indexer.php --mode-manual catalogsearch_fulltext
php indexer.php --mode-manual cataloginventory_stock
php indexer.php --mode-manual tag_summary

Then, try to reindex all indexes:

php indexer.php reindexall

And set the mode to realtime again:

php indexer.php --mode-realtime catalog_product_attribute
php indexer.php --mode-realtime catalog_product_price
php indexer.php --mode-realtime catalog_url
php indexer.php --mode-realtime catalog_product_flat
php indexer.php --mode-realtime catalog_category_flat
php indexer.php --mode-realtime catalog_category_product
php indexer.php --mode-realtime catalogsearch_fulltext
php indexer.php --mode-realtime cataloginventory_stock
php indexer.php --mode-realtime tag_summary

If this does not work, try to restart apache with something like sudo /etc/init.d/apache2 restart. This should stop the indexing process and you can probably start it again afterwards. But mind that your site will not be available for a few seconds if you restart Apache.


Indexing mostly (mostly meaning I'm pretty sure it's always) happens during a single HTTP request. If that request stop/timeouts/fails because of a PHP error, the indexer leaves lock files lying around even though there's no indexing going on. These files are located in

/path/to/mage/var/locks/index_process*.lock

The

Index process is working now. Please try run this process later

exception is Magento telling you it sees one of these lock files. If you know for sure no one else is trying to run an index, just delete the files and restart your indexing.


In the latest versions the lock files has been changed and working from database(Magento 1.9).

Login to your phpMyAdmin, and run the below command.

UPDATE index_process SET status = 'pending' WHERE status = 'working'

Tags:

Magento