0

I'm trying to load a product since upgrading a sample installation to Magento 1.9.3.4 and facing this error

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_mage1x.catalog_product_entity_catalog_' doesn't exist, query was: SELECT `attr_table`.* FROM `catalog_product_entity_varchar` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_int` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_catalog_` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_text` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_datetime` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_decimal` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) ORDER BY `store_id` ASC

The code I used is

$product = Mage::getModel('catalog/product');
$product->load(877);

I've checked some other databases on other installations that I've never faced an issue and it seems there isn't a table named catalog_product_entity_catalog_ there either.

The product is from the magento sample data enter image description here

I can't find any info regarding this issue online.

Here's the full exception log

2017-07-18T14:04:52+00:00 ERR (3):
exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_mage1x.catalog_product_entity_catalog_' doesn't exist' in /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `attr_ta...', Array)
#5 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `attr_ta...', Array)
#6 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#7 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Eav/Model/Entity/Abstract.php(996): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select))
#8 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Eav/Model/Entity/Abstract.php(959): Mage_Eav_Model_Entity_Abstract->_loadModelAttributes(Object(Mage_Catalog_Model_Product))
#9 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), 877, NULL)
#10 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Product), 877, NULL)
#11 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/community/domain/StockManager/Helper/Data.php(41): Mage_Core_Model_Abstract->load(877)
#12 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/community/domain/StockManager/controllers/LabelController.php(59): domain_StockManager_Helper_Data->getProductsBySku('wbk002c')
#13 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Controller/Varien/Action.php(418): domain_StockManager_LabelController->getProductsBySkuAction()
#14 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('getProductsBySk...')
#15 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#17 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#18 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/index.php(88): Mage::run('', 'store')
#19 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_mage1x.catalog_product_entity_catalog_' doesn't exist, query was: SELECT `attr_table`.* FROM `catalog_product_entity_varchar` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_int` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_catalog_` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_text` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_datetime` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) UNION ALL SELECT `attr_table`.* FROM `catalog_product_entity_decimal` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table` ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '13' WHERE (attr_table.entity_id = '877') AND (attr_table.store_id IN (0, 1)) ORDER BY `store_id` ASC' in /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `attr_ta...', Array)
#4 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `attr_ta...', Array)
#5 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Eav/Model/Entity/Abstract.php(996): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select))
#7 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Eav/Model/Entity/Abstract.php(959): Mage_Eav_Model_Entity_Abstract->_loadModelAttributes(Object(Mage_Catalog_Model_Product))
#8 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), 877, NULL)
#9 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Product), 877, NULL)
#10 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/community/domain/StockManager/Helper/Data.php(41): Mage_Core_Model_Abstract->load(877)
#11 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/community/domain/StockManager/controllers/LabelController.php(59): domain_StockManager_Helper_Data->getProductsBySku('wbk002c')
#12 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Controller/Varien/Action.php(418): domain_StockManager_LabelController->getProductsBySkuAction()
#13 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('getProductsBySk...')
#14 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#16 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /var/www/vhosts/domain.gr/dev.domain.gr/private/magento/1x/default/index.php(88): Mage::run('', 'store')
#18 {main}

I tried disabling all 3rd party modules and still the same adding my code to footer.phtml in rwd theme.

Any idea is appreciated.

0

After hours of busting my head, it ended up being a product attribute that wasn't created or migrated correctly. After deleting it the problem disappeared

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.