1

I created a Magento 2.0.2 store and used :

https://github.com/ubertheme/magento2_data_migration/releases

to import from my 1.9.2 store. When i try to save one of my configurable products I get this error.

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`gaxle_magento2`.`catalog_product_entity`, CONSTRAINT `CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) O), query was: UPDATE `catalog_product_entity` SET `attribute_set_id` = ?, `type_id` = ?, `sku` = ?, `has_options` = ?, `required_options` = ?, `created_at` = '2013-02-07 06:18:07', `updated_at` = '2015-11-30 20:57:16' WHERE (`entity_id`=44)

I don't get this error saving all configurable products. Just this one from what i can tell. Any ideas?

1
  • A side note. I'm not leaving out info in the query. The ?s are literal. Mar 25 '16 at 3:31
1

The error says that this configurable product is assigned to attribute set that not exists in system. Try assign it to "default" set and problem should be fixed.

3
  • My default attribute set id is 4. This query : select attribute_set_id, type_id, sku, has_options, required_options, created_at, updated_at from catalog_product_entity WHERE entity_id IN (44) shows that the id is right. See result: attribute_set_id type_id sku has_options required_options created_at updated_at 4 configurable GA-SWLSCorona 1 1 2013-02-07 00:18:07 2015-11-30 14:57:16 Mar 23 '16 at 23:35
  • also, this query returns no results. <br/> SELECT * FROM catalog_product_entity WHERE attribute_set_id NOT IN ( SELECT attribute_set_id FROM eav_attribute_set ); Mar 24 '16 at 1:25
  • Have you got it solved ? I'm getting the fk error when I try to enable the product. If I edit other values and save, it works. Values in both tables seem correct.
    – rbncha
    May 25 '16 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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