We are Saving Configurable Products using Pim(pimcore) through a custom Module in Magento, while saving configurable Products,we are getting this below Foreign key constraint Erorr,
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`staging`.`catalog_product_super_attribute_label`, CONSTRAINT `FK_309442281DF7784210ED82B2CC51E5D5` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `catalog_product_super_attribute` (`pr), query was: INSERT INTO `catalog_product_super_attribute_label` (`product_super_attribute_id`,`store_id`,`use_default`,`value`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `use_default` = VALUES(`use_default`)"2024-11-19T11:37:04+00:00 INFO (6):
On re-saving, no error is triggered, and the data gets saved successfully. However, this issue occurs randomly. Additionally, a few other tables, such as catalog_product_entity_media_gallery_value, occasionally trigger similar foreign key constraint errors, though very rarely.
Can anyone suggest how to trace the root cause and solution, as this behavior is -happening inconsistently?
-Thanks.