完整性约束违规:1452 - Magento Multistore

时间:2013-08-21 17:18:23

标签: magento mysql-error-1064

我有一个magento多商店设置,我在创建/删除商店视图时一定做错了,因为现在我在尝试重新索引catalog_url_rewrite时收到以下错误。任何人都知道我可以尝试的事情吗?

  2013-08-21T16:45:46+00:00 ERR (3): 
    exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`myserver`.`core_url_rewrite`, CONSTRAINT `FK_CORE_URL_REWRITE_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE C)' in /home/myserver/public_html/lib/Zend/Db/Statement/Pdo.php:228
    Stack trace:
    #0 /home/myserver/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
    #1 /home/myserver/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
    #2 /home/myserver/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
    #3 /home/myserver/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
    #4 /home/myserver/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `co...', Array)
    #5 /home/myserver/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `co...', Array)
    #6 /home/myserver/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(1910): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `co...', Array)
    #7 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Resource/Url.php(300): Varien_Db_Adapter_Pdo_Mysql->insertOnDuplicate('core_url_rewrit...', Array)
    #8 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Url.php(293): Mage_Catalog_Model_Resource_Url->saveRewrite(Array, NULL)
    #9 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Url.php(320): Mage_Catalog_Model_Url->_refreshCategoryRewrites(Object(Varien_Object), '/', false)
    #10 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Url.php(461): Mage_Catalog_Model_Url->_refreshCategoryRewrites(Object(Varien_Object), NULL, false)
    #11 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Url.php(254): Mage_Catalog_Model_Url->refreshCategoryRewrite('318', '130', false)
    #12 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Url.php(248): Mage_Catalog_Model_Url->refreshRewrites('130')
    #13 /home/myserver/public_html/app/code/core/Mage/Catalog/Model/Indexer/Url.php(257): Mage_Catalog_Model_Url->refreshRewrites()
    #14 /home/myserver/public_html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Indexer_Url->reindexAll()
    #15 /home/myserver/public_html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
    #16 /home/myserver/public_html/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(178): Mage_Index_Model_Process->reindexEverything()
    #17 /home/myserver/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->massReindexAction()
    #18 /home/myserver/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex')
    #19 /home/myserver/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #20 /home/myserver/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
    #21 /home/myserver/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
    #22 /home/myserver/public_html/index.php(87): Mage::run('', 'store')
    #23 {main}

1 个答案:

答案 0 :(得分:0)

您似乎删除了一些商店ID或商店。

如果'core_store'表中不存在商店ID,则会发生这种情况。