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

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:

bin/magento indexer:reset <index identifier>

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

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;

Permanent Solution

The extension Improved Asynchronous Re-indexing can automatically validate status of all indexes and run reindex if some index was broken or invalid.

Possible error messages

  • 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.