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!!
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!