Key constraint error while importing simple productsImporting produtcs with images from .csv file errorMagento 2.2 data migration Duplicate store_group_name EntriesGetting an error while importing products on Magento from my other storeError running SQL Query - Cannot truncate a table referenced in a foreign key constraintMagento 2 import unique URL key errorProducts not importing via CSV - Magento 2.2.3Magento 2: FastSimpleImport Integrity constraint violationAttributes error on importing Magento 2 productsFacing error when importing virtual product in magento2Exporting Products from 1.9.1 and IMPORTING into 1.9.4 gives “Column names: ”cube_category_Bestsellers“ are invalid” Error

Math equation in non italic font

Custom alignment for GeoMarkers

Is it insecure to send a password in a `curl` command?

Bach's Toccata and Fugue in D minor breaks the "no parallel octaves" rule?

A diagram about partial derivatives of f(x,y)

Why is the President allowed to veto a cancellation of emergency powers?

Book: Young man exiled to a penal colony, helps to lead revolution

I got the following comment from a reputed math journal. What does it mean?

What did “the good wine” (τὸν καλὸν οἶνον) mean in John 2:10?

How could an airship be repaired midflight?

Does .bashrc contain syntax errors?

How could a scammer know the apps on my phone / iTunes account?

Relationship between sampajanna definitions in SN 47.2 and SN 47.35

Instead of a Universal Basic Income program, why not implement a "Universal Basic Needs" program?

Happy pi day, everyone!

Are ETF trackers fundamentally better than individual stocks?

How to explain that I do not want to visit a country due to personal safety concern?

Different outputs for `w`, `who`, `whoami` and `id`

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Adventure Game (text based) in C++

Official degrees of earth’s rotation per day

How to get the n-th line after a grepped one?

ERC721: How to get the owned tokens of an address

Most cost effective thermostat setting: consistent temperature vs. lowest temperature possible



Key constraint error while importing simple products


Importing produtcs with images from .csv file errorMagento 2.2 data migration Duplicate store_group_name EntriesGetting an error while importing products on Magento from my other storeError running SQL Query - Cannot truncate a table referenced in a foreign key constraintMagento 2 import unique URL key errorProducts not importing via CSV - Magento 2.2.3Magento 2: FastSimpleImport Integrity constraint violationAttributes error on importing Magento 2 productsFacing error when importing virtual product in magento2Exporting Products from 1.9.1 and IMPORTING into 1.9.4 gives “Column names: ”cube_category_Bestsellers“ are invalid” Error













2















I am getting an error when I am importing simple products in Magento 2.2.



The error is :




  1. Category " has not been created. URL key for specified store already exists. in row(s): 1 General system exception happened
    Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452
    Cannot add or update a child row: a foreign key constraint fails
    (`acbwqvzgyr`.`catalog_category_product`, CONSTRAINT
    `CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY
    (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON
    DELETE CASCAD), query was: INSERT INTO `catalog_category_product`
    (`product_id`,`category_id`,`position`) VALUES (?, ?, ?), (?, ?, ?) ON
    DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`),
    `category_id` = VALUES(`category_id`)




How can I solve this issue?










share|improve this question
















bumped to the homepage by Community 21 mins ago


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















  • If your importing multiple products with same name then getting above error. Please remove same name products and try again.

    – Abdul
    Dec 2 '17 at 12:23















2















I am getting an error when I am importing simple products in Magento 2.2.



The error is :




  1. Category " has not been created. URL key for specified store already exists. in row(s): 1 General system exception happened
    Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452
    Cannot add or update a child row: a foreign key constraint fails
    (`acbwqvzgyr`.`catalog_category_product`, CONSTRAINT
    `CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY
    (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON
    DELETE CASCAD), query was: INSERT INTO `catalog_category_product`
    (`product_id`,`category_id`,`position`) VALUES (?, ?, ?), (?, ?, ?) ON
    DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`),
    `category_id` = VALUES(`category_id`)




How can I solve this issue?










share|improve this question
















bumped to the homepage by Community 21 mins ago


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















  • If your importing multiple products with same name then getting above error. Please remove same name products and try again.

    – Abdul
    Dec 2 '17 at 12:23













2












2








2








I am getting an error when I am importing simple products in Magento 2.2.



The error is :




  1. Category " has not been created. URL key for specified store already exists. in row(s): 1 General system exception happened
    Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452
    Cannot add or update a child row: a foreign key constraint fails
    (`acbwqvzgyr`.`catalog_category_product`, CONSTRAINT
    `CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY
    (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON
    DELETE CASCAD), query was: INSERT INTO `catalog_category_product`
    (`product_id`,`category_id`,`position`) VALUES (?, ?, ?), (?, ?, ?) ON
    DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`),
    `category_id` = VALUES(`category_id`)




