0
votes

When I tries to add the simple product to configurable product I am getting the below error

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db_mydb.catalog_product_super_link, CONSTRAINT FK_CAT_PRD_SPR_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (entity_id) ON DELE)

But this was working perfectly before. Anyone has idea, What could be the reason.?

Much appreciated your help.

1
have you upgraded your db?..or imported ??..check if its set to INNODBKingshuk Deb
check all the data, if there is some blank value. I had the same issue. After checking all the data I found one blank sku was creating the issue.Anurag Prashant

1 Answers

0
votes

But this was working perfectly before

Step one would be "what have you changed since before"? Installing custom extensions may change system behavior, so if you've installed anything recently (or even if you haven't, it's possible the bug's been lurking but you hadn't tried the specific save code path before) try disabling extensions in a development environment until the error doesn't happen anymore.

It's also worth checking out your catalog_product_super_link table and the specific query that's running when you get this foreign constraint error. It sounds like Magento tried to remove a product from this table, catalog_product_super_link, but doing do would cause a data integrity violation.