Key constraint error while importing simple productsImporting produtcs with images from .csv file...

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

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

Custom alignment for GeoMarkers

Does .bashrc contain syntax errors?

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

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

What's the meaning of a knight fighting a snail in medieval book illustrations?

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

Is it good practice to use Linear Least-Squares with SMA?

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

How to write cleanly even if my character uses expletive language?

Math equation in non italic font

This word with a lot of past tenses

Why Choose Less Effective Armour Types?

Bacteria contamination inside a thermos bottle

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

Professor being mistaken for a grad student

Employee lack of ownership

Is there a symmetric-key algorithm which we can use for creating a signature?

Why one should not leave fingerprints on bulbs and plugs?

What is a ^ b and (a & b) << 1?

Relationship between sampajanna definitions in SN 47.2 and SN 47.35

Does multi-classing into Fighter give you heavy armor proficiency?

Are Roman Catholic priests ever addressed as pastor



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 6 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 6 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 6 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 6 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

                      “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                      How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                      夢乃愛華...