0

I am getting this error when I try to re-index the Attribute's Index on my magento 1.9.2.4 site.

Here is a excerpt from the image below

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (cmc_mag.catalog_product_index_eav, CONSTRAINT FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE O)' in /home/cmcadm1n/public_html/lib/Zend/Db/Statement/Pdo.php:228

enter image description here

Any help would be appreciated.

0

Enable magento DB logging via: lib/Varien/Db/Adapter/Pdo/Mysql.php .

protected $_debug = false; protected $_logAllQueries = false; protected $_logCallStack = false; protected $_debugFile = ‘var/debug/sql.txt’;

Change all to true and then run the re-index. Then check the log file specified above.

Remove the column that shouldn't be there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.