I am trying to reindex the product attributes and am getting the error Can’t initialize indexer process. The product attributes are stuck on ‘Processing’ in my exception.log I am getting
2010-08-06T07:01:06+00:00 DEBUG (7): Exception message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`db_magent0/catalog_product_index_eav`, CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON )
I’ve tried al kinds of thingsd from the forums and none are fixing it, any ideas?
System>Configuration>Inventory>Display Out of Stock Products to NO
I can re-index no problem.
Anyone any clues how to fix it?, and I hope that helps someone.
Hi,
I have exactly the same problem as yours.
When I set: Display Out of Stock Products to NO
I can reindex without problem
When I set: YES
I have this error message: There was a problem with reindexing process.
And the line “Product Attributes” Index product attributes for layered navigation building is in status “processing”
I had this same issue, found this forum post but the steps didn’t lead me to the solution unfortunately. The subject was a good match though. In my situation, the indexer process encountered an integrity constraint error with the indexing table ‘catalog_product_index_eav’. That may be helpful or not depending on what error you’re actually running into so the way I determined the error was looking at the latest messages in the “/var/log/system.log” file. In our case it mentioned an error like this:
Then on the subsequent lines there was mention of each file (trace) that lead up to the error. It ended up that several of our products had duplicate entries for a multiselect attribute (which was a fault of our own from setting attributes in code for several reasons).
At any rate, I hope that helps people when tracking down their actual issue with the reindexing because the steps above, although they may work for some, they didn’t work for us because the issue halting our indexing process was a result of bad data.
I had a problem reindexing the layered navigation with the option “Display Out of Stock Products” set to Yes. The Product Attributes (Index product attributes for layered navigation building) keeped on processing after a manual reindex click. I solved my problem by adding the reindex by adding the following line to the /etc/crontab :
go to product id “1487” in the magento backend and save it.
I got that product id from the “Duplicate entry” error in the exception log
if you get the message again, you will have to do this for the next “Duplicate entry” product id, however, i have never seen this on more than 1 product.
Try first to clean Magento cache. If no success, run official DB repair tool.
How to repair the magento database:
1. Download repair tool from Magento and unzip the package.
2. Upload magento-db-repair-tool-1.1.php to your server
3. Backup your current database (call it ‘magentoDB1′). Export this database and then import it into a new database (let’s call it ‘magentoDB2′).
4. Install a fresh Magento using ‘magentoDB2′.
5. Now open the the URL in browser: http://www.youdomain.com/magento-db-repair-tool-1.0.php.
6. Enter ‘magentoDB1′ as ‘corrupted’ and ‘magentoDB2′ as ‘reference’. Enter all necessary information and click ‘Continue’ button. Wait and see result..
If you have still any problem or show this error
there was a problem with reindexing process. product flat data
then go to phpmyadmin and empty this table “catalog_product_flat_1“.
SQLSTATE[HY000]: General error: 1005 Can't create table '.\database_name\catalog_category_flat_store_1.frm (errno: 150)
Solution:
ALTER TABLE catalog_category_entity ENGINE=INNODB; ALTER TABLE core_store ENGINE=INNODB;
Note: If you empty any table first take backup before empty that.