Magento 2 Comment débloquer un processus de réindexation


65

Je fais des tests dans le processus de réindexation Magento et j'ai verrouillé le processus d' indexation boursière .

Comment puis-je déverrouiller ce processus?

Design Config Grid index has been rebuilt successfully in 00:00:02
Customer Grid index has been rebuilt successfully in 00:00:03
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
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
Catalog Search index has been rebuilt successfully in 00:00:06

Réponses:


118

Vous pouvez réinitialiser l'indexeur via la ligne de indexer:resetcommande à l' aide de la commande.

Cela donnera à la liste des index le nom:

php bin/magento indexer:info

Sortie:

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

Cela donnera le statut de la liste des index:

php bin/magento indexer:status

Sortie:

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

Si vous souhaitez réinitialiser tous les index, vous pouvez exécuter la commande suivante:

php bin/magento indexer:reset

Si vous souhaitez réinitialiser un index particulier (par exemple cataloginventory_stock), vous pouvez exécuter la commande suivante:

php bin/magento indexer:reset cataloginventory_stock

1
La réinitialisation de l'index perd-elle les données en attente d'indexation?
ol'bob dole

Je suis également confronté au même problème dans magento 2.2.4 enterprise editionj'ai résolu en utilisant l'étape ci-dessus, mais mon produit n'est pas affiché à l'avant. quel est le problème une idée?
Chirag Patel

Génial, m'a beaucoup aidé ..
Amy

10

Lorsque j'ai rencontré ce genre de situation, j'ai dû exécuter la requête SQL suivante directement dans la base de données:

UPDATE indexer_state SET status = 'valid';

Je n'ai pu trouver aucune option pour forcer la réindexation lorsqu'un index a déjà échoué.


6

Sur MySQL, lancez:

SET SQL_SAFE_UPDATES = 0;
update indexer_state set status = 'invalid' where status != 'valid';

Puis, sur votre terminal, lancez:

php bin/magento indexer:reindex

Cela se produit normalement lorsque la mémoire est limitée, augmentez donc votre configuration .htaccess ou NGINX .


1

Il suffit d'utiliser les commandes:

php bin/magento indexer:reset
php bin/magento indexer:reindex
php bin/magento cache:clean full_page block_html

0

Il est également possible que vous rencontriez un état dans lequel certaines tables sont verrouillées dans MySQL. Dans ce cas, vous pouvez émettre une unlock tables;instruction SQL pour pouvoir continuer.

J'ai rencontré un problème comme celui-ci:

Category Products indexer process unknown error:
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO

Où je ne pouvais pas réindexer jusqu'à ce que le verrou de la table a été supprimé.

La réinitialisation de l'index perd-elle les données en attente d'indexation? - ol'bob dole

L'indexation est un processus consistant à examiner l'ensemble de données et à stocker certaines clés pour les associer aux données appropriées. Vous perdriez votre index actuel dans le processus et il le recréerait. En dehors des effets secondaires de l'utilisation d'index par les ressources ou de l'inexactitude de votre ensemble de données, il ne devrait y avoir aucun risque de réindexation.


0

Il suffit de lancer ces commandes

php bin / magento indexer: réinitialiser php bin / magento indexer: reindex


-2

J'ai résolu ce problème en procédant comme suit:

1.- supprimer la table customer_grid_flat

2.- Recréez le tableau:

CREATE TABLE IF NOT NOT EXISTS customer_grid_flat( entity_idint UNSIGNED NOT NULL COMMENTAIRE 'ID de l'entité', nametexte NULL COMMENTAIRE 'Nom', emailvarchar (255) NULL COMMENTAIRE 'Email', group_idint NULL COMMENTAIRE 'Group_id', created_athorodatage NULL par défaut NULL COMMENTAIRE 'Created_at', website_idint NULL COMMENTAIRE 'Website_id', confirmationvarchar (255) NULL COMMENTAIRE 'Confirmation', created_intexte NULL COMMENTAIRE 'Created_in', dobdate NULL COMMENTAIRE 'Dob', genderint NULL COMMENTAIRE 'Genre', taxvatvarchar (255) NULL COMMENTAIRE 'Taxvat', lock_expireshorodatage NULL default NULL COMMENTAIRE 'Lock_expires', shipping_fulltexte NULL COMMENTAIRE 'Shipping_full', billing_fulltexte NULL COMMENTAIRE ' Billing_full ', billing_firstnamevarchar (255) NULL COMMENT' Billing_firstname ', billing_lastnamevarchar (255) NULL COMMENTAIRE 'Billing_lastname', billing_telephonevarchar (255) NULL COMMENTAIRE 'Billing_telephone', billing_postcodevarchar (255) NULL COMMENTAIRE 'Billing_postcode', billing_country_idvarchar (255) NULL COMMENTAIRE 'Billing_country_id', billing_regionvarchar (255) NULL COMMENT ', Billing_region', billing_streetvarchar (255) NULL COMMENTAIRE 'Billing_street', billing_cityvarchar (255) NULL COMMENTAIRE 'Billing_city', billing_faxvarchar (255) NULL COMMENTAIRE 'Billing_fax', billing_vat_idvarchar (255) NULL COMMENTAIRE 'Billing_vat_id', billing_companyvarchar (255) NULL COMMENTAIRE 'Billing_company', Varchar (255) NULL COMMENTAIRE ' PRIMARY KEY ( entity_id), INDEX CUSTOMER_GRID_FLAT_GROUP_ID( group_id), INDEX CUSTOMER_GRID_FLAT_CREATED_AT( created_at), INDEX CUSTOMER_GRID_FLAT_WEBSITE_ID( website_id), INDEX CUSTOMER_GRID_FLAT_CONFIRMATION( confirmation),INDEX CUSTOMER_GRID_FLAT_DOB( dob), INDEXCUSTOMER_GRID_FLAT_GENDER( gender), INDEX CUSTOMER_GRID_FLAT_BILLING_COUNTRY_ID( billing_country_id), FULLTEXT FTI_8746F705702DD5F6D45B8C7CE7FE9F2F( name, email, created_in, taxvat, shipping_full, billing_full, billing_firstname, billing_lastname, billing_telephone, billing_postcode, billing_region, billing_city, billing_fax, billing_company)) COMMENT = 'customer_grid_flat' MOTEUR = innodb charset = UTF - 8 ASSEMBLER = utf8_general_ci

En utilisant notre site, vous reconnaissez avoir lu et compris notre politique liée aux cookies et notre politique de confidentialité.
Licensed under cc by-sa 3.0 with attribution required.