Magento 1.6 - 无法初始化索引器进程

时间:2012-03-31 22:38:45

标签: php mysql magento e-commerce

我在通过管理面板重新索引magento 1.6中的数据时遇到问题。我刚收到一条消息说

Cannot initialize the indexer process

并且产品没有显示在前端的类别中,这显然是该网站的一个大问题。

我已尝试通过shell运行该进程,但它会引发以下错误:

Category Products index process unknown error:
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint  violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`strailco_firstclass`.`catalog_category_product_index`, CONSTRAINT `FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity)' in /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#5 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#6 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(176): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#7 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php(48): Mage_Index_Model_Resource_Abstract->insertFromSelect(Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#8 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(147): Mage_Index_Model_Resource_Helper_Mysql4->insertData(Object(Mage_Catalog_Model_Resource_Category_Indexer_Product), Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#9 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(111): Mage_Index_Model_Resource_Abstract->insertFromTable('catalog_categor...', 'catalog_categor...', false)
#10 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(929): Mage_Index_Model_Resource_Abstract->syncData()
#11 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(132): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#12 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(166): Mage_Index_Model_Indexer_Abstract->reindexAll()
#13 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(194): Mage_Index_Model_Process->reindexAll()
#14 /home/strailco/1stclassholidays.com/html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#15 /home/strailco/1stclassholidays.com/html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#16 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`strailco_firstclass`.`catalog_category_product_index`, CONSTRAINT `FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity)' in /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/strailco/1stclassholidays.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#4 /home/strailco/1stclassholidays.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#5 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(176): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#6 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php(48): Mage_Index_Model_Resource_Abstract->insertFromSelect(Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#7 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(147): Mage_Index_Model_Resource_Helper_Mysql4->insertData(Object(Mage_Catalog_Model_Resource_Category_Indexer_Product), Object(Varien_Db_Select), 'catalog_categor...', Array, false)
#8 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Resource/Abstract.php(111): Mage_Index_Model_Resource_Abstract->insertFromTable('catalog_categor...', 'catalog_categor...', false)
#9 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php(929): Mage_Index_Model_Resource_Abstract->syncData()
#10 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(132): Mage_Catalog_Model_Resource_Category_Indexer_Product->reindexAll()
#11 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(166): Mage_Index_Model_Indexer_Abstract->reindexAll()
#12 /home/strailco/1stclassholidays.com/html/app/code/core/Mage/Index/Model/Process.php(194): Mage_Index_Model_Process->reindexAll()
#13 /home/strailco/1stclassholidays.com/html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#14 /home/strailco/1stclassholidays.com/html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#15 {main}

我尝试删除锁定文件但没有成功。

有没有人知道问题可能是什么,因为我被困住了,需要它尽快解决

非常感谢提前

2 个答案:

答案 0 :(得分:1)

关注this chain信息,您可以找到答案。

答案 1 :(得分:0)

我首先进入magento / var / locks并删除“index_process_1.lock”1-9,然后重新尝试重新索引。