Magento Forum

   
Product Attributes index process unknown error: exception ‘PDOException’ with message ‘SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate
 
blurg
Jr. Member
 
Total Posts:  11
Joined:  2011-04-19
 

Hi fellow Magentoers,

I keep getting the indexing error on my Product Attributes index. I am using Magento 1.5 and did not upgrade or something (which most people have done when they run in to this err)

Product Attributes index process unknown error:
exception ‘PDOException’ with message ‘SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘8157-964-1-162’ for key ‘PRIMARY’’ in /home/some/public_html/lib/Zend/Db/Statement/Pdo.php:228

Stack trace:
#0 /home/some/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/some/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/some/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/some/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(’INSERT INTO `ca...’, Array)
#4 /home/some/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query(’INSERT INTO `ca...’, Array)
#5 /home/some/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(1544): Varien_Db_Adapter_Pdo_Mysql->query(’INSERT INTO `ca...’, Array)
#6 /home/some/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php(261): Varien_Db_Adapter_Pdo_Mysql->insertArray(’catalog_product...’, Array, Array)
#7 /home/some/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php(242): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav_Source->_saveIndexData(Array)
#8 /home/some/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Source.php(84): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav_Source->_prepareMultiselectIndex(NULL, NULL)
#9 /home/some/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav/Abstract.php(47): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav_Source->_prepareIndex()
#10 /home/some/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Eav.php(185): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav_Abstract->reindexAll()
#11 /home/some/public_html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(125): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Eav->reindexAll()
#12 /home/some/public_html/app/code/core/Mage/Index/Model/Process.php(139): Mage_Index_Model_Indexer_Abstract->reindexAll()
#13 /home/some/public_html/app/code/core/Mage/Index/Model/Process.php(167): Mage_Index_Model_Process->reindexAll()
#14 /home/some/public_html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#15 /home/some/public_html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#16 {main}

All the other indexes run well. Satus learns that the Attributes index is running?

[~/public_html]# php shell/indexer.php --status
Product Attributes:  Running
Product Prices:  Pending
Catalog URL Rewrites:  Pending
Product Flat Data:  Pending
Category Flat Data:  Pending
Category Products:  Pending
Catalog Search Index:  Pending
Stock Status:  Pending
Tag Aggregation Data:  Pending

Who can help me out, it’s very hi prio for me… :(

Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
blurg
Jr. Member
 
Total Posts:  11
Joined:  2011-04-19
 

I got some more info.

These products I am trying to import were imported before but now I added an extra attribute. That works for the first three products and it seems to be the fourth products which goes wrong everytime. When I delete that article in the CSV file it goes wrong after 2 other products.

I don’t see any discrepancies here, these articles look fine.

Should I delete some indexes or something before importing these articles again? I deleted all the products via the admin interface.

BTW:
It’s also quite irritating that the log does not show the full query, in my humble opinion one of the most important parts of the error:

#2 /home/oldtimer/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(’INSERT INTO `ca...’, Array)
#3 /home/oldtimer/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query(’INSERT INTO `ca...’, Array)
#4 /home/oldtimer/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(1544): Varien_Db_Adapter_Pdo_Mysql->query(’INSERT INTO `ca...’, Array)

 
Magento Community Magento Community
Magento Community
Magento Community
 
blurg
Jr. Member
 
Total Posts:  11
Joined:  2011-04-19
 

I found this error is not due to lines in my products, it must be due to reinserting the same line or something. I modified my script which is now continueing where it left of (if product exists, skip it). Everytime it inserts to products, and then gives me this stack trace again.
In the next run it’s importing two products again and so on.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blurg
Jr. Member
 
Total Posts:  11
Joined:  2011-04-19
 

No one experienced this before or can help me out with this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
G&C
Jr. Member
 
Total Posts:  29
Joined:  2009-09-15
 
blurg - 28 November 2011 07:38 PM

No one experienced this before or can help me out with this?

I’m having the same issue in 1.6.2.0, did you get to the bottom of it?

Cheers,

G&C;.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top