cancel
Showing results for 
Search instead for 
Did you mean: 

Front-End error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Front-End error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

We run a small business on a Magento Version 1.3.2.4 for about 10years... Since approx. 1 month we get this error message on front end: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1399002' for key 'PRIMARY' Trace: #0 /home/lecoinso/public_html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array) #1 /home/lecoinso/public_html/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array) #2 /home/lecoinso/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array) #3 /home/lecoinso/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(281): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array) #4 /home/lecoinso/public_html/lib/Zend/Db/Adapter/Abstract.php(535): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array) #5 /home/lecoinso/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(369): Zend_Db_Adapter_Abstract->insert('log_visitor', Array) #6 /home/lecoinso/public_html/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Log_Model_Visitor)) #7 /home/lecoinso/public_html/app/code/core/Mage/Log/Model/Visitor.php(159): Mage_Core_Model_Abstract->save() #8 /home/lecoinso/public_html/app/code/core/Mage/Core/Model/App.php(1239): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer)) #9 /home/lecoinso/public_html/app/Mage.php(303): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array) #10 /home/lecoinso/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(454): Mage::dispatchEvent('controller_acti...', Array) #11 /home/lecoinso/public_html/app/code/core/Mage/Core/Controller/Front/Action.php(45): Mage_Core_Controller_Varien_Action->preDispatch() #12 /home/lecoinso/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(365): Mage_Core_Controller_Front_Action->preDispatch() #13 /home/lecoinso/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('index') #14 /home/lecoinso/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #15 /home/lecoinso/public_html/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch() #16 /home/lecoinso/public_html/index.php(53): Mage::run('default') #17 {main} We didn't do anything. Seriously. We were on holidays...when we came back, front end was down. No hacking happened/visible to us. Our provider is not very supportive and just says: hardware is ok. We understand that anything is duplicated, but shouldn't... What can we do? Please help, as we are no magento professionals... thanx Mathias from Germany
3 REPLIES 3

Re: Front-End error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Hello @MK0341,

 

Can you please run below query in Mysql?

 

TRUNCATE dataflow_batch_export ; 
TRUNCATE dataflow_batch_import ; 
TRUNCATE log_customer ; 
TRUNCATE log_quote ; 
TRUNCATE log_summary ; 
TRUNCATE log_summary_type ; 
TRUNCATE log_url ; 
TRUNCATE log_url_info ; 
TRUNCATE log_visitor ; 
TRUNCATE log_visitor_info ; 
TRUNCATE log_visitor_online ; 
TRUNCATE report_event ;

Don't worry about it, It's just clear visitor log data.

 

 

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Front-End error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

thank you for your answer... I just ran these TRUNCATEs...no results given. zero data records found. spooky, because at least "report_event" is full of reports. anything else? Mathias

Re: Front-End error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry **SOLVED!

OK, I just solved OUR problem: Our shop was running out of space... Although there were several MBs free (1-2%) in our account, clearing the reports manually (via FTP) woke up our shop again. I did some more cleansing...and now a full backup is only 10MBs, were before it was over 100MBs. So, have to talk to my provider again...those dumb nuts. cheers M.