When I upload CSV file it gives 0 error. After this I click on import button. It gives following error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magentostore_dbname.catalog_product_entity_media_gallery, CONSTRAINT FK_CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY (attribute_id) REFERENCES eav_attribute (attribut), query was: INSERT INTOcatalog_product_entity_media_gallery (attribute_id,entity_id,value) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATEentity_id= VALUES(entity_id`)

enter image description here

Does anyone know, how to solve it?

  • seems like you are using Magento default import/export , best option is to go fro magmi to upload products..... Commented Jun 28, 2017 at 7:06
  • Can you post a sample of the csv? maybe with the line that does not import.
    – Marius
    Commented Jun 28, 2017 at 7:21
  • csv is work fine in After upgrade to CE it gives error. Single product is not upload with csv. Commented Jun 28, 2017 at 9:02
  • @ChiragParmar please update this information in question..... Commented Jun 29, 2017 at 5:45

1 Answer 1


I solved it. Just put one column in csv. I set value "88" to "_media_attribute_id" enter image description here

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.