Hi guys,
I tried to reindex my website data by using Index Management but only the Product Attributes show the error "Cannot initialize the indexer process.". After check the var/log/exception.log,I got the follow information:
2016-05-16T18:06:37+00:00 DEBUG (7): Exception message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`5534test`.`catalog_product_index_eav`, CONSTRAINT `FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCA) Trace: #0 F:\wamp\www\5534test\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) #1 F:\wamp\www\5534test\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) #2 F:\wamp\www\5534test\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array) #3 F:\wamp\www\5534test\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array) #4 F:\wamp\www\5534test\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array) #5 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Resource\Abstract.php(179): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...') #6 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Resource\Helper\Mysql4.php(48): Mage_Index_Model_Resource_Abstract->insertFromSelect(Object(Varien_Db_Select), 'catalog_product...', Array, false) #7 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Resource\Abstract.php(153): Mage_Index_Model_Resource_Helper_Mysql4->insertData(Object(Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source), Object(Varien_Db_Select), 'catalog_product...', Array, false) #8 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Resource\Abstract.php(113): Mage_Index_Model_Resource_Abstract->insertFromTable('catalog_product...', 'catalog_product...', false) #9 F:\wamp\www\5534test\app\code\core\Mage\Catalog\Model\Resource\Product\Indexer\Eav\Abstract.php(54): Mage_Index_Model_Resource_Abstract->syncData() #10 F:\wamp\www\5534test\app\code\core\Mage\Catalog\Model\Resource\Product\Indexer\Eav.php(185): Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract->reindexAll() #11 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Indexer\Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Eav->reindexAll() #12 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll() #13 F:\wamp\www\5534test\app\code\core\Mage\Index\Model\Process.php(258): Mage_Index_Model_Process->reindexAll() #14 F:\wamp\www\5534test\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(182): Mage_Index_Model_Process->reindexEverything() #15 F:\wamp\www\5534test\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Index_Adminhtml_ProcessController->massReindexAction() #16 F:\wamp\www\5534test\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex') #17 F:\wamp\www\5534test\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #18 F:\wamp\www\5534test\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch() #19 F:\wamp\www\5534test\app\Mage.php(684): Mage_Core_Model_App->run(Array) #20 F:\wamp\www\5534test\index.php(87): Mage::run('', 'store') #21 {main}
I've tried to repair database with the Database Repair Tool,but this doesn't seem to make a difference. Can anyone see what the issue is here?
You have duplicate entries in a foreign key constraint. See http://stackoverflow.com/questions/20911549/magento-1-8-reindex-all
Unfortunately there is no simple way to fix this without manually removing the duplicates from the database, which requires DBA skills and a deep understanding of the Magento database schema.