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
Related
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?
I've created a BigTable instance in my GC account and when I'm trying to connect to it using Google's library (this is a sample code from Google's docs):
require 'vendor/autoload.php';
use Google\Cloud\Bigtable\BigtableClient;
/** Uncomment and populate these variables in your code */
$project_id = 'my_project_id';
$instance_id = 'table_instance';
$table_id = 'table_name';
// Connect to an existing table with an existing instance.
$dataClient = new BigtableClient([
'projectId' => $project_id,
]);
$table = $dataClient->table($instance_id, $table_id);
$key = 'r1';
// Read a row from my-table using a row key
$row = $table->readRow($key);
$column_family_id = 'cf1';
$column_id = 'c1';
// Get the Value from the Row, using the column_family_id and column_id
$value = $row[$column_family_id][$column_id][0]['value'];
printf("Row key: %s\nData: %s\n", $key, $value);
I'm getting an error:
Fatal error: Uncaught BadMethodCallException: Streaming calls are not supported while using the REST transport. in /srv/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php:119 Stack trace: #0 /srv/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php(63): Google\ApiCore\Transport\RestTransport->throwUnsupportedException() #1 /srv/vendor/google/gax/src/GapicClientTrait.php(479): Google\ApiCore\Transport\RestTransport->startServerStreamingCall(Object(Google\ApiCore\Call), Array) #2 /srv/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(61): Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array) #3 /srv/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(67): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #4 /srv/vendor/google/gax/src/Middleware/RetryMiddleware.php(85): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #5 /srv/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php(64): Google\ApiCore\Middleware\RetryMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #6 /srv/vendor/google/gax/src/GapicClientTrait.php(462): Google\ApiCore\Middleware\OptionsFilterMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #7 /srv/vendor/google/cloud-bigtable/src/V2/Gapic/BigtableGapicClient.php(357): Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient->startCall('ReadRows', 'Google\\Cloud\\Bi...', Array, Object(Google\Cloud\Bigtable\V2\ReadRowsRequest), 3) #8 [internal function]: Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient->readRows('projects/project...', Array) #9 /srv/vendor/google/cloud-core/src/ExponentialBackoff.php(80): call_user_func_array(Array, Array) #10 /srv/vendor/google/cloud-bigtable/src/ResumableStream.php(96): Google\Cloud\Core\ExponentialBackoff->execute(Array, Array) #11 /srv/vendor/google/cloud-bigtable/src/ChunkFormatter.php(168): Google\Cloud\Bigtable\ResumableStream->readAll() #12 [internal function]: Google\Cloud\Bigtable\ChunkFormatter->readAll() #13 /srv/vendor/google/cloud-bigtable/src/Table.php(331): Generator->current() #14 /srv/index.php(24): Google\Cloud\Bigtable\Table->readRow('r1') #15 {main} thrown in /srv/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php on line 119
Any help?
OK, I figured it out.
For those who facing the same problem:
create/add a line into your php.ini file:
extension=grpc.so
php.ini should be in the same directory with app.yaml
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`;
I am upgrading cakephp 1.3 to 2.0
I am getting below error in error log
Error: [MissingTableException] Table aros_acos for model Permission was not found in datasource default.
Exception Attributes: array (
'table' => 'aros_acos',
'class' => 'Permission',
'ds' => 'default',
)
Request URL: /users/show?%2Fusers%2Fshow=
Stack Trace:
#0 /lib/Cake/Model/Model.php(3498): Model->setSource('aros_acos')
#1 /lib/Cake/Model/Datasource/DboSource.php(1063): Model->getDataSource()
#2 /lib/Cake/Model/Model.php(2902): DboSource->read(Object(User), Array)
#3 /lib/Cake/Model/Model.php(2874): Model->_readDataSource('count', Array)
#4 /app/Controller/Component/PaginationComponent.php(212): Model->find('count', 'status!='DL'')
#5 /app/Controller/UsersController.php(108): PaginationComponent->init('status!='DL'')
#6 [internal function]: UsersController->show()
#7 /lib/Cake/Controller/Controller.php(490): ReflectionMethod->invokeArgs(Object(UsersController), Array)
#8 /lib/Cake/Routing/Dispatcher.php(185): Controller->invokeAction(Object(CakeRequest))
#9 /lib/Cake/Routing/Dispatcher.php(160): Dispatcher->_invoke(Object(UsersController), Object(CakeRequest), Object(CakeResponse))
#10 /app/webroot/index.php(108): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
UsersController.php error section
$criteria = "status!='1'";
$this->Pagination->direction = 'ASC';
$this->Pagination->sortBy = 'username';
//********
$this->Pagination->setPageLimit($page_limit);
list($order, $limit, $page) = $this->Pagination->init($criteria); // Added
PaginationComponent.php
$count = $this->controller->{$this->modelClass}->find('count', $criteria);
Please let me know what is going wrong.
Thanks,
Have you even tried to read and understand the error message? Debugging starts by reading (and understanding) error messages if you get some.
[MissingTableException] Table aros_acos for model Permission was not found in datasource default.
That means that the table aros_acos doesn't exist in your database.
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.