1

I am using Commerce Kickstart 2 to build a store. I have several Feeds importers working well. I duplicated a working importer and updated the mapping for the "product variation" and "product display".

When trying to import, I now receive the following error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_product-236' for key 'PRIMARY' SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_product-237' for key 'PRIMARY' SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_product-238' for key 'PRIMARY'

I have re-run the working importers and do not have this problem. Reading other posts, it sounds like the importer is trying to import the same item twice, but I don't see why.

I checked the log and see that it isn't grabbing "SKU" from my csv and is assigning it something else. How do I deal with this?

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_product-236' for key 'PRIMARY'
Original item

array(
  'title' => 'model',
  'brand' => 'brand',
  'product category' => 'prod',
  'primary use' => 'MTB',
  'intended use -alt' => '29+',
  'frame material' => 'Steel',
  'brake type' => 'Disc',
  'rohloff' => 'Yes',
  'rohloff axle plate' => 'OEM',
  'belt compatible' => 'Yes',
  'tensioning method' => 'Pivoting Dropouts',
  'build kit img' => '',
  'body' => 'Customized for Cycle Monkey: Rohloff-optimized designed for trail riding and versatile enough for...',
  'sku' => 'VN001',
  'price' => '738000',
  'dealer price' => '627300',
  'color' => 'Orange',
  'frame size' => 'XS',
  'wheel size' => '29+',
  'build kit' => 'Signature',
  'images' => '',
)

Entity

(object) array(
  'type' => 'bikes',
  'product_id' => '236',
  'sku' => 'Bikes-236',
  'revision_id' => '233',
  'title' => 'model',
  'uid' => '1',
  'status' => 1,
  'created' => 1463278774,
  'changed' => 1463278774,
  'log' => 'Created by FeedsCommerceProductProcessor',
  'revision_timestamp' => 1463278774,
  'revision_uid' => '1',
  'language' => '',
  'is_new' => TRUE,
)
0

When setting up this product variation, I selected for the SKU to be automatically generated. In doing so, it was tripping up the feeds importer. Not sure if this was a timing issue, but I reviewed the importer set up and product variation fields for the importers that were working vs. not.

This SKU setting was the only difference. Since this field is unique ID, this seemed like the most likely culprit.

I would appreciate an explanation of why this was triggering an issue, but am happy to be able to move on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.