I can't quite figure out this error. It suddenly happened after we were enabling New Products.

2015-08-05T22:31:24+00:00 DEBUG (7): Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '10620-137-1-258' for key 'PRIMARY'
Trace: #0 /chroot/home/jennyyoo/jennyyoo.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /chroot/home/jennyyoo/jennyyoo.com/html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /chroot/home/jennyyoo/jennyyoo.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#4 /chroot/home/jennyyoo/jennyyoo.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#5 /chroot/home/jennyyoo/jennyyoo.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(1998): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...', Array)
#6 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php(280): Varien_Db_Adapter_Pdo_Mysql->insertArray('catalog_product...', Array, Array)
#7 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php(261): Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source->_saveIndexData(Array)
#8 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php(84): Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source->_prepareMultiselectIndex(NULL, NULL)
#9 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php(50): Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source->_prepareIndex()
#10 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php(185): Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract->reindexAll()
#11 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Eav->reindexAll()
#12 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()
#13 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll()
#14 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(127): Mage_Index_Model_Process->reindexEverything()
#15 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#16 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#17 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /chroot/home/jennyyoo/jennyyoo.com/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 /chroot/home/jennyyoo/jennyyoo.com/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#20 /chroot/home/jennyyoo/jennyyoo.com/html/index.php(95): Mage::run('', 'store')
#21 {main}

Pick the product ID/sku from admin panel for product you want to delete it. Delete it from DB directly. So, execute following sql query.


DELETE FROM `catalog_product_entity` WHERE `sku` = 'testsku';


DELETE FROM `catalog_product_entity` WHERE `entity_id` = '100'

After delete it please try for re-index all the indices.

  • Hello! How do I know what product to delete? – Elva Sandoval Aug 6 '15 at 16:02
  • Hi Elva, in your error it's showing value '10620-137-1-258'. Please refer this value. First of check is this SKU ? If sku then pick it's Id. I think 1062 might be a ID. – Praful Rajput Aug 7 '15 at 6:35
  • Yes, it was an ID. I went into the magento admin and searched for the ID and found it wasn't assigned to a shop category. Thank you for your help! – Elva Sandoval Aug 7 '15 at 16:50
  • Hi Elva, was it useful to you ? If yes then please Make above answer as with useful. – Praful Rajput Aug 10 '15 at 9:07

So, All I did was go into product '10620', checked attributes, and hit "Save". Tried to re-index again, when it failed again, then I checked the exception log in var/logs/exception.log and it gave me the same error, but this time with a different Product Id, so I just kept going in to each product that would error, and finally it re-indexed!! I believe it had something to do with using the product import in "advanced profiles", because prior to the csv import, there were no issues.

  • Yes, When you import product via CSV at that time some of validation not applied. This make entry into DB directly. While you add the product from GUI (admin panel) at that time it's ask for mandatory fields and proper data check validation. So carefully prepare bulk product import CSV. – Praful Rajput Aug 13 '15 at 5:23

I had same issue, and for me delete the product wasnt the best solution. We solved this by editing attribute which was a multiselect and inside this array of values, we had 2 times the same value!

If it occurs to someone else, just look at the attribute's value and it might solve your issue.

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.