How to fix magento reindexing with PDOException error? - php

I got an error when I reindex data. I have been working for about 3 days with this problem still can't find the solution. here is the log error I have received:
Default Values (MANAdev) index process unknown error: exception
'PDOException' with message 'SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (glasseso_magento.m_filter2_value, CONSTRAINT
FK_m_filter2_value_mana_db?edit_session FOREIGN KEY
(edit_session_id) REFERENCES m_edit_session (id) ON DELETE
CASCADE ON UPDATE CASCAD)' in
/Applications/MAMP/htdocs/magestore/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /Applications/MAMP/htdocs/magestore/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `m_...', Array)
#5 /Applications/MAMP/htdocs/magestore/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `m_...', Array)
#6 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `m_...', Array)
#7 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(453): Zend_Db_Adapter_Abstract->insert('m_filter2_value', Array)
#8 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mana_Filters_Model_Filter2_Value))
#9 /Applications/MAMP/htdocs/magestore/app/code/local/Mana/Db/Helper/Data.php(217): Mage_Core_Model_Abstract->save()
#10 /Applications/MAMP/htdocs/magestore/app/code/local/Mana/Db/Model/Indexer.php(36): Mana_Db_Helper_Data->replicate()
#11 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Index/Model/Process.php(209): Mana_Db_Model_Indexer->reindexAll()
#12 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#13 /Applications/MAMP/htdocs/magestore/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#14 /Applications/MAMP/htdocs/magestore/shell/indexer.php(198): Mage_Shell_Compiler->run()
#15 {main}
Next exception
'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign
key constraint fails (glasseso_magento.m_filter2_value, CONSTRAINT
FK_m_filter2_value_mana_db?edit_session FOREIGN KEY
(edit_session_id) REFERENCES m_edit_session (id) ON DELETE
CASCADE ON UPDATE CASCAD)' in
/Applications/MAMP/htdocs/magestore/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /Applications/MAMP/htdocs/magestore/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `m_...', Array)
#4 /Applications/MAMP/htdocs/magestore/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `m_...', Array)
#5 /Applications/MAMP/htdocs/magestore/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `m_...', Array)
#6 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(453): Zend_Db_Adapter_Abstract->insert('m_filter2_value', Array)
#7 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mana_Filters_Model_Filter2_Value))
#8 /Applications/MAMP/htdocs/magestore/app/code/local/Mana/Db/Helper/Data.php(217): Mage_Core_Model_Abstract->save()
#9 /Applications/MAMP/htdocs/magestore/app/code/local/Mana/Db/Model/Indexer.php(36): Mana_Db_Helper_Data->replicate()
#10 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Index/Model/Process.php(209): Mana_Db_Model_Indexer->reindexAll()
#11 /Applications/MAMP/htdocs/magestore/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#12 /Applications/MAMP/htdocs/magestore/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#13 /Applications/MAMP/htdocs/magestore/shell/indexer.php(198): Mage_Shell_Compiler->run()
#14 {main}
Hope that someone can help me on this issue.

I took at a look of the contents of m_edit_session, and there was just one line with an ID of 1, and a timestamp under created_at. I changed the ID of that one and only row to 0 (instead of 1) and this error went away.

A good solution could be to disable "Foreign Key Checks". In file /app/code/local/Mana/Db/Helper/Data.php (217) ...
Change this:
$object->save();
For this:
$resource = Mage::getSingleton('core/resource');
$writeConnection = $resource->getConnection('core_write');
$writeConnection->query("SET FOREIGN_KEY_CHECKS = 0;");
$object->save();
$writeConnection->query("SET FOREIGN_KEY_CHECKS = 1;");
Good luck!

A quick solution is to catch the Exception and log it, so the indexer could finish its work.
Maybe the try{} catch{} Block fits here:
Applications/MAMP/htdocs/magestore/app/code/local/Mana/Db/Helper/Data.php(217): Mage_Core_Model_Abstract->save()
The cause of the exception may be found in an inconsistent implementation of the Mana-Module.

Related

setting SYMFONY_DEPRECATIONS_HELPER to show a backtrace doesn't show anything useful

