0

Magento 1.9.1.0 all patches. We have a weird indexing issue. We have all indexers set to "Update on Save" But we still keep getting "Reindex Required", mostly index product stock status.

  1. I thought that if you have "Update on Save" it reindexes right away, and you would never see "Reindex Required"?

  2. The second weird thing is when I go into the index_process_event table, the event that has a status of "new" is a very old one, like 2 years old? What is happening here? It almost seems like something is changing old rows in index_process_event to "new"?

My index_event table has 26456 rows and my index_process_event has 2322

I think this is related, we also keep having products disappear from categories. It just happens randomly. One to three products will not show up a couple times a day, when we are busy. So then we reindex or save the product and it comes back.

Do you think truncating the index_process tables would fix this?

3
  • Check magento log file, Is there any error specify. Commented Sep 17, 2016 at 4:08
  • exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2225-0-1' for key 'PRIMARY'' in /home/live/public_html/lib/Zend/Db/Statement/Pdo.php:228 Commented Sep 17, 2016 at 6:35
  • Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2225-0-1' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_price_final_tmp SELECT e.entity_id, cg.customer_group_id, cw.website_id, ..... Commented Sep 17, 2016 at 6:35

1 Answer 1

2

Based on the exceptions you need to fix those duplicate entries first, usually you can just remove the offending row directly in the DB, take a backup first, though.

So it could be the indexes are failing each time they run so they are always incomplete.

The best way to correlate that failure to the indexer is to run it via CLI if you can. If you have SSH access go to your Magento web root and run something like this -

php shell/indexer.php --reindexall

Then wait for the indexer to run, if one of the exceptions is the problem it will be output during the appropriate index.

It could be a locks issue in var/locks, too, but often they are locked because of some other failure.

4
  • The weird thing is I don't have a var/locks folder? I did have an issue with permissions on the var folder, and now my logs write to /tmp/magento/var/ But there is no lock folder there either. Do you think that it is not creating locks, because of a permission problem, and it does not lock and that is the issue? Although I read that 1.9 uses db locks, not files any more. Commented Sep 17, 2016 at 19:39
  • 1
    Hard for me to say really, are you able to run the indexers via CLI? Thats where I would start.
    – MartyS
    Commented Sep 17, 2016 at 22:58
  • Thank your for your help. Yes, I can run indexers fine. It looks like the error occurs during the checkout. This is from the stack trace: #15 /home/live/public_html/app/code/core/Mage/Paypal/Controller/Express/Abstract.php(320): Mage_Paypal_Model_Express_Checkout->place('EC-05T52469N127...') Commented Sep 19, 2016 at 21:01
  • Looking in app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php In the function: _prepareFinalPriceData How does it lock the tables, to prevent 2 index actions from causing this? Commented Sep 19, 2016 at 21:14

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.