Magento 2 Index is locked by another reindex process

Posted in: Magento, Tips

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
Copyright © 2013-present Magento, Inc. All rights reserved.