As detailed here https://symfony.com/blog/new-in-symfony-3-1-deprecation-helper-improvements, I've set SYMFONY_DEPRECATIONS_HELPER to a regex of the deprecation message like this in phpunit.xml:
<env name="SYMFONY_DEPRECATIONS_HELPER" value="/Relying on entity queries to check access/" />
However, the resulting backtrace isn't useful at all, as in only shows a trace through the innards of Symfony and PHPUnit and not the code with the deprecation at all:
Self deprecation triggered by Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest::testProjectCreationCommonsWorker:
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked. See https://www.drupal.org/node/3201242
Stack trace:
#0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(16384, 'a:5:{s:11:"depr...', '/Users/joachim/...', 291, Array)
#1 core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php(150): call_user_func(Array, 16384, 'a:5:{s:11:"depr...', '/Users/joachim/...', 291, Array)
#2 [internal function]: Drupal\Tests\Listeners\DrupalListener->Drupal\Tests\Listeners\{closure}(16384, 'a:5:{s:11:"depr...', '/Users/joachim/...', 291)
#3 /Users/joachim/Sites/MYPROJECT/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerTrait.php(291): trigger_error('a:5:{s:11:"depr...', 16384)
#4 /Users/joachim/Sites/MYPROJECT/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerForV7.php(59): Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#5 core/tests/Drupal/Tests/Listeners/DrupalListener.php(127): Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#6 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Framework/TestResult.php(450): Drupal\Tests\Listeners\DrupalListener->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#7 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php(377): PHPUnit\Framework\TestResult->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#8 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php(187): PHPUnit\Util\PHP\AbstractPhpProcess->processChildResult(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), Object(PHPUnit\Framework\TestResult), 'a:4:{s:10:"test...', '')
#9 sites/simpletest/TestCase.php(903): PHPUnit\Util\PHP\AbstractPhpProcess->runTestJob('<?php\nuse PHPUn...', Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), Object(PHPUnit\Framework\TestResult))
#10 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Framework/TestSuite.php(677): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
#11 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(673): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#12 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/TextUI/Command.php(143): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
#13 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/TextUI/Command.php(96): PHPUnit\TextUI\Command->run(Array, true)
#14 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/phpunit(98): PHPUnit\TextUI\Command::main()
#15 /Users/joachim/Sites/MYPROJECT/vendor/bin/phpunit(120): include('/Users/joachim/...')
#16 {main}
How do I get it to show the relevant information?

Error Magento can't reindex Indexed category/products association

