Magento 2 – How to Unlock Reindex Process

magento2reindexstock

I'm making some tests in Magento reindex process and I locked the stock index process.

How can I unlock this process?

Design Config Grid index has been rebuilt successfully in 00:00:02
Customer Grid index has been rebuilt successfully in 00:00:03
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index is locked by another reindex process. Skipping.
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:06

Best Answer

You can reset the indexer through command line with indexer:reset command.

This will give the list of indexes name:

php bin/magento indexer:info

Output:

design_config_grid                       Design Config Grid
customer_grid                            Customer Grid
catalog_category_product                 Category Products
catalog_product_category                 Product Categories
catalog_product_price                    Product Price
catalog_product_attribute                Product EAV
catalogsearch_fulltext                   Catalog Search
cataloginventory_stock                   Stock
catalogrule_rule                         Catalog Rule Product
catalogrule_product                      Catalog Product Rule

This will give the list of indexes status:

php bin/magento indexer:status

Output:

Design Config Grid:                                Ready
Customer Grid:                                     Ready
Category Products:                                 Ready
Product Categories:                                Ready
Product Price:                                     Ready
Product EAV:                                       Ready
Catalog Search:                                    Ready
Stock:                                             Processing
Catalog Rule Product:                              Ready
Catalog Product Rule:                              Ready

If you want to reset all the indexes, you can run the following command:

php bin/magento indexer:reset

If you want to reset particular index (e.g. cataloginventory_stock), you can run the following command:

php bin/magento indexer:reset cataloginventory_stock
Related Topic