How can I solve this issue?










share|improve this question
















I am getting an error when I am importing simple products in Magento 2.2.



The error is :




  1. Category " has not been created. URL key for specified store already exists. in row(s): 1 General system exception happened
    Additional data: SQLSTATE[23000]: Integrity constraint violation: 1452
    Cannot add or update a child row: a foreign key constraint fails
    (`acbwqvzgyr`.`catalog_category_product`, CONSTRAINT
    `CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY
    (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON
    DELETE CASCAD), query was: INSERT INTO `catalog_category_product`
    (`product_id`,`category_id`,`position`) VALUES (?, ?, ?), (?, ?, ?) ON
    DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`),
    `category_id` = VALUES(`category_id`)




How can I solve this issue?







magento2.2 import-products






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 29 '18 at 11:45









Shashank Kumrawat

1,3081343




1,3081343










asked Dec 2 '17 at 7:48









Ali_2017Ali_2017

111




111





bumped to the homepage by Community 21 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 21 mins ago


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














  • If your importing multiple products with same name then getting above error. Please remove same name products and try again.

    – Abdul
    Dec 2 '17 at 12:23

















  • If your importing multiple products with same name then getting above error. Please remove same name products and try again.

    – Abdul
    Dec 2 '17 at 12:23
















If your importing multiple products with same name then getting above error. Please remove same name products and try again.

– Abdul
Dec 2 '17 at 12:23





If your importing multiple products with same name then getting above error. Please remove same name products and try again.

– Abdul
Dec 2 '17 at 12:23










2 Answers
2






active

oldest

votes


















0














It seems that your csv has a new category on category column and it is not able to create category due to duplicate name [which is eventually throwing duplicate url issue].



My suggestion would be first create categories separately and them do product import.



Also you can use api to import data where you can check the duplicate url key before you insert a data.



Let me know if you need help on API code.






share|improve this answer






























    0














    In your csv file you have at least one empty cell in the 'categories' column, thus the error message is



    Category " has not been created.


    Fill in a value and try it again.






    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%2f204176%2fkey-constraint-error-while-importing-simple-products%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














      It seems that your csv has a new category on category column and it is not able to create category due to duplicate name [which is eventually throwing duplicate url issue].



      My suggestion would be first create categories separately and them do product import.



      Also you can use api to import data where you can check the duplicate url key before you insert a data.



      Let me know if you need help on API code.






      share|improve this answer



























        0














        It seems that your csv has a new category on category column and it is not able to create category due to duplicate name [which is eventually throwing duplicate url issue].



        My suggestion would be first create categories separately and them do product import.



        Also you can use api to import data where you can check the duplicate url key before you insert a data.



        Let me know if you need help on API code.






        share|improve this answer

























          0












          0








          0







          It seems that your csv has a new category on category column and it is not able to create category due to duplicate name [which is eventually throwing duplicate url issue].



          My suggestion would be first create categories separately and them do product import.



          Also you can use api to import data where you can check the duplicate url key before you insert a data.



          Let me know if you need help on API code.






          share|improve this answer













          It seems that your csv has a new category on category column and it is not able to create category due to duplicate name [which is eventually throwing duplicate url issue].



          My suggestion would be first create categories separately and them do product import.



          Also you can use api to import data where you can check the duplicate url key before you insert a data.



          Let me know if you need help on API code.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 2 '17 at 8:01









          Sandipan SSandipan S

          47137




          47137























              0














              In your csv file you have at least one empty cell in the 'categories' column, thus the error message is



              Category " has not been created.


              Fill in a value and try it again.






              share|improve this answer



























                0














                In your csv file you have at least one empty cell in the 'categories' column, thus the error message is



                Category " has not been created.


                Fill in a value and try it again.






                share|improve this answer

























                  0












                  0








                  0







                  In your csv file you have at least one empty cell in the 'categories' column, thus the error message is



                  Category " has not been created.


                  Fill in a value and try it again.






                  share|improve this answer













                  In your csv file you have at least one empty cell in the 'categories' column, thus the error message is



                  Category " has not been created.


                  Fill in a value and try it again.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 29 '18 at 11:37









                  digijaydigijay

                  10114




                  10114



























                      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%2f204176%2fkey-constraint-error-while-importing-simple-products%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

                      Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                      Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

                      Aasi (pallopeli) Navigointivalikko