1

我在 Magento 中的目录 URL 重写卡在处理中。当我运行 shell/indexer.php 脚本时,出现以下错误

目录 URL 重写索引过程未知错误:异常 'PDOException' 带有消息 'SQLSTATE[23000]:完整性约束违规:1062 重复条目 'sugar-tablets.html-1' for key 2' in /home/healthra/public_html/lib/ Zend/Db/Statement/Pdo.php:228 堆栈跟踪:#0 /home/healthra/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->
execute(Array) #1 /home/ healthra/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo
->_execute(Array) #2 /home/healthra/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Sta
tement->execute(Array) #3 /home/healthra/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db
_Adapter_Abstract->query('UPDATEmg_core...', Array) \#4 /home/healthra/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_
Adapter_Pdo_Abstract->query('UPDATE
mg_core...', Array) #5 /home/healthra/public_html/lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_A
dapter_Pdo_Mysql->query('UPDATE `mg_core...', Array) # 6 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysq l4/Url.php(257): Zend_Db_Adapter_Abstract->update('mg_core_url_rew...', Array, '
url_rewrite_id =...') #7 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/Url.php(363): Mag
e_Catalog_Model_Resource_Eav_Mysql4_Url->saveRewrite(Array, Object(Varien_Object
)) #8 / home/healthra/public_html/app/code/core/Mage/Catalog/Model/Url.php(559): Mag
e_Catalog_Model_Url->_refreshProductRewrite(Object(Varien_Object), Object(Varien
_Object)) #9 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/Url.php(253): Mag
e_Catalog_Model_Url->refreshProductRewrites('1') #10 /home/healthra/public_html/ app/code/core/Mage/Catalog/Model/Url.php(246): Ma
ge_Catalog_Model_Url->refreshRewrites('1') #11 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/ Indexer/Url.php(249): Mage_Catalog_Model_Url->refreshRewrites() #12 /home/healthra/public_html/app/code/core/Mage/Index/Model/Process.php(139): Mage_Catalog_Model_Indexer_Url->reindexAll() # 13 /home/healthra/public_html/app/code/core/Mage/Index/Model/Process.php(167): Mage_Index_Model_Process->reindexAll() #14 /home/healthra/public_html/shell/indexer.php(158) : Mage_Index_Model_Process-
reindexEverything() #15 /home/healthra/public_html/shell/indexer.php(198): Mage_Shell_Compiler->run(
) #16 {main}

有人对如何调试此问题有任何建议吗?

4

1 回答 1

4

看看这里:Magento Puts -1 in My URLs 我可以以编程方式删除吗?也在这里: http: //www.magentocommerce.com/boards/viewthread/9342/

我发现删除 中的所有锁定文件/path/to/mage/var/locks/index_process*.lock,截断core_url_rewrite然后重新索引可以解决问题。

于 2012-08-30T13:09:54.507 回答