Magento 1.9.2.4 - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' while saving categories

magento.stackexchange https://magento.stackexchange.com/questions/150404

سؤال

I got the below error while saving some categories(not all categories)

2016-12-14T12:56:58+00:00 ERR (3): 
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint    violation: 1062 Duplicate entry '0' for key 'PRIMARY'' in /var/www/vhosts/xxx.com/httpdocs/lib/Zend/Db/Statement/Pdo.php:228 
Stack trace: 
#0 /var/www/vhosts/xxx.com/httpdocs/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) 
#2 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) 
#3 /var/www/vhosts/xxx.com/httpdocs/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) 
#4 /var/www/vhosts/xxx.com/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array) 
#5 /var/www/vhosts/xxx.com/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array) 
#6 /var/www/vhosts/xxx.com/httpdocs/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array) 
#7 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Log/Model/Resource/Visitor.php(78): Zend_Db_Adapter_Abstract->insert('log_url_info', Array) 
#8 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Log/Model/Resource/Visitor.php(94): Mage_Log_Model_Resource_Visitor->_saveUrlInfo(Object(Mage_Log_Model_Visitor)) 
#9 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(423): Mage_Log_Model_Resource_Visitor->_beforeSave(Object(Mage_Log_Model_Visitor)) 
#10 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor)) 
#11 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Log/Model/Visitor.php(189): Mage_Core_Model_Abstract->save() 
#12 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Model/App.php(1338): Mage_Log_Model_Visitor->saveByRequest(Object(Varien_Event_Observer)) 
#13 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor), 'saveByRequest', Object(Varien_Event_Observer)) 
#14 /var/www/vhosts/xxx.com/httpdocs/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array) 
#15 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(551): Mage::dispatchEvent('controller_acti...', Array) 
#16 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Controller/Front/Action.php(75): Mage_Core_Controller_Varien_Action->postDispatch() 
#17 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(422): Mage_Core_Controller_Front_Action->postDispatch() 
#18 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index') 
#19 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) 
#20 /var/www/vhosts/xxx.com/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch() 
#21 /var/www/vhosts/xxx.com/httpdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array) 
#22 /var/www/vhosts/xxx.com/httpdocs/index.php(99): Mage::run('', 'store') 
#23 {main}

Anyone face this already.. If so please help me out of this issue.

هل كانت مفيدة؟

المحلول

You have an issue in magento log tables.

first Take backup of below tables

log_customer
log_visitor
log_visitor_info
log_url
log_url_info
log_quote

Then truncate the tables.

This will resolved your issue.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top