0

I 'm getting the following error:

> SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
> '0' for key 'PRIMARY'
> 
> Trace:
> #0 /home/hofb/web/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
> #1 /home/hofb/web/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
> #2 /home/hofb/web/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
> #3 /home/hofb/web/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
> #4 /home/hofb/web/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
> #5 /home/hofb/web/lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
> #6 /home/hofb/web/app/code/core/Mage/Log/Model/Resource/Visitor.php(174):
> Zend_Db_Adapter_Abstract->insert('log_visitor_inf...', Array)
> #7 /home/hofb/web/app/code/core/Mage/Log/Model/Resource/Visitor.php(108):
> Mage_Log_Model_Resource_Visitor->_saveVisitorInfo(Object(Mage_Log_Model_Visitor))
> #8 /home/hofb/web/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(463):
> Mage_Log_Model_Resource_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
> #9 /home/hofb/web/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
> #10 /home/hofb/web/app/code/core/Mage/Log/Model/Visitor.php(168): Mage_Core_Model_Abstract->save()
> #11 /home/hofb/web/app/code/core/Mage/Core/Model/App.php(1338): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
> #12 /home/hofb/web/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor),
> 'initByRequest', Object(Varien_Event_Observer))
> #13 /home/hofb/web/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
> #14 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Action.php(527):
> Mage::dispatchEvent('controller_acti...', Array)
> #15 /home/hofb/web/app/code/core/Mage/Core/Controller/Front/Action.php(64):
> Mage_Core_Controller_Varien_Action->preDispatch()
> #16 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Action.php(407):
> Mage_Core_Controller_Front_Action->preDispatch()
> #17 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250):
> Mage_Core_Controller_Varien_Action->dispatch('view')
> #18 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Front.php(172):
> Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
> #19 /home/hofb/web/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
> #20 /home/hofb/web/app/Mage.php(684): Mage_Core_Model_App->run(Array)
> #21 /home/hofb/web/index.php(152): Mage::run('', 'store')
> #22 {main}

Any ideas how i can fix that? I have 3 websites on the same magento installation.

-- UPDATE --

I fixed that and now i am getting the following error

Unknown number format type 'array'. Format 's:12:"#,##0.00 ¤"; 7200 1464778224 8' must be a valid number format string.

> Trace:
> #0 /home/hofb/web/lib/Zend/Locale/Format.php(307): Zend_Locale_Format::_checkOptions(Array)
> #1 /home/hofb/web/lib/Zend/Currency.php(194): Zend_Locale_Format::toNumber(0, Array)
> #2 /home/hofb/web/app/code/core/Mage/Directory/Model/Currency.php(270):
> Zend_Currency->toCurrency(0, Array)
> #3 /home/hofb/web/app/code/core/Mage/Directory/Model/Currency.php(242):
> Mage_Directory_Model_Currency->formatTxt(0, Array)
> #4 /home/hofb/web/app/code/core/Mage/Directory/Model/Currency.php(222):
> Mage_Directory_Model_Currency->formatPrecision(0, 2, Array, true,
> false)
> #5 /home/hofb/web/app/code/core/Mage/Core/Model/Store.php(1004): Mage_Directory_Model_Currency->format(0, Array, true)
> #6 /home/hofb/web/app/code/core/Mage/Checkout/Helper/Data.php(61): Mage_Core_Model_Store->formatPrice(0)
> #7 /home/hofb/web/app/design/frontend/default/crazy_1/template/checkout/cart/mini_cart_top.phtml(8):
> Mage_Checkout_Helper_Data->formatPrice(0)
> #8 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(241): include('/home/hofb/web/...')
> #9 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
> #10 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
> #11 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
> #12 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
> #13 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('top_cart', true)
> #14 /home/hofb/web/app/design/frontend/default/crazy_1/template/page/html/header.phtml(50):
> Mage_Core_Block_Abstract->getChildHtml('top_cart')
> #15 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(241): include('/home/hofb/web/...')
> #16 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
> #17 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
> #18 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
> #19 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
> #20 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('header', true)
> #21 /home/hofb/web/app/design/frontend/default/crazy_1/template/page/1column.phtml(31):
> Mage_Core_Block_Abstract->getChildHtml('header')
> #22 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(241): include('/home/hofb/web/...')
> #23 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
> #24 /home/hofb/web/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
> #25 /home/hofb/web/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
> #26 /home/hofb/web/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
> #27 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Action.php(390):
> Mage_Core_Model_Layout->getOutput()
> #28 /home/hofb/web/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
> #29 /home/hofb/web/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController),
> 'homepage')
> #30 /home/hofb/web/app/code/core/Mage/Cms/controllers/IndexController.php(45):
> Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController),
> 'homepage')
> #31 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Action.php(418):
> Mage_Cms_IndexController->indexAction()
> #32 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250):
> Mage_Core_Controller_Varien_Action->dispatch('index')
> #33 /home/hofb/web/app/code/core/Mage/Core/Controller/Varien/Front.php(172):
> Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
> #34 /home/hofb/web/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
> #35 /home/hofb/web/app/Mage.php(684): Mage_Core_Model_App->run(Array)
> #36 /home/hofb/web/index.php(152): Mage::run('', 'store')
> #37 {main}

I am using the same template on another website without getting similar error. Any ideas ?

0

go to your magento shell directory and php -f log.php -- clean -- days

Hopefully error will be removed

1
  • 1
    php -f log.php -- clean --days (speficied days) or just truncate your logs tables – Arshad Muhammad May 30 '16 at 15:16
0

The problem was apc cache.

APC was enabled for the main main domain but not for the second one.

Enabling APC across all domains solved the prolbem

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.