firegento / FireGento_FastSimpleImport2

AvS_FastSimpleImport for Magento 2
GNU General Public License v3.0
136 stars 78 forks source link

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails #145

Open shyopat opened 2 weeks ago

shyopat commented 2 weeks ago

import products in bulk causing error below

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (catalog_product_website, CONSTRAINT CAT_PRD_WS_PRD_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE), query was: INSERT INTO catalog_product_website (product_id,website_id) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?) ON DUPLICATE KEY UPDATE product_id = VALUES(product_id), website_id = VALUES(website_id)

please look into it

sprankhub commented 2 weeks ago

Most probably, this has nothing to do with this extension. Spontaneous guess: You might try to add a product to the same website multiple times, which leads to this error. If you can share minimal data how this issue can be reproduced, we can have a look, but it sounds like an issue with the data you are passing to the importer.

shyopat commented 2 weeks ago

Array ( [0] => Array ( [sku] => ELB6225 [price] => 699 [intact_product_type] => Standard [sorting_order] => 82287 [qty] => 0 [manage_stock] => 1 [is_in_stock] => 1 [backorders] => 0 [special_price] => 599 [additional_attributes] => promotion_text=RRP €999 [next_available_date] => EMPTYVALUE__ )

[1] => Array
    (
        [sku] => E555
        [price] => 699
        [intact_product_type] => Standard
        [sorting_order] => 82288
        [qty] => 0
        [manage_stock] => 1
        [is_in_stock] => 1
        [backorders] => 0
        [special_price] => 599
        [additional_attributes] => promotion_text=RRP €999
        [next_available_date] => __EMPTY__VALUE__
    )

)

sprankhub commented 2 weeks ago

You don't even have a website in your data. Did you try to add it? Maybe this helps.

Also, if you want someone to help, it always helps to share a minimal executable example. You posted your data now, but not the executable code how you import it.