I tried from console and using backoffice to delete all cache. But I have this error. How can I solve it? It started to happen when I tried to delete all categories from a php code made by me.
[root#bravesoul shell]# php -f indexer.php -- -reindex catalog_category_product
Category Products index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''' in /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/bravesoul.es/httpdocs/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DELETE FROM ``', Array)
#5 /var/www/vhosts/bravesoul.es/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('DELETE FROM ``', Array)
#6 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Adapter/Abstract.php(664): Varien_Db_Adapter_Pdo_Mysql->query('DELETE FROM ``')
#7 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(941): Zend_Db_Adapter_Abstract->delete(NULL)
#8 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#9 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Index/Model/Process.php(212): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#11 /var/www/vhosts/bravesoul.es/httpdocs/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#12 /var/www/vhosts/bravesoul.es/httpdocs/shell/indexer.php(216): Mage_Shell_Compiler->run()
#13 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: DELETE FROM ``' in /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/vhosts/bravesoul.es/httpdocs/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DELETE FROM ``', Array)
#4 /var/www/vhosts/bravesoul.es/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('DELETE FROM ``', Array)
#5 /var/www/vhosts/bravesoul.es/httpdocs/lib/Zend/Db/Adapter/Abstract.php(664): Varien_Db_Adapter_Pdo_Mysql->query('DELETE FROM ``')
#6 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(941): Zend_Db_Adapter_Abstract->delete(NULL)
#7 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#8 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Index/Model/Process.php(212): Mage_Index_Model_Indexer_Abstract->reindexAll()
#9 /var/www/vhosts/bravesoul.es/httpdocs/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#10 /var/www/vhosts/bravesoul.es/httpdocs/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#11 /var/www/vhosts/bravesoul.es/httpdocs/shell/indexer.php(216): Mage_Shell_Compiler->run()
#12 {main}
This TRUNCATE TABLES solved the problem:
TRUNCATE TABLE `catalog_category_entity`;
TRUNCATE TABLE `catalog_category_entity_datetime`;
TRUNCATE TABLE `catalog_category_entity_decimal`;
TRUNCATE TABLE `catalog_category_entity_int`;
TRUNCATE TABLE `catalog_category_entity_text`;
TRUNCATE TABLE `catalog_category_entity_varchar`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `catalog_category_product_index`;

phalcon php switches update to insert

For some reason phalcon is replacing my order to an insert instead of an update (I can see that in the logs)
$phql = "UPDATE Vouchers SET user_name = :userName:, used = true WHERE voucher_code = :voucherCode:";
$status = $app->modelsManager->executeQuery($phql, array(
'userName' => $voucherReq->userName,
'voucherCode' => $voucherCode
));
I'm probably missing something overriding an update to an insert... well that's a lot. This is a special model that doesn't follow the common ID pattern (if it helps).
In the logs I can see:
[Mon Oct 13 23:49:49.698965 2014] [:error] [pid 379] [client 82.113.121.157:60949] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "voucher_voucher_code_idx"' in /var/www/api/index.php:41\nStack trace:\n
#0 [internal function]: PDOStatement->execute()\n
#1 [internal function]: Phalcon\\Db\\Adapter\\Pdo->executePrepared(Object(PDOStatement), Array, Array)\n
#2 [internal function]: Phalcon\\Db\\Adapter\\Pdo->execute('INSERT INTO "vo...', Array, Array)\n
#3 [internal function]: Phalcon\\Db\\Adapter->insert('vouchers', Array, Array, Array)\n
#4 [internal function]: Phalcon\\Mvc\\Model->_doLowInsert(Object(Phalcon\\Mvc\\Model\\MetaData\\Memory), Object(Phalcon\\Db\\Adapter\\Pdo\\Postgresql), 'vouchers', false)\n
#5 [internal function]: Phalcon\\Mvc\\Model->save()\n
#6 [internal function]: Phalcon\\Mvc\\Model->update(Array)\n
#7 [internal function]: Phalcon\\Mvc\\Model\\Query->_executeUpdate(Array, Array, NULL)\n
#8 [internal function]: Phalcon\\Mvc\\Model\\Query->execute(Array, NULL)\n
#9 /var/www/api/index.php(41): Phalcon\\Mvc\\Model\\Manager->executeQue in /var/www/api/index.php on line 41
Any thoughts?
I've suffered from similar behavior.
Seems that Phalcon needs the update where clause to be on the primary key in order to update that specific row. I've added id as a primary key and all went OK.
In your case set voucher_code as primary key for that table.
Hope this helps

Schema error for magento-mongodb integration

I have followed the URL git project to connect magento with mongodb. Everything seems to be perfect while integrating.But the problem is when i tried to change any configuration through admin panel(Tried to add a product through admin panel) then its showing some schema error in Cm/Mongo/Model/Indexer/Schema.php file.Can any one suggest me to solve this error.Here are I am posting the error code.
Error:
2014-03-17T09:41:24+00:00 DEBUG (7): Exception message: Notice: Trying to get property of non-object in /var/www/mage2/app/code/community/Cm/Mongo/Model/Indexer/Schema.php on line 45
Trace: #0 /var/www/mage2/app/code/community/Cm/Mongo/Model/Indexer/Schema.php(45): mageCoreErrorHandler(8, 'Trying to get p...', '/var/www/mage2/...', 45, Array)
#1 /var/www/mage2/app/code/community/Cm/Mongo/Model/Indexer.php(116): Cm_Mongo_Model_Indexer_Schema->getEntityIndexers('catalog_product')
#2 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(331): Cm_Mongo_Model_Indexer->matchEntityAndType('catalog_product', 'mass_action')
#3 [internal function]: Mage_Index_Model_Process->indexEvents('catalog_product', 'mass_action')
#4 /var/www/mage2/app/code/core/Mage/Index/Model/Indexer.php(324): call_user_func_array(Array, Array)
#5 /var/www/mage2/app/code/core/Mage/Index/Model/Indexer.php(171): Mage_Index_Model_Indexer->_runAll('indexEvents', Array)
#6 /var/www/mage2/app/code/core/Mage/CatalogInventory/Model/Observer.php(949): Mage_Index_Model_Indexer->indexEvents('catalog_product', 'mass_action')
#7 /var/www/mage2/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogInventory_Model_Observer->reindexProductsMassAction(Object(Varien_Event_Observer))
#8 /var/www/mage2/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogInventory_Model_Observer), 'reindexProducts...', Object(Varien_Event_Observer))
#9 /var/www/mage2/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('after_reindex_p...', Array)
#10 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(224): Mage::dispatchEvent('after_reindex_p...')
#11 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#12 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(249): Mage_Index_Model_Process->reindexEverything()
#13 /var/www/mage2/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(178): Mage_Index_Model_Process->reindexEverything()
#14 /var/www/mage2/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->massReindexAction()
#15 /var/www/mage2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex')

magento: "there was an error processing your order" when trying to place an order with authorize.net

I have recently upgraded my magento system from 1.4.0.1 to 1.7.0.2.
Error
"there was an error processing your order"
I setup the payment methods with no problem, but when I tried using the authorize.net option I get a popup message saying "there was an error processing your order". The order doesn't show in the backend but the payments are processed and I get a confirmation email with my order number.
I checked with authorize.net to see if the payment has passed and the credit card is valid and there seems to be no problem with them and it took out the option that the problem might be because of bad configuration.
Edit:
found this in the log:
2013-06-22T21:45:48+00:00 ERR (3):
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'' in /home/bellater/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/bellater/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/bellater/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/bellater/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/bellater/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/bellater/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO lo...', Array)
\#5 /home/bellater/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTOlo...', Array)
#6 /home/bellater/public_html/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
#7 /home/bellater/public_html/app/code/core/Mage/Log/Model/Resource/Visitor.php(261): Zend_Db_Adapter_Abstract->insert('log_quote', Array)
#8 /home/bellater/public_html/app/code/core/Mage/Log/Model/Resource/Visitor.php(116): Mage_Log_Model_Resource_Visitor->_saveQuoteInfo(Object(Mage_Log_Model_Visitor))
#9 /home/bellater/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(463): Mage_Log_Model_Resource_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
#10 /home/bellater/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
#11 /home/bellater/public_html/app/code/core/Mage/Log/Model/Visitor.php(189): Mage_Core_Model_Abstract->save()
#12 /home/bellater/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Log_Model_Visitor->saveByRequest(Object(Varien_Event_Observer))
#13 /home/bellater/public_html/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 /home/bellater/public_html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#15 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(552): Mage::dispatchEvent('controller_acti...', Array)
#16 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Front/Action.php(75): Mage_Core_Controller_Varien_Action->postDispatch()
#17 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(423): Mage_Core_Controller_Front_Action->postDispatch()
#18 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('add')
#19 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#20 /home/bellater/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#21 /home/bellater/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#22 /home/bellater/public_html/index.php(87): Mage::run('', 'store')
#23 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'' in /home/bellater/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /home/bellater/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/bellater/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/bellater/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/bellater/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO lo...', Array)
\#4 /home/bellater/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTOlo...', Array)
#5 /home/bellater/public_html/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
#6 /home/bellater/public_html/app/code/core/Mage/Log/Model/Resource/Visitor.php(261): Zend_Db_Adapter_Abstract->insert('log_quote', Array)
#7 /home/bellater/public_html/app/code/core/Mage/Log/Model/Resource/Visitor.php(116): Mage_Log_Model_Resource_Visitor->_saveQuoteInfo(Object(Mage_Log_Model_Visitor))
#8 /home/bellater/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(463): Mage_Log_Model_Resource_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
#9 /home/bellater/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
#10 /home/bellater/public_html/app/code/core/Mage/Log/Model/Visitor.php(189): Mage_Core_Model_Abstract->save()
#11 /home/bellater/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Log_Model_Visitor->saveByRequest(Object(Varien_Event_Observer))
#12 /home/bellater/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor), 'saveByRequest', Object(Varien_Event_Observer))
#13 /home/bellater/public_html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#14 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(552): Mage::dispatchEvent('controller_acti...', Array)
#15 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Front/Action.php(75): Mage_Core_Controller_Varien_Action->postDispatch()
#16 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(423): Mage_Core_Controller_Front_Action->postDispatch()
#17 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('add')
#18 /home/bellater/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/bellater/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/bellater/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#21 /home/bellater/public_html/index.php(87): Mage::run('', 'store')
#22 {main}
What could be the problem?
It means there was a Magento or PHP error after the payment API request was sent, but before the order could be created in your Magento system. There's three places in Magento's codebase where that wording is used for an exception.
app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
94: $result['error_msg'] = $this->__('There was an error processing your order. Please contact us or try again later.');
catch (Exception $e) {
Mage::logException($e);
$result['success'] = 0;
$result['error_msg'] = $this->__('There was an error processing your order. Please contact us or try again later.');
}
app/code/core/Mage/Checkout/controllers/OnepageController.php
553: $result['error_messages'] = $this->__('There was an error processing your order. Please contact us or try again later.');
} catch (Exception $e) {
Mage::logException($e);
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
$result['success'] = false;
$result['error'] = true;
$result['error_messages'] = $this->__('There was an error processing your order. Please contact us or try again later.');
}
app/code/core/Mage/Paypal/Model/Api/Nvp.php
987: Mage::throwException(Mage::helper('paypal')->__('There was an error processing your order. Please contact us or try again later.'));
if (!$this->_validateResponse($methodName, $response)) {
Mage::logException(new Exception(
Mage::helper('paypal')->__("PayPal response hasn't required fields.")
));
Mage::throwException(Mage::helper('paypal')->__('There was an error processing your order. Please contact us or try again later.'));
}
As you can see, in each case Magento will log the exception before re-throwing it. This means an error will be logged to your var/log/exception.log (assuming you have logging on). If turning on logging is too much for you, you could add temporary debugging code. Something like
var_dump($e->getMessage());
exit;
in the exception blocks. (Since this isn't PayPal related, I'm guessing that third use of the error message isn't the one you're seeing).
When Magento code catches a non-Magento exception, it typically uses a generic error message to hide (possibly sensitive) PHP system information from end users.

Categories