3

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.

5

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.

  • in cmdline fire php -f magento_root/shell/log.php clean command also work – Murtuza Zabuawala Dec 15 '16 at 7:39
  • i have tried this Amit..but still same issue. – Priya Ponnusamy Dec 15 '16 at 8:14
  • May be you have your log have issue – Amit Bera Dec 15 '16 at 8:27
  • 1
    Do you know any other solutions?.. – Priya Ponnusamy Dec 15 '16 at 11:06
  • may be your log_customer log_visitor log_visitor_info log_url log_url_info log_quote corrupted. You need to fix that.First rename those table and copy those table stucture from another default magento – Amit Bera Dec 15 '16 at 11:07

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.