Foreignkey integrity error while configurable product import magento 2 Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Getting error in catalog product price indexingUpdating configurable product throws Integrity constraint violation error about UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_IDMagento 2: Creating product with custom OptionsSQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row?how to Create configurable product using simple product collectionCreate configurable products programatically MagentoIntegrity constraint error referring to quote_item table while adding product to cartFacing error when importing downlodable product in magento2sql error while adding any products to category : M2how to solved table catalog_product_entiry issue : M2Magento 2 : Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

How to rotate it perfectly?

What's the point in a preamp?

Limit for e and 1/e

How to colour the US map with Yellow, Green, Red and Blue to minimize the number of states with the colour of Green

What can I do if my MacBook isn’t charging but already ran out?

What is the largest species of polychaete?

If I can make up priors, why can't I make up posteriors?

Estimated State payment too big --> money back; + 2018 Tax Reform

Why use gamma over alpha radiation?

Can smartphones with the same camera sensor have different image quality?

Is there folklore associating late breastfeeding with low intelligence and/or gullibility?

How are presidential pardons supposed to be used?

Problem when applying foreach loop

Is it possible to ask for a hotel room without minibar/extra services?

What do you call a plan that's an alternative plan in case your initial plan fails?

Working around an AWS network ACL rule limit

Was credit for the black hole image misattributed?

Can a zero nonce be safely used with AES-GCM if the key is random and never used again?

Does a C shift expression have unsigned type? Why would Splint warn about a right-shift?

Replacing HDD with SSD; what about non-APFS/APFS?

Array/tabular for long multiplication

What was the last x86 CPU that did not have the x87 floating-point unit built in?

What LEGO pieces have "real-world" functionality?

Who can trigger ship-wide alerts in Star Trek?



Foreignkey integrity error while configurable product import magento 2



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Getting error in catalog product price indexingUpdating configurable product throws Integrity constraint violation error about UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_IDMagento 2: Creating product with custom OptionsSQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row?how to Create configurable product using simple product collectionCreate configurable products programatically MagentoIntegrity constraint error referring to quote_item table while adding product to cartFacing error when importing downlodable product in magento2sql error while adding any products to category : M2how to solved table catalog_product_entiry issue : M2Magento 2 : Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















When I was trying to import some configurable products, magento admin shows the following error




General system exception happened
Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`magento2`.`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`)


But the configurable product csv successfully passed the first validation check in the admin (Check data button). But when we click the import in next step, the above error is showing.



But the product information is inserted in the "catalog_product_entity" table. When I check the product detail page in admin, the configurable product variations are not listing and that product is not listing in store view.










share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Please, add more info about your csv?

    – Khoa TruongDinh
    Aug 26 '16 at 12:32

















1















When I was trying to import some configurable products, magento admin shows the following error




General system exception happened
Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`magento2`.`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`)


But the configurable product csv successfully passed the first validation check in the admin (Check data button). But when we click the import in next step, the above error is showing.



But the product information is inserted in the "catalog_product_entity" table. When I check the product detail page in admin, the configurable product variations are not listing and that product is not listing in store view.










share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Please, add more info about your csv?

    – Khoa TruongDinh
    Aug 26 '16 at 12:32













1












1








1








When I was trying to import some configurable products, magento admin shows the following error




General system exception happened
Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`magento2`.`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`)


But the configurable product csv successfully passed the first validation check in the admin (Check data button). But when we click the import in next step, the above error is showing.



But the product information is inserted in the "catalog_product_entity" table. When I check the product detail page in admin, the configurable product variations are not listing and that product is not listing in store view.










share|improve this question
















When I was trying to import some configurable products, magento admin shows the following error




General system exception happened
Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`magento2`.`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`)


But the configurable product csv successfully passed the first validation check in the admin (Check data button). But when we click the import in next step, the above error is showing.



But the product information is inserted in the "catalog_product_entity" table. When I check the product detail page in admin, the configurable product variations are not listing and that product is not listing in store view.







magento2 configurable-product product-attribute importexport






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 26 '16 at 12:02







Arun SS

















asked Aug 26 '16 at 11:54









Arun SSArun SS

2311513




2311513





bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Please, add more info about your csv?

    – Khoa TruongDinh
    Aug 26 '16 at 12:32

















  • Please, add more info about your csv?

    – Khoa TruongDinh
    Aug 26 '16 at 12:32
















Please, add more info about your csv?

– Khoa TruongDinh
Aug 26 '16 at 12:32





Please, add more info about your csv?

– Khoa TruongDinh
Aug 26 '16 at 12:32










2 Answers
2






active

oldest

votes


















0














I was able to solve this problem by shortening my SKUs. I had many that were over the 64 character limit imposed by the database schema and shortening them allowed for a successful import.



It is worth mentioning that the Data Checker does not currently (Oct. 2018) check for SKU length.






