I added some images to my local site and after this when going to the product detail page I got the Magento error page saying that there has been an error processing your request and Image file was not found.
After this the product flat data says that it needs to be re-indexed but when I try to re-index it, it says There was a problem with reindexing process.
I assume the images are related to the issue as it didn't need reindexing prior to this.
I deleted the product that I had uploaded images for, I deleted the cache and cleared the lock files as had been suggested on another post similar to this that I found.
Can anyone suggest any further actions I can take to debug this.
<— FURTHER DETAILS —>
I ran the reindex file in the console and it returned the following error
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 (`startlondon_live`.`#sql-448_15e`, CONSTRAINT `FK_MAG_MAG_CAT_PRD_FLAT_1_ENTT_ID_MAG_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `mag_catalog_product_entity` (`entity_id`) ON DE)' in /home/start-london/public_html/lib/Zend/Db/Statement/Pdo.php:228
The only thing I could think of was to turn off foreign key restraints in the database but this didn't help
Best Answer
Hoping I understood the problem at hand: and the question...
This part of the error message is telling:
What this is telling me is that the column
startlondon_live
is referencing a catalog product entity id column (mag_catalog_product_entity
) on the entity field but that entry or field no longer exists. The name of the foreign key is not formatted as the Magento installer would name it, so that tells me it is custom.In essence the constraint you've created from another table is failing in the indexer because the target column either no longer exists or will be deleted, orphaning the child.
This brings me to a few thoughts:
catalog_product_entity
table; after all, that's the entity of record in Magento for a product. You may still define your ON DELETE rules.In the end you'll need to fix this error. Disabling foreign key checks is a recipe for disaster.
Instead, remove your schema edits from Magento DB. Disable/enable flat catalog - or in the worst-case scenario drop your
catalog_product_flat*
tables and rebuild them.