duanqiang5722 2013-08-09 15:53
浏览 67

Magento重新索引错误产品平面数据

I know everyone thinks this is the same question that's been posted before but I have tried the other answers

Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation:         1452 Cannot add or update a child row: a f     oreign key constraint fails (`Riders`.    <result 2 when explaining filename '#sql-634_21fc81'>, CONSTRAINT    `FK_CAT_PRD_FLAT_1_ENTT_ID     _CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`enti)' in /home/.sites/143/site2/web/lib/Ze         nd/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/.sites/143/site2/web/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement- >execute(Array)
#1 /home/.sites/143/site2/web/lib/Varien/Db/Statement/Pdo/Mysql.php(110):  Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/.sites/143/site2/web/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/.sites/143/site2/web/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/.sites/143/site2/web/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Arr     ay)
#5 /home/.sites/143/site2/web/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...',      Array)
#6 /home/.sites/143/site2/web/lib/Varien/Db/Adapter/Pdo/Mysql.php(340): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#7 /home/.sites/143/site2/web/lib/Varien/Db/Adapter/Pdo/Mysql.php(2569): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ca..     .')
#8 /home/.sites/143/site2/web/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.p    hp(816): Varien_Db_Adapter_Pdo_Mysql     ->addForeignKey('FK_CAT_PRD_FLAT...',   'catalog_product...', 'entity_id', 'catalog_product...', 'entity_id', 'CASCADE', 'CASCADE')
#9 /home/.sites/143/site2/web/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.p    hp(1390): Mage_Catalog_Model_Resourc     e_Product_Flat_Indexer->prepareFlatTable(1)
#10  /home/.sites/143/site2/web/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296):    Mage_Catalog_Model_Resource_Product     _Flat_Indexer->reindexAll()
#11 /home/.sites/143/site2/web/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(336):  Mage_Catalog_Model_Product_Flat_Ind     exer->reindexAll()
#12 /home/.sites/143/site2/web/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Product_Indexer_Flat->reindexAl     l()
#13 /home/.sites/143/site2/web/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#14 /home/.sites/143/site2/web/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#15 /home/.sites/143/site2/web/shell/indexer.php(198): Mage_Shell_Compiler->run()
#16 {main}

I removed all rows that existed in catalog product entity but not in catalog category product. I ran the database repair tool as well. It says that my database is not corrupted. I also tried truncating the table. None of those has resolved the problem.

At the moment my catalog_product_flat table is empty.

I'm not sure what else to try but I really need to correct this error to move on to the next part of my project. I'd be more than happy to start from scratch but this is a live site with live products and orders going on.

Any advice or help would be extremely appreciated.

  • 写回答

2条回答 默认 最新

  • dougu2036 2013-08-09 20:16
    关注
    1. Truncate:

      • catalog_product_flat_1
      • catalog_product_flat_2
      • catalog_product_flat_3
      • catalog_product_flat_cl
    2. Reindex manually: php /yoursite/shell/indexer.php --reindexall

    Greetings.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。