1

the indexing of magento product Flat data is staying on "index required".The mode is on "Scheme" and the cron is running. I tried several things like:

truncate catalog_product_flat_1, catalog_product_flat_2, catalog_product_flat_3, catalog_product_flat_4

php bin/magento indexer:reindex
php bin/magento indexer:reset 
php bin/magento indexer:reindex
php bin/magento indexer:reset catalog_product_flat

Error :-

message in shell: State for the same indexer already exists.

update indexer_state set status = 'invalid' where status != 'valid';

Then reindex again

Can anybody help? Thanks

3 Answers 3

1

In Database Run This Query

update indexer_state set status = 'invalid' where indexer_id = 'catalog_product_flat';

And After This run indexer:reindex command

7
  • did this, but i see still the same error. Commented Jun 19, 2019 at 12:18
  • bin/magento indexer:status and check catalog_product_flat status Commented Jun 19, 2019 at 12:32
  • result: Product Flat Data: Reindex required Commented Jun 19, 2019 at 12:34
  • try to indexer:reindex Commented Jun 19, 2019 at 12:38
  • I already did multiple times, without a result Commented Jun 19, 2019 at 12:39
0

In your database, try running the below commnand

update indexer_state set status = 'invalid' where status != 'valid';

Then reindex again

9
  • Hi, did but still same error: State for the same indexer already exists. Commented Jun 19, 2019 at 12:11
  • try running command with sudo
    – surbhi agr
    Commented Jun 19, 2019 at 12:13
  • What's the right commando with sudo? Commented Jun 19, 2019 at 12:14
  • sudo php bin/magento indexer:reindex
    – surbhi agr
    Commented Jun 19, 2019 at 12:14
  • same error still showing Commented Jun 19, 2019 at 12:14
0

The problem is caused by duplicate indexer state rows in indexer_state table of your database.

Run this query to see, which indices contain multiple state rows in this table:

SELECT * FROM `indexer_state`;

Identify indices with duplicate state rows and delete excess state rows by running this query:

DELETE FROM `indexer_state` WHERE `state_id` IN (500,501,502);

Provide all state_id values that have indexer_id values that repeat more than once, excluding the original state_id values.

After running this query there will be no duplicate indexer states and the index should no longer throw that error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.