macopedia / magmi-m2

Magmi GitHub, see branch magento2 for a version compatible with Magento 2
113 stars 53 forks source link

Attribute set association #22

Open lawko opened 6 years ago

lawko commented 6 years ago

Hi! I'm trying to import attributes. Attributes are importing fine, attribute set importing fine (with this changes), but attribute set association - not good. They are imported, but there is always a error:

Attribute Set Importer v0.0.2 - Exception in update/insert loop for entity 'attribute association' in record no 6765: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (domikom.eav_entity_attribute, CONSTRAINTEAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_IDFOREIGN KEY (attribute_id) REFERENCESeav_attribute(attribute_id) ON DELETE C),see trace log!

All attribute_id are in both tables, checked. But error displaying... And because of this error, import is VERY slow. Although, I repeat, as a result, it ends successfully. Visually so it seems. Products are created, attribute & attribute set & attribute set associations are created too.

What can we do to make this error disappear? :)

Magento 2.2.2 CE. The originals of the files in the attachment. import.zip

nhartman7 commented 6 years ago

Initialized attribute_set_infos! Attribute Set Importer v0.0.2 - Insert & Update loop processed 1/1 records. Attribute Set Importer v0.0.2 - Prune loop processed 62/62 records. Attribute Set Importer v0.0.2 - Insert & Update loop processed 1/1 records. Attribute Set Importer v0.0.2 - Prune loop processed 3/3 records. Attribute Set Importer v0.0.2 - Exception in update/insert loop for entity 'attribute association' in record no 1: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (REMOVED THIS FIELD -NH.eav_entity_attribute, CONSTRAINT EAV_ENTT_ATTR_ATTR_GROUP_ID_EAV_ATTR_GROUP_ATTR_GROUP_ID FOREIGN KEY (attribute_group_id) REFERENCES eav_attribute_group (`attribute_g),see trace log! Attribute Set Importer v0.0.2 - Prune loop processed 55/55 records.

This is my result when using your template and have not had success uploading attributes. Any ideas?

dbachmann commented 5 years ago

Same problem here with magento 2.2.6 and an attribite set association update. The attributes do not appear in the attribute sets after the update.

Exception in update/insert loop for entity 'attribute association' in record no 12063: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mshop.eav_entity_attribute, CONSTRAINTEAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_IDFOREIGN KEY (attribute_id) REFERENCESeav_attribute(attribute_id) ON DELETE CAS)

Any ideas?