1

In a cron job, I have to save a list of categories and sub-categories. But I am constantly getting this error

  SQLSTATE[42S02]: Base table or view not found: 1146 Table          '{database_name}.catalog_category_product_cat_tmp' doesn't exist

Trace:
#0 /var/www/app/code/core/Enterprise/Catalog/Model/Index/Action/Catalog/Category/Product/Category/Refresh/Row.php(76): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh->execute()
#1 /var/www/app/code/core/Enterprise/Mview/Model/Client.php(109): Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Category_Refresh_Row->execute()
#2 /var/www/app/code/core/Enterprise/Catalog/Model/Index/Observer/Category/Product.php(144): Enterprise_Mview_Model_Client->execute('enterprise_cata...', Array)
#3 /var/www/app/code/core/Mage/Core/Model/App.php(1338): Enterprise_Catalog_Model_Index_Observer_Category_Product->processCategorySaveEvent(Object(Varien_Event_Observer))
#4 /var/www/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_Catalog_Model_Index_Observer_Category_Product), 'processCategory...', Object(Varien_Event_Observer))
#5 /var/www/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('catalog_categor...', Array)
#6 /var/www/app/code/core/Mage/Core/Model/Abstract.php(344): Mage::dispatchEvent('catalog_categor...', Array)
#7 [internal function]: Mage_Core_Model_Abstract->afterCommitCallback()
#8 /var/www/app/code/core/Mage/Core/Model/Resource/Abstract.php(110): call_user_func(Array)
#9 /var/www/app/code/core/Mage/Core/Model/Abstract.php(322): Mage_Core_Model_Resource_Abstract->commit()
#10 /var/www/app/code/local/Rts/Cronjobs/Model/Cronjobsfiles/custom/brands/brands.php(120): Mage_Core_Model_Abstract->save()
#11 /var/www/app/code/local/Rts/Cronjobs/Model/Cronjobs.php(60): include('/var/www/app/co...')
#12 [internal function]: Rts_Cronjobs_Model_Cronjobs->brands(Object(Aoe_Scheduler_Model_Schedule))
#13 /var/www/app/code/community/Aoe/Scheduler/Model/Schedule.php(61): call_user_func_array(Array, Array)
#14 /var/www/app/code/community/Aoe/Scheduler/controllers/Adminhtml/CronController.php(89): Aoe_Scheduler_Model_Schedule->runNow(false)
#15 /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Aoe_Scheduler_Adminhtml_CronController->runNowAction()
#16 /var/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('runNow')
#17 /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /var/www/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 /var/www/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#20 /var/www/index.php(87): Mage::run('base', 'website')
#21 {main}

This issues arises on

$category->save()

statement.

Please help.

1
  • 1
    {database_name} - this should have been expanded to a real database name. – Evgeni Ivanov Apr 11 '14 at 12:52
2

If you [Step 1] updated, created product data and then proceed to [Step 2] modify category relationships with the data in [Step 1].. you need to re-index product information between those 2 steps. I just ran across this problem and this was my solution.

1
  • I ran across this problem again and my self of past helped me! – JustinP Apr 30 '14 at 16:57
0

Looks like you are running a 1.13 install, right? How are your indexers configured? On save or on schedule? You can check it under System > Configuration > Advanced > Index Management > Index Options.

Is it possible that some scripts are running at the same time? I've noticed that when the indexers are set to 'on save' it gives problems when multiple categories are adjusted at the same time.

Magento pointed out that it's a best practice to run the indexers 'on schedule'. 1.13 has a whole new (change log) indexer mechanism for this, which executes every time your cronjob runs.

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.