Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can’t reindex Catalog Category Product Index
 
Lionheart81
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2009-10-30
 

v1.7.0.2

So the admin gave me an error when trying to reindex the category products on my local magento install. So I ran the command line reindex like so:

php shell/indexer.php reindexall

And got this:

Category Products index process unknown error:
exception ‘PDOException’ with message ‘SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`diddly-deals`.`catalog_category_product_index`, CONSTRAINT `FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) O)’ in /Library/WebServer/Documents/diddlydeals/lib/Zend/Db/Statement/Pdo.php:228

Ran the following sql statement and it solved my problems. YAY!

ALTER TABLE `catalog_category_product_index` DROP FOREIGN KEY
FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID

 
Magento Community Magento Community
Magento Community
Magento Community
 
EthanMcFenton
Jr. Member
 
Total Posts:  7
Joined:  2013-04-24
 

Thank you, this solved my issue with the re-indexing!

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
dwdonline
Member
 
Avatar
Total Posts:  56
Joined:  2008-03-06
Southern California
 

Lionheart81 - you are awesome. That was the solution I needed after a database went away error in 1.8.0.1.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top