Category products index is locked by another reindex process. skipping.

Magento 2 Index is locked by another reindex process

Nogle gange sker det at en reindex process bliver låst. Dette kan give nogle udfordringer da du så ikke kan køre en opdatering af dette index, dette index bliver ganske enkelt sprunget over.

I sidste ende kan det medføre at dine data ikke bliver vist korrekt på shoppen.

Eksempel, du vil gerne have kørt dine indexes og starter processen:

php bin/magento indexer:reindex

I svaret herunder kan du se at Lager indexet er låst:

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

For at løse dette kan du køre kommandoen:

bin/magento indexer:reset

Dette resetter alle dine indexes, og du kan herefter køre en opdatering.

Vil du kun resette det aktuelle index, kan du finde index type koden ved at køre

bin/magento indexer:info

Dette giver et svar i stil med

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

Heraf fremgår det at index typen for lageret er

cataloginventory_stock

Så derfor kan vi istedet for en total reset nøjes med at resette lager indexes med:

bin/magento indexer:reset cataloginventory_stock

2 years ago

In Magento 2, Sometimes an issue comes like the indexing process gets locked at the time of reindexing. When the process or the index type is locked then you cannot reindex that specific locked index type. The reindex will always skip that index type and you will get an error as below.

“Index is locked by another reindex process. Skipping”

So in this case, To Unlock Reindex Process you need reset index status and then try to run a new reindex process.

To reset index status, use below command

php bin/magento indexer:reset<index identifier>

Example:

php bin/magento indexer:reset cataloginventory_stock

If you want to reset all the indexes, use below command

php bin/magento indexer:reset

If you don’t know the index identifier, use below command

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

catalogrule_rule Catalog Rule Product

catalog_product_attribute Product EAV

cataloginventory_stock Stock

inventory Inventory

catalogrule_product Catalog Product Rule

catalog_product_price Product Price

scconnector_google_remove Google Product Removal Feed

scconnector_google_feed Google Product Feed

catalogsearch_fulltext Catalog Search

If you want to know the status of the all indexes, use below command

php bin/magento indexer:status

Thats it. Enjoy Magento 2!!

Category products index is locked by another reindex process. skipping.

Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!

How to reset index in Magento2?

2 Steps to Unlock Reindex Process in Magento 2:.
2.1 Step 1: Reindex when Index is Locked..
2.2 Step 2: Get Index Types Info..
2.3 Step 3: Check Index Types Status..
2.4 Step 4: Reset Index Types..
2.5 Step 5: Reindex Index Types..
2.6 Step 6: Final Reindex after Unlocking..

How do I run reindex programmatically in Magento 2?

Here is how to do it. $indexidarray = $this->indexFactory->create()->load($indexid); //If you want reindex all use this code. That's it!

What is reindex in Magento 2?

When the data changes, the transformed data must be updated or reindexed. With the support of reindexing, Magento 2 store owners can quickly and correctly change the store data, reduce the waiting time of customers, and increase the conversion rate.

How do I run reindex?

Reindexing via Magento 2 Admin Log in to Magento 2 Admin and navigate to System → Index Management. You will see the panel above. Select indexers, which has status Reindex Required, then select in Actions menu Update on Schedule. Press Submit button to apply selected mode to indexers.