Search code examples
magentomagento-1.8magmi

Magento Reindex error on "Category Products"


After using MAGMI to import all of my products into my Magento site, the catalog_category_product index is giving the following error when running the indexer.php from the command line. (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 /srv/www/magento1-8/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /srv/www/magento1-8/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /srv/www/magento1-8/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /srv/www/magento1-8/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /srv/www/magento1-8/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /srv/www/magento1-8/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DELETE FROM ``', Array)
#5 /srv/www/magento1-8/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('DELETE FROM ``', Array)
#6 /srv/www/magento1-8/lib/Zend/Db/Adapter/Abstract.php(661): Varien_Db_Adapter_Pdo_Mysql->query('DELETE FROM ``')
#7 /srv/www/magento1-8/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(941): Zend_Db_Adapter_Abstract->delete(NULL)
#8 /srv/www/magento1-8/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#9 /srv/www/magento1-8/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 /srv/www/magento1-8/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll()
#11 /srv/www/magento1-8/shell/indexer.php(166): Mage_Index_Model_Process->reindexEverything()
#12 /srv/www/magento1-8/shell/indexer.php(212): 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 ''' in /srv/www/magento1-8/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /srv/www/magento1-8/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /srv/www/magento1-8/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /srv/www/magento1-8/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /srv/www/magento1-8/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DELETE FROM ``', Array)
#4 /srv/www/magento1-8/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('DELETE FROM ``', Array)
#5 /srv/www/magento1-8/lib/Zend/Db/Adapter/Abstract.php(661): Varien_Db_Adapter_Pdo_Mysql->query('DELETE FROM ``')
#6 /srv/www/magento1-8/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(941): Zend_Db_Adapter_Abstract->delete(NULL)
#7 /srv/www/magento1-8/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#8 /srv/www/magento1-8/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()
#9 /srv/www/magento1-8/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll()
#10 /srv/www/magento1-8/shell/indexer.php(166): Mage_Index_Model_Process->reindexEverything()
#11 /srv/www/magento1-8/shell/indexer.php(212): Mage_Shell_Compiler->run()
#12 {main}

Before inserting this new data into my site, I had used the MAGMI Clear Catalog v1.0.3 Utility to clear the catalog, removed unused attribute_sets and added new attributes and attribute_sets.

Any recommendations on how to troubleshoot this problem would be greatly appreciated.

Thanks


Solution

  • Just import this sql to reset the categories it helps me (v 1.7) http://pastebin.com/iCSH64zb

    if 1.8 has another tables structure, just make a new installation of magento with your version to the new db and export of the following tables: catalog_category_entity catalog_category_entity_datetime catalog_category_entity_decimal catalog_category_entity_int catalog_category_entity_text catalog_category_entity_varchar

    and import it to your DB (make backup before)