0

I'm trying to reindex my Magento installation from SSH. Product Flat Data index process goes in error, throwing the following error:

Product Attributes index was rebuilt successfully in 00:00:06
Product Prices index was rebuilt successfully in 00:00:01
Catalog URL Rewrites index was rebuilt successfully in 00:03:39

Product Flat Data 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 (`fran8774_shop`.`#sql-421e_462a1`, CONSTRAINT `FK_D99C5B76421BA44930F6BA14A2B043DE` FOREIGN KEY (`entity_id`) REFERENCES `pishop_catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDA)' in /home/fran8774/public_html/lib/Zend/Db/Statement/Pdo.php:228

Stack trace:

#0 /home/fran8774/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/fran8774/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/fran8774/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/fran8774/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /home/fran8774/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `pi...', Array)
#5 /home/fran8774/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `pi...', Array)
#6 /home/fran8774/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(423): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `pi...')
#7 /home/fran8774/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(2833): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `pi...')
#8 /home/fran8774/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(815): Varien_Db_Adapter_Pdo_Mysql->addForeignKey('FK_D99C5B76421B...', 'pishop_catalog_...', 'entity_id', 'pishop_catalog_...', 'entity_id', 'CASCADE', 'CASCADE')

It's the first time that it happens, no edit on the files where made.

filippo90
  • 367
  • 2
  • 3
  • 15
  • check this [once](http://magento.stackexchange.com/questions/1542/magento-1-7-cannot-reindex-product-flat-data) –  Jan 18 '17 at 05:12
  • I'm voting to close this question as off-topic because Stack Overflow is a [programming-related](http://stackoverflow.com/help/on-topic) Q&A site. Your question is not about programming. Perhaps you should post it on http://magento.stackexchange.com instead? – Enigmativity Jan 19 '17 at 09:02

0 Answers0