How to Unlock Reindex Process in Magento 2

During the indexing process in Magento 2, you may come across this error message: ‘Index is locked by another reindex process. Skipping’. This is quite common, either because of timeout, fatal PHP error, limited memory or disruption due to other processes. Once the process of indexing gets locked right at the reindexing time, you cannot reindex that locked index type. As a result, it will always be skipped if you try to reindex that, which can cause various inconveniences.

For instance, if the Stock index type is locked, when you reindex all the data by running this command:

php bin/magento indexer:reindex

You will see that the Stock process has been skipped in the output below:

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

You can reindex in the backend using this Backend Index module for free.

Therefore, in today post, I will show you how to Unlock Reindex Process: Index is locked by another reindex process Skipping step by step.

Read more about Magento 2 Indexing and Reindex

How to unlock reindex process

Step 1: Get Index Types Info

The first thing which you need to do is collecting all the index types’ information/list which is present in Magento 2. In order to do that, use the following command:

php bin/magento indexer:info

After running the command above, you will receive the result like the following:

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

From the output, you will see the code for index type Stock is cataloginventory_stock.

Step 2: Check Index Types Status

In this step, what you need to do is checking the status of all the index types by using this command:

php bin/magento indexer:status

After running the command, you will see the index type Processing status Stock indicates that it is Locked. For more details, see this 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

Step 3: Reset Index Types{#step-3}

To solve this problem, there is a great solution which is reset the index types which are locked. This example is in the Processing state. Run this command to reset all index types:

php bin/magento indexer:reset

Then, to reset multiple index types, run this:

php bin/magento indexer:reset IndexType1 IndexType2 IndexType3

In this case, only one index type is locked which is cataloginventory_stock. Therefore, to unlock it, you have to run this command:

php bin/magento indexer:reset cataloginventory_stock

The result which you will receive after running the command will look like this:

Stock indexer has been invalidated.

Step 4: Step 4: Reindex Index Types

At this step, all you will have to do is check the indexer status one more time. In order to do that run the following command:

php bin/magento indexer:status

The output will look like this:

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

You can see in the output, the Stock index type has been unlocked. Besides, the status of it has been changed from Processing to Reindex required.

Now, the Stock index type can be reindexed by using the following command:

php bin/magento indexer:reindex cataloginventory_stock

You will receive the end result:

Stock index has been rebuilt successfully in 00:00:04

Conclusion

In conclusion, unlocking the Reindex Process is necessary if you don’t want another reindex process Skipping to lock the index. Hope that after reading this detailed instruction, you will be able to unlock the locked reindexing process in Magento 2 with ease using command lines. In case of any questions or concerns, please write comments in the below section.

Image Description
With over a decade of experience crafting innovative tech solutions for ecommerce businesses built on Magento, Jacker is the mastermind behind our secure and well-functioned extensions. With his expertise in building user-friendly interfaces and robust back-end systems, Mageplaza was able to deliver exceptional Magento solutions and services for over 122K+ customers around the world.

People also searched for

  • catalog search index is locked by another reindex process. skipping.
  • customer grid index is locked by another reindex process. skipping.
  • product eav index is locked by another reindex process. skipping.
  • design config grid index is locked by another reindex process. skipping.
  • magento 2 indexer reset
  • exception: catalog search index is locked by another reindex process. skipping.
  • magento 2 reset indexer
  • category products index is locked by another reindex process. skipping.
  • catalog search index is locked by another reindex process. skipping
  • magento 2 reindex reset
  • magento 2 stop reindex process
  • indexer reset magento 2
  • magento 2 invalidate index
  • php bin/magento indexer:reset
  • catalog search reindex required
  • product flat data index is locked by another reindex process. skipping.
  • magento 2 invalidate index programmatically
  • magento indexer reset
  • magento 2 indexer backlog
  • magento 2 disable indexer
  • 2.3.x, 2.4.x
x