How To Unlock Reindex Process In Magento 2
In this post, I will guide you on How To Unlock Reindex Process In Magento 2. Fix index locked error during the indexing process in Magento 2.
During the operation of the Magento 2 website, you must have encountered the error message “index is locked by another reindex process. Skipping.” in the indexing process. The reason for this error is that the index is locked, you will not be able to restore the locked index and it will always be ignored.
To fix this error, follow the steps below:
Steps Unlock Reindex Process In Magento 2
1. Run the reindex command to determine the locked index:
php bin/magento indexer:reindex
If the index is locked you will get output like this:
Design Config Grid index has been rebuilt successfully in 00:00:04
Customer Grid index has been rebuilt successfully in 00:00:06
Category Products index has been rebuilt successfully in 00:00:02
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:01
Product EAV index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:04
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
2. See the list of index types, along with the index name that will be used for unlocking with below command:
php bin/magento indexer:info
You can see out put like this:
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
3. Unlock index.
To unlock all index types, run commands:
php bin/magento indexer:reset
php bin/magento indexer:reindex
To unlock the locked specified index that you specified in steps 1 and 2, run commands:
php bin/magento indexer:reset <index-type>
With multiple index types:
php bin/magento indexer:reset <index-type-1> <index-type-2> <index-type-3>
To reindex specific index types, run the command:
php bin/magento indexer:reindex <index-type>
In this case, I replaced with cataloginventory_stock and got the following output:
Stock index has been rebuilt successfully in 00:00:04
This is the end of the post.
Follow us for the more helpful posts!
We hope this is a useful post for you How To Install Nginx On CentOS 7.
Thank you for reading!