I was facing the same issue and i get it resolved by firing following query which will remove primary key from table. #19 /mnt/webdrive//app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch() #18 /mnt/webdrive//app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #17 /mnt/webdrive//app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveOrder') #16 /mnt/webdrive//app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction() #15 /mnt/webdrive//app/code/core/Mage/Checkout/controllers/OnepageController.php(579): Mage_Checkout_Model_Type_Onepage->saveOrder() #14 /mnt/webdrive//app/code/core/Mage/Checkout/Model/Type/Onepage.php(812): Mage_Sales_Model_Service_Quote->submitAll() #13 /mnt/webdrive//app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder() #12 /mnt/webdrive//app/code/core/Mage/Sales/Model/Service/Quote.php(191): Mage::dispatchEvent('sales_model_ser.', Array) #11 /mnt/webdrive//app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('sales_model_ser.', Array) #10 /mnt/webdrive//app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogInventory_Model_Observer), 'reindexQuoteInv.', Object(Varien_Event_Observer)) #9 /mnt/webdrive//app/code/core/Mage/Core/Model/App.php(1358): Mage_CatalogInventory_Model_Observer->reindexQuoteInventory(Object(Varien_Event_Observer)) #8 /mnt/webdrive//app/code/core/Mage/CatalogInventory/Model/Observer.php(749): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexProductIds(Array) #7 /mnt/webdrive//app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(315): Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable->reinde圎ntity(Array) #6 /mnt/webdrive//app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php(71): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->_movePriceDataToIndexTable() #5 /mnt/webdrive//app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(564): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca.') #4 /mnt/webdrive//lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca.', Array) #3 /mnt/webdrive//lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca.', Array) #2 /mnt/webdrive//lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #1 /mnt/webdrive//app/code/core/Zend/Db/Statement.php(311): Varien_Db_Statement_Pdo_Mysql->_execute(Array) #0 /mnt/webdrive//lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) Is that the cause of the problem? Will removing the automatic indexing for the prices (which rarely change) and changing to manual mode fix this issue? Or will other indexes also cause this problem?Īn example of the stacktrace I'm getting in the log: Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE: Integrity constraint violation: 1062 Duplicate entry '' for key 'PRIMARY', query was: INSERT INTO `catalog_product_index_price_tmp` SELECT `catalog_product_index_price_final_tmp`.`entity_id`, `catalog_product_index_price_final_tmp`.`customer_group_id`, `catalog_product_index_price_final_tmp`.`website_id`, `catalog_product_index_price_final_tmp`.`tax_class_id`, `catalog_product_index_price_final_tmp`.`orig_price` AS `price`, `catalog_product_index_price_final_tmp`.`price` AS `final_price`, `catalog_product_index_price_final_tmp`.`min_price`, `catalog_product_index_price_final_tmp`.`max_price`, `catalog_product_index_price_final_tmp`.`tier_price`, `catalog_product_index_price_final_tmp`.`group_price` FROM `catalog_product_index_price_final_tmp`' in /mnt/webdrive//lib/Zend/Db/Statement/Pdo.php:235 I have set the index on 'Update on Save', since we're using the Community Edition. However, the big problem becomes in the checkout! Every now and then (not always) there happens an integrity constraint violation when the user tries to check out. The synchronization is going great, and the products appear and show correctly, as well the quantity and out of stock. I have a constantly running script that adds/changes products' quantities and prices, based on an API from a foreign 3rd party CRM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |