CakePHP 3 having bake troubles with oracle tables - oracle

Every time bake oracle table having bellow issue. Is there any one get any solution.
Exception: Columns used in constraints must be added to the Table schema first. The column "region_id" was not found in table "COUNTRIES". in [C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\Table.php, line 606]
2016-12-03 06:47:03 Error: [Cake\Database\Exception] Columns used in constraints must be added to the Table schema first. The column "region_id" was not found in table "COUNTRIES".
Stack Trace:
#0 C:\xampp\htdocs\production\vendor\cakedc\cakephp-oracle-driver\src\Database\Schema\OracleSchema.php(623): Cake\Database\Schema\Table->addConstraint('COUNTR_REG_FK', Array)
#1 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\Collection.php(134): CakeDC\OracleDriver\Database\Schema\OracleSchema->convertForeignKeyDescription(Object(Cake\Database\Schema\Table), Array)
#2 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\Collection.php(103): Cake\Database\Schema\Collection->_reflect('ForeignKey', 'COUNTRIES', Array, Object(Cake\Database\Schema\Table))
#3 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\CachedCollection.php(63): Cake\Database\Schema\Collection->describe('COUNTRIES', Array)
#4 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\ORM\Table.php(440): Cake\Database\Schema\CachedCollection->describe('COUNTRIES')
#5 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(345): Cake\ORM\Table->schema()
#6 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(221): Bake\Shell\Task\ModelTask->findHasMany(Object(Cake\ORM\Table), Array)
#7 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(127): Bake\Shell\Task\ModelTask->getAssociations(Object(Cake\ORM\Table))
#8 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(110): Bake\Shell\Task\ModelTask->getTableContext(Object(Cake\ORM\Table), 'users', 'Users')
#9 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(97): Bake\Shell\Task\ModelTask->bake('Users')
#10 [internal function]: Bake\Shell\Task\ModelTask->main('users')
#11 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\Shell.php(466): call_user_func_array(Array, Array)
#12 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\Shell.php(459): Cake\Console\Shell->runCommand(Array, false, Array)
#13 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(227): Cake\Console\Shell->runCommand(Array, true, Array)
#14 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(182): Cake\Console\ShellDispatcher->_dispatch(Array)
#15 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(128): Cake\Console\ShellDispatcher->dispatch(Array)
#16 C:\xampp\htdocs\production\bin\cake.php(34): Cake\Console\ShellDispatcher::run(Array)
#17 {main}

Issue has been solved just need to fix the naming convention of "SEQUENCE", cause cakephp support that way. Example below,
If you have a table name "users" your sequnce name will be "seq_users".

Related

Laravel: using count in the where clause throwing error

I am working on a Laravel project. I am trying to write an Eloquent where I need to use raw where clause for COUNT.
This is my query.
$eligibleReceivers = ReceiverDevice::havingRaw('COUNT(phone_number) < 10')
->having('phone_number', '!=', $device->phone_number)
->groupBy('phone_number')->get();
I am trying to select the records where records the same phone_number must be less than 10.
When I run the code, I am getting the following error.
[previous exception] [object] (PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1055 'fork.receiver_devices.id' isn't in GROUP BY at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:331)
[stacktrace]
#0 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): PDO->prepare('select * from `...')
#1 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('select * from `...', Array)
#2 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\\Database\\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#3 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Illuminate\\Database\\Connection->run('select * from `...', Array, Object(Closure))
#4 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2149): Illuminate\\Database\\Connection->select('select * from `...', Array, true)
#5 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2137): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2609): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /var/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2138): Illuminate\\Database\\Query\\Builder->onceWithColumns(Array, Object(Closure))
#8 /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(545): Illuminate\\Database\\Query\\Builder->get(Array)
#9 /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(529): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)
#10 /var/www/app/Http/Requests/RegisterDeviceRequest.php(72): Illuminate\\Database\\Eloquent\\Builder->get()
#11 /var/www/app/Http/Requests/RegisterDeviceRequest.php(60): App\\Http\\Requests\\RegisterDeviceRequest->registerReceiversFor(Object(App\\Models\\ClientDevice))
#12 /var/www/app/Http/Controllers/Auth/RegisterDeviceController.php(14): App\\Http\\Requests\\RegisterDeviceRequest->persist()
#13 [internal function]: App\\Http\\Controllers\\Auth\\RegisterDeviceController->store(Object(App\\Http\\Requests\\RegisterDeviceRequest))
#14 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#15 /var/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('store', Array)
#16 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\Auth\\RegisterDeviceController), 'store')
#17 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#18 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\\Routing\\Route->run()
What is wrong with my code and how can I fix it?
try to do this :-
In config\database.php in mysql array
Set 'strict' => false // to disable all.

Duplicating a Magento site causes SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

I'm trying to do is create a local copy of a Magento site so that I can do some testing to try and resolve an issue which has occurred, it looks like it's a reindexing issue but when we try to reindex on the live site it breaks the whole thing.
I've followed the instructions here Copying a Magento site, but I'm getting an error when I try to view the site. The error I'm getting is:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'1464841' for key 'PRIMARY'
To be honest it's starting to drive me mad, it seemed such a simple thing to do - just copy the files & database & then make some simple config changes.
edited to add full stack trace
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1464842' for key 'PRIMARY'
Trace:
#0 Z:\XAMPP\htdocs\sites\Providore\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ma...', Array)
#4 Z:\XAMPP\htdocs\sites\Providore\lib\Varien\Db\Adapter\Pdo\Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ma...', Array)
#5 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Adapter\Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ma...', Array)
#6 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Log\Model\Resource\Visitor.php(174): Zend_Db_Adapter_Abstract->insert('mage_log_visito...', Array)
#7 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Log\Model\Resource\Visitor.php(108): Mage_Log_Model_Resource_Visitor->_saveVisitorInfo(Object(Fooman_Jirafe_Model_Log_Visitor))
#8 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(463): Mage_Log_Model_Resource_Visitor->_afterSave(Object(Fooman_Jirafe_Model_Log_Visitor))
#9 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Model\Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Fooman_Jirafe_Model_Log_Visitor))
#10 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Log\Model\Visitor.php(167): Mage_Core_Model_Abstract->save()
#11 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Model\App.php(1338): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#12 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Fooman_Jirafe_Model_Log_Visitor), 'initByRequest', Object(Varien_Event_Observer))
#13 Z:\XAMPP\htdocs\sites\Providore\app\Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#14 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
#15 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Front\Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
#16 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Action.php(408): Mage_Core_Controller_Front_Action->preDispatch()
#17 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#18 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 Z:\XAMPP\htdocs\sites\Providore\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#21 Z:\XAMPP\htdocs\sites\Providore\index.php(90): Mage::run('', 'store')
#22 {main}
Seems an error with the log tables. You have mage_ as prefix for all Magento tables, don't you? Try running this SQL statements in your magento database (backup your database first):
SET foreign_key_checks = 0;
TRUNCATE mage_log_customer;
TRUNCATE mage_log_quote;
TRUNCATE mage_log_summary;
TRUNCATE mage_log_url;
TRUNCATE mage_log_url_info;
TRUNCATE mage_log_visitor;
TRUNCATE mage_log_visitor_info;
TRUNCATE mage_log_visitor_online;
SET foreign_key_checks = 1;

Magento reindexing issue

We are using magento enterprise version. Sometimes products are missing and they are coming back during reindexing. Can you tell us what might caused disappearing products?
This happen twice a week or so.
Also when we reindexing, we are getting following error, and we need to reindex again. Please let us know how we can fix reindexing error?
Catalog product price index process unknown error:
exception 'PDOException' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `catalog...', Array)
#5 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `catalog...', Array)
#6 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php(88): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `catalog...')
#7 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php(80): Mage_CatalogRule_Model_Resource_Rule_Product_Price->applyPriceRuleT oIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id', Array, 'wd.website_date')
#8 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Observer.php(254): Mage_CatalogRule_Model_Rule_Product_Price->applyPriceRuleToIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id', Array, 'wd.website_date')
#9 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogRule_Model_Observer->prepareCatalogProductPriceIndexTable(Object(Varien_Event_Observer))
#10 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogRule_Model_Observer), 'prepareCatalogP...', Object(Varien_Event_Observer))
#11 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('prepare_catalog...', Array)
#12 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(304): Mage::dispatchEvent('prepare_catalog...', Array)
#13 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(120): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->_prepareFinalPriceData()
#14 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(75): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->reindexAll()
#15 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(49): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->_reindexAll()
#16 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->execute()
#17 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Price.php(129): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#18 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Price->processShellProductReindexEvent(Object(Varien_Event_Observer))
#19 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Price), 'processShellPro...', Object(Varien_Event_Observer))
#20 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#21 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_product...')
#22 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#23 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `catalog...', Array)
#4 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `catalog...', Array)
#5 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php(88): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `catalog...')
#6 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php(80): Mage_CatalogRule_Model_Resource_Rule_Product_Price->applyPriceRuleToIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id', Array, 'wd.website_date')
#7 /var/www/mysite/public_html/app/code/core/Mage/CatalogRule/Model/Observer.php(254): Mage_CatalogRule_Model_Rule_Product_Price->applyPriceRuleToIndexTable(Object(Varien_Db_Select), Array, 'i.entity_id', 'i.customer_grou...', 'i.website_id',Array, 'wd.website_date')
#8 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogRule_Model_Observer->prepareCatalogProductPriceIndexTable(Object(Varien_Event_Observer))
#9 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogRule_Model_Observer), 'prepareCatalogP...', Object(Varien_Event_Observer))
#10 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('prepare_catalog...', Array)
#11 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(304): Mage::dispatchEvent('prepare_catalog...', Array)
#12 /var/www/mysite/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php(120): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->_prepareFinalPriceData()
#13 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(75): Mage_Catalog_Model_Resource_Product_Indexer_Price_Default->reindexAll()
#14 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Price/Refresh.php(49): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->_reindexAll()
#15 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->execute()
#16 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Price.php(129): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#17 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Price->processShellProductReindexEvent(Object(Varien_Event_Observer))
#18 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Price), 'processShellPro...', Object(Varien_Event_Observer))
#19 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#20 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_product...')
#21 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#22 {main}
Next exception 'Enterprise_Index_Model_Action_Exception' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' in /var/www/mysite/public_html/app/code/core/Enterprise/Cat
alog/Model/Index/Action/Product/Price/Refresh.php:54
Stack trace:
#0 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109) : Enterprise_Catalog_Model_Index_Action_Product_Price_Refresh->execute()
#1 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Price.php(129): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#2 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Price->processShellProductReindexEvent(Object(Varien_Event_Observer))
#3 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Price), 'processShellPro...', Object(Varien_Event_Observer))
#4 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#5 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_product...')
#6 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#7 {main}
Category URL Rewrites index was rebuilt successfully
Product URL Rewrites index was rebuilt successfully
URL Redirects index was rebuilt successfully
Catalog Category/Product Index index process unknown error:exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.catalog_category_product_index_tmp' doesn't exist' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT IGNORE I...', Array)
#5 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT IGNORE I...', Array)
#6 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(747): Varien_Db_Adapter_Pdo_Mysql->query('INSERT IGNORE I...')
#7 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(396): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindexAnchorCategories(Object(Mana_Seo_Rewrite_Store))
#8 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(170): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindex()
#9 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#10 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(158): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#11 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processShellCategoryProductReindexEvent(Object(Varien_Event_Observer))
#12 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processShellCat...', Object(Varien_Event_Observer))
#13 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#14 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_categor...')
#15 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#16 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Basetable or view not found: 1146 Table 'mysite.catalog_category_product_index_tmp' doesn't exist' in /var/www/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /var/www/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /var/www/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT IGNORE I...', Array)
#4 /var/www/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT IGNORE I...', Array)
#5 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(747): Varien_Db_Adapter_Pdo_Mysql->query('INSERT IGNORE I...')
#6 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(396): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindexAnchorCategories(Object(Mana_Seo_Rewrite_Store))
#7 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php(170): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->_reindex()
#8 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#9 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(158): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#10 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processShellCategoryProductReindexEvent(Object(Varien_Event_Observer))
#11 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processShellCat...', Object(Varien_Event_Observer))
#12 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#13 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_categor...')
#14 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#15 {main}
Next exception 'Enterprise_Index_Model_Action_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.catalog_category_product_index_tmp' doesn't exist' in /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php:175
Stack trace:
#0 /var/www/mysite/public_html/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#1 /var/www/mysite/public_html/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(158): Enterprise_Mview_Model_Client->execute('enterprise_cata...')
#2 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processShellCategoryProductReindexEvent(Object(Varien_Event_Observer))
#3 /var/www/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processShellCat...', Object(Varien_Event_Observer))
#4 /var/www/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#5 /var/www/mysite/public_html/shell/indexer.php(167): Mage::dispatchEvent('catalog_categor...')
#6 /var/www/mysite/public_html/shell/indexer.php(212): Mage_Shell_Compiler->run()
#7 {main}
Catalog Search Index index was rebuilt successfully
Product Attributes index was rebuilt successfully
SEO URL Rewrites (MANAdev) index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully
SEO Schemas (MANAdev) index was rebuilt successfully
Default Values (MANAdev) index was rebuilt successfully
One thing is to set your indexer to run manually previous to reindexing to be sure that an edit in the backend is not putting a lock that can be released and then blocks the indexation process. You neet to set back indexer to their running state afterward.
Need further details :
1. Which Magento enterprise version(Looks like partial indexing is running)?.
Are there any additional scripts developed that are not in sync with other Magento cron script.
Do these issues exist even if you flush Cache and Full Page cache
Where are tmp tables created with your Magento setup.
Look at this :
exception : Base table or view not found: 1146 Table 'mysite.catalog_category_pro
duct_index_tmp' doesn't exist' in /var/www/mysite/public_html/app/code/core/Enterpr
ise/Catalog/Model/Index/Action/Catalog/Category/Product/Refresh.php:175
So make sure there is no resource constraint and priviledges are in place for tmp table creation.
I think the solution is much simpler. As you can see a deadlock is occuring. I think this is a performance issue, do you use a dedicated database server? If yes or not, what hardware does your server use? Additionally, How often do you reindex?

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customgrid_grid_role' doesn't exist

I've been successfully using the Enhanced Admin Grids for magento extension for a quite a while so when I found out that editing the quantity is now supported in the latest version I automatically tried upgrading to 0.8.9 However I keep getting this error when attempting to go into the catalog:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'buyahood_shopithoodies.customgrid_grid_role' doesn't exist
Trace:
#0 /home/buyahood/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/buyahood/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/buyahood/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/buyahood/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT customg...', Array)
#4 /home/buyahood/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SELECTcustomg...', Array)
#5 /home/buyahood/public_html/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/buyahood/public_html/app/code/community/BL/CustomGrid/Model/Mysql4/Grid.php(153): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select))
#7 /home/buyahood/public_html/app/code/community/BL/CustomGrid/Model/Grid.php(2254): BL_CustomGrid_Model_Mysql4_Grid->getGridRoles('1')
#8 /home/buyahood/public_html/app/code/community/BL/CustomGrid/Model/Grid.php(217): BL_CustomGrid_Model_Grid->loadRolesConfig()
#9 /home/buyahood/public_html/app/code/community/BL/CustomGrid/Model/Grid.php(223): BL_CustomGrid_Model_Grid->_refreshConfig()
#10 /home/buyahood/public_html/app/code/core/Mage/Core/Model/Abstract.php(281): BL_CustomGrid_Model_Grid->_afterLoad()
#11 /home/buyahood/public_html/lib/Varien/Data/Collection.php(454): Mage_Core_Model_Abstract->afterLoad()
#12 /home/buyahood/public_html/app/code/community/BL/CustomGrid/Model/Mysql4/Grid/Collection.php(27): Varien_Data_Collection->walk(Array, Array)
#13 /home/buyahood/public_html/lib/Varien/Data/Collection/Db.php(536): BL_CustomGrid_Model_Mysql4_Grid_Collection->_afterLoad('afterLoad')
#14 /home/buyahood/public_html/app/code/community/BL/CustomGrid/Model/Observer.php(734): Varien_Data_Collection_Db->load()
#15 /home/buyahood/public_html/app/code/core/Mage/Core/Model/App.php(1303): BL_CustomGrid_Model_Observer->onControllerActionPreDispatch()
#16 /home/buyahood/public_html/app/code/core/Mage/Core/Model/App.php(1284): Mage_Core_Model_App->_callObserverMethod(Object(Varien_Event_Observer))
#17 /home/buyahood/public_html/app/Mage.php(416): Mage_Core_Model_App->dispatchEvent(Object(BL_CustomGrid_Model_Observer), 'onControllerAct...', Object(Varien_Event_Observer))
#18 /home/buyahood/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(505): Mage::dispatchEvent('controller_acti...', Array)
#19 /home/buyahood/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(152): Mage_Core_Controller_Varien_Action->preDispatch('controller_acti...', Array)
#20 /home/buyahood/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(409): Mage_Adminhtml_Controller_Action->preDispatch()
#21 /home/buyahood/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch()
#22 /home/buyahood/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match('index')
#23 /home/buyahood/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch(Object(Mage_Core_Controller_Request_Http))
#24 /home/buyahood/public_html/app/Mage.php(640): Mage_Core_Model_App->run()
#25 /home/buyahood/public_html/index.php(82): Mage::run(Array)
#26 {main}
Please Advise.
This table should have been created during upgrade. Looks like the upgrade script didn't run. To trigger it again, edit the core_resource table. Search for a row with customgrid_setup and reset the version number to your version before your upgrade. After that, flush magento cache in backend. On the next page call the installer will be rerun.

