I'm having problems reindexing the data in magento 1.6 through the admin panel. I just get a message saying
Cannot initialize the indexer process
and the products aren't displaying in the categories on the front end which is obviously a massive problem for the site.
I have tried running the process via shell but it throws the following error:
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 (`strailco_firstclass`.`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)' in /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#5 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#6 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(176): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#7 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php(48): Mage_Index_Model_Resource_Abstract->insertFromSelect(Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#8 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(147): Mage_Index_Model_Resource_Helper_Mysql4->insertData(Object(Mage_Catalog_Model_Resource_Category_Indexer_Product), Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#9 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(111): Mage_Index_Model_Resource_Abstract->insertFromTable('catalog_categor...', 'catalog_categor...', false)
#10 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(929): Mage_Index_Model_Resource_Abstract->syncData()
#11 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(132): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#12 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(166): Mage_Index_Model_Indexer_Abstract->reindexAll()
#13 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(194): Mage_Index_Model_Process->reindexAll()
#14 /home/strailco/1stclassholidays.com/html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#15 /home/strailco/1stclassholidays.com/html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#16 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`strailco_firstclass`.`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)' in /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#4 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#5 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(176): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#6 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php(48): Mage_Index_Model_Resource_Abstract->insertFromSelect(Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#7 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(147): Mage_Index_Model_Resource_Helper_Mysql4->insertData(Object(Mage_Catalog_Model_Resource_Category_Indexer_Product), Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#8 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(111): Mage_Index_Model_Resource_Abstract->insertFromTable('catalog_categor...', 'catalog_categor...', false)
#9 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(929): Mage_Index_Model_Resource_Abstract->syncData()
#10 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(132): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#11 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(166): Mage_Index_Model_Indexer_Abstract->reindexAll()
#12 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(194): Mage_Index_Model_Process->reindexAll()
#13 /home/strailco/1stclassholidays.com/html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#14 /home/strailco/1stclassholidays.com/html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#15 {main}
I have tried deleting the lock files with no success.
Does anyone have ant idea what the problem might be as I'm stuck and need it resolving asap
Many Thanks in advance