错误 Magento 无法重新索引索引类别/产品关联



我尝试了从控制台尝试并使用退回式删除所有缓存。但是我有这个错误。我该如何解决?当我尝试从我制作的PHP代码中删除所有类别时,它开始发生。

[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}

此截断表解决了问题:

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`;

最新更新