0
votes

When I'm trying to save a product in Magento I receive this issue:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (papet_mag.innobyte_emag_marketplace_product_cat_characteristic, CONSTRAINT FK_FC8B248E7E23F0E4DAEC8D31641C9910 FOREIGN KEY (product_id) REFERENCES `innobyte_emag_marketplace_category_c)

query was:

INSERT INTO `innobyte_emag_marketplace_product_cat_characteristic` (`product_id`,`characteristic_id`,`value`) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)

What can I do to resolve it ? This is new for me. This issue appear recently

1
how did you resolve the issue?Mohit Rane

1 Answers

0
votes

The message seems pretty clear to me:

  • You are trying to insert a row into the table innobyte_emag_marketplace_product_cat_characteristic with a product_id that doesn't exist in the referenced table innobyte_emag_marketplace_category_c.

The question is: What's the specific product_id, and does it actually exist?