share|improve this answer






























    0














    Check the list of SKU's in your CSV file. Usually this means there are invalid characters in the list.



    If you go back to System > Import, and use Delete instead of Add/Update, and instruct it to STOP ON ERRORS, after you check your file it will warn you that products x - x do not exist, this indicated where the last operation fails.



    Now open the CSV you are using, go to the line number magento just told you had it had a problem deleting, and you should see what caused your initial error in that line.



    After that is fixed, just retry the transaction (Go back to System > Import, recheck the data, then hit the import button). Happens once in a while!






    share|improve this answer

























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "479"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f133252%2fforeignkey-integrity-error-while-configurable-product-import-magento-2%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      I was able to solve this problem by shortening my SKUs. I had many that were over the 64 character limit imposed by the database schema and shortening them allowed for a successful import.



      It is worth mentioning that the Data Checker does not currently (Oct. 2018) check for SKU length.






      share|improve this answer



























        0














        I was able to solve this problem by shortening my SKUs. I had many that were over the 64 character limit imposed by the database schema and shortening them allowed for a successful import.



        It is worth mentioning that the Data Checker does not currently (Oct. 2018) check for SKU length.






        share|improve this answer

























          0












          0








          0







          I was able to solve this problem by shortening my SKUs. I had many that were over the 64 character limit imposed by the database schema and shortening them allowed for a successful import.



          It is worth mentioning that the Data Checker does not currently (Oct. 2018) check for SKU length.






          share|improve this answer













          I was able to solve this problem by shortening my SKUs. I had many that were over the 64 character limit imposed by the database schema and shortening them allowed for a successful import.



          It is worth mentioning that the Data Checker does not currently (Oct. 2018) check for SKU length.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 25 '18 at 2:52









          dantheman2865dantheman2865

          1011




          1011























              0














              Check the list of SKU's in your CSV file. Usually this means there are invalid characters in the list.



              If you go back to System > Import, and use Delete instead of Add/Update, and instruct it to STOP ON ERRORS, after you check your file it will warn you that products x - x do not exist, this indicated where the last operation fails.



              Now open the CSV you are using, go to the line number magento just told you had it had a problem deleting, and you should see what caused your initial error in that line.



              After that is fixed, just retry the transaction (Go back to System > Import, recheck the data, then hit the import button). Happens once in a while!






              share|improve this answer





























                0














                Check the list of SKU's in your CSV file. Usually this means there are invalid characters in the list.



                If you go back to System > Import, and use Delete instead of Add/Update, and instruct it to STOP ON ERRORS, after you check your file it will warn you that products x - x do not exist, this indicated where the last operation fails.



                Now open the CSV you are using, go to the line number magento just told you had it had a problem deleting, and you should see what caused your initial error in that line.



                After that is fixed, just retry the transaction (Go back to System > Import, recheck the data, then hit the import button). Happens once in a while!






                share|improve this answer



























                  0












                  0








                  0







                  Check the list of SKU's in your CSV file. Usually this means there are invalid characters in the list.



                  If you go back to System > Import, and use Delete instead of Add/Update, and instruct it to STOP ON ERRORS, after you check your file it will warn you that products x - x do not exist, this indicated where the last operation fails.



                  Now open the CSV you are using, go to the line number magento just told you had it had a problem deleting, and you should see what caused your initial error in that line.



                  After that is fixed, just retry the transaction (Go back to System > Import, recheck the data, then hit the import button). Happens once in a while!






                  share|improve this answer















                  Check the list of SKU's in your CSV file. Usually this means there are invalid characters in the list.



                  If you go back to System > Import, and use Delete instead of Add/Update, and instruct it to STOP ON ERRORS, after you check your file it will warn you that products x - x do not exist, this indicated where the last operation fails.



                  Now open the CSV you are using, go to the line number magento just told you had it had a problem deleting, and you should see what caused your initial error in that line.



                  After that is fixed, just retry the transaction (Go back to System > Import, recheck the data, then hit the import button). Happens once in a while!







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 14 '18 at 7:22









                  PHP Bugs

                  208110




                  208110










                  answered Feb 10 '17 at 16:52









                  Max Alexander HannaMax Alexander Hanna

                  201210




                  201210



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f133252%2fforeignkey-integrity-error-while-configurable-product-import-magento-2%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      منجزی محتویات تیره‌های طایفه منجزی[ویرایش] مشاهیر طایفه منجزی[ویرایش] محل سکونت[ویرایش] پانویس[ویرایش] منابع[ویرایش] منوی ناوبری«نمودار اجتماعی طوایف بختیاری»«BakhtyārBAḴTĪĀRĪ TRIBE»«اسامی طوایف و شعب ایل بختیاری»ووگسترش آن

                      بیوانفورماتیک محتویات تاریخچه[ویرایش] اهداف[ویرایش] کاربردهای بیوانفورماتیک[ویرایش] زمینه‌های مهم بیوانفورماتیک[ویرایش] موضوعات سیستم نرم‌افزاری بیوانفورماتیک[ویرایش] مراکز و ابزار[ویرایش] جستارهای وابسته[ویرایش] پیوند به بیرون[ویرایش] منابع[ویرایش] منوی ناوبریووانجمن بیوانفورماتیک ایرانمرکز بیوانفورماتیک دانشگاه تهرانمرکز ملی تحقیقات بیوانفورماتیکانستیتو بیو-آی‌تیبانک داده‌های دی ان ایمرکز ملی اطلاعات بیوتکنولوژیانستیتوی بیوانفورماتیک اروپاپورتال بیوانفورماتیک ایران«فرهنگ واژه‌های مصوب فرهنگستان ـ دفتر هشتم، بخش لاتین»وووو4611085-900870420ووو