Wrong store ID generates errors in Magento backend

When going to System>Config.>Developer I get this stack, which seems to have something to do with store id 4. I once had a store with Id 4, but it's deleted and I only have store id 1 now. I cannot figure out what is calling this store id4, only that it is called since " Mage_Core_Model_Url->setStore('4')" is in th stack. How can I tell, what extension, module or part of Magento that is calling this?
#0 /var/www/site.com/public_html/app/code/local/Mage/Core/Model/App.php(831): Mage_Core_Model_App->throwStoreException()
#1 /var/www/site.com/public_html/app/code/core/Mage/Core/Model/Url.php(342): Mage_Core_Model_App->getStore('4')
#2 /var/www/site.com/public_html/app/code/core/Mage/Core/Model/Url.php(616): Mage_Core_Model_Url->setStore('4')
#3 /var/www/site.com/public_html/app/code/core/Mage/Core/Model/Url.php(734): Mage_Core_Model_Url->setRouteParams(Array, false)
#4 /var/www/site.com/public_html/app/code/core/Mage/Core/Model/Url.php(977): Mage_Core_Model_Url->getRouteUrl('', Array)
#5 /var/www/site.com/public_html/app/Mage.php(362): Mage_Core_Model_Url->getUrl('', Array)
#6 /var/www/site.com/public_html/app/code/local/Magentohotel/Varnish/Model/Adminhtml/Renderer/Bans/Categories.php(31): Mage::getUrl('', Array)
#7 /var/www/site.com/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(421): Magentohotel_Varnish_Model_Adminhtml_Renderer_Bans_Categories->toOptionArray(true)
#8 /var/www/site.com/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(210): Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#9 /var/www/site.com/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php(92): Mage_Adminhtml_Block_System_Config_Form->initForm()
#10 /var/www/site.com/public_html/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php(102): Mage_Adminhtml_Block_System_Config_Edit->initForm()
#11 /var/www/site.com/public_html/app/code/local/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_System_ConfigController->editAction()
#12 /var/www/site.com/public_html/var/cache/extendware/ewcore/overrides/Mage/Core/Controller/Varien/Router/Standard/63563f9ebb198e3182fd11a84369b608.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#13 /var/www/site.com/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_StandardOverriddenClass->match(Object(Mage_Core_Controller_Request_Http))
#14 /var/www/site.com/public_html/app/code/local/Mage/Core/Model/App.php(348): Mage_Core_Controller_Varien_Front->dispatch()
#15 /var/www/site.com/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#16 /var/www/site.com/public_html/index.php(83): Mage::run('', 'store') #17 {main}"
Old URL Rewrites fom another storefront was still in the database, this created errors with a varnish module that could see the URL rewrites but not the storefront with the same ID.

Resources