【发布时间】:2011-09-13 09:59:58
【问题描述】:
我在 Magento 中的目录 URL 重写卡在处理中。当我运行 shell/indexer.php 脚本时,出现以下错误
目录 URL 重写索引进程未知错误:异常 带有消息“SQLSTATE [23000]”的“PDOException”:完整性约束 违规: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->
执行(数组)#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
临时->执行(数组)#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_mg_core...', Array) #5 /home/healthra/public_html/lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_A
Adapter_Pdo_Abstract->query('UPDATE
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): 麦格
e_Catalog_Model_Resource_Eav_Mysql4_Url->saveRewrite(数组, 对象(变量对象
)) #8 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/Url.php(559): 麦格
e_Catalog_Model_Url->_refreshProductRewrite(Object(Varien_Object), 对象(变量
_Object)) #9 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/Url.php(253): 麦格
e_Catalog_Model_Url->refreshProductRewrites('1') #10 /home/healthra/public_html/app/code/core/Mage/Catalog/Model/Url.php(246): 马
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-
重新索引一切() #15 /home/healthra/public_html/shell/indexer.php(198): Mage_Shell_Compiler->run(
) #16 {主}
有人对如何调试此问题有任何建议吗?
【问题讨论】:
-
这是在多商店安装上吗?尽管 Magento 不允许这样做,但您是否有两个产品条目共享 URL 键“糖片”? Magento 通常在保存时为重复条目分配 -1(下一次迭代为 -2),因为产品的 URLkeys 必须是唯一的。
-
嗨,是的,它是一个多商店安装。如何删除或检查 url 键?
标签: magento magento-1.5