When I update any product from Magento admin panel, the following error appear:

SQL STATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`db name`.`catalog_product_entity_int`, CONSTRAINT `CATALOG_PRODUCT_ENTITY_INT_ROW_ID_CATALOG_PRODUCT_ENTITY_ROW_ID` FOREIGN KEY (`row_id`) REFERENCES `catalog_product_entity` (`ro), query was: INSERT INTO `catalog_product_entity_int` (`entity_id`,`attribute_id`,`store_id`,`value`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`)
  • Did you find the solution?
    – zus
    Sep 20, 2020 at 13:43

2 Answers 2


If you're running it on Magento Cloud, it's recommended to disable synchronous_replication in your .magento.env.yaml.

The product changes or CSV import causes an integrity constraint violation when there is a sync between the master and slave DBs.

      _merge: true 
          synchronous_replication: false

Please check with catalog_product_entity table.

I check with this table its belongs to CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID

I already post my answer here - Magento 2 Cannot add or update a child row

  • but what i do to remove this error Jul 12, 2019 at 11:14
  • please check with table belongs CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID or not. if not than added to this. Oct 6, 2019 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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