Magento 2 Reindex Error: Index is locked by another reindex process. Skipping

From Brian Nelson Ramblings
Jump to: navigation, search

Magento 2 Reindex Error: Index is locked by another reindex process. Skipping

Help! I am getting a magento 2 reindex error, that its locked and being used by another process

Problem

During full reindex in CLI (Command Line Interface, SSH), magento returns error message like “index is locked by another reindex process. Skipping.”

Reason

Error is possible if previous reindex process wasn’t completed successfully. There are few possible reasons of this issue:

  • Fatal PHP error during reindex
  • Mysql Error (like timeout)
  • Memory limit
  • Process was unexpectedly interrupted (by user or another process)

Solution

You need reset index status and then try run new reindex process. For reset index status, you need run command:

php bin/magento indexer:reset <index identifier>

If you don’t know index identifier (code), you can use command:

php bin/magento indexer:info

All possible combinations for native indexes:

bin/magento indexer:reset design_config_grid;  
bin/magento indexer:reset customer_grid;
bin/magento indexer:reset catalog_category_product;
bin/magento indexer:reset catalog_product_category;
bin/magento indexer:reset catalogrule_rule;
bin/magento indexer:reset catalog_product_attribute;
bin/magento indexer:reset cataloginventory_stock;
bin/magento indexer:reset catalog_product_price;
bin/magento indexer:reset catalogrule_product;
bin/magento indexer:reset catalogsearch_fulltext;

Possible error messages

Below are some of the errors you might be seeing:

  • Design Config Grid index is locked by another reindex process. Skipping.
  • Customer Grid index is locked by another reindex process. Skipping.
  • Product Flat Data index is locked by another reindex process. Skipping.
  • Category Flat Data index is locked by another reindex process. Skipping.
  • Category Products index is locked by another reindex process. Skipping.
  • Product Categories index is locked by another reindex process. Skipping.
  • Product Price index is locked by another reindex process. Skipping.
  • Product EAV index is locked by another reindex process. Skipping.
  • Catalog Rule Product index is locked by another reindex process. Skipping.
  • Catalog Product Rule index is locked by another reindex process. Skipping.
  • Stock index is locked by another reindex process. Skipping.
  • Catalog Search is locked by another reindex process. Skipping.

Once you reset the index, you will be able to run the reindex command, make sure watch the process or have it output to a log file to find what the original issue was.