重新索引扁平产品数据时出错

发布于 2024-11-01 21:51:31 字数 2545 浏览 0 评论 0原文

我收到此错误“重新索引过程出现问题。”在 Magento 中,当我尝试在产品平面数据中重新索引数据时。 我使用 Magento 1.4.1.1,数据库中有超过 50 000 个项目。

有办法解决这个问题吗?

以下是我在Exception.log中发现的错误:

2011-04-14T19:24:05+00:00 DEBUG (7): Exception message: SQLSTATE[HY000]: General error: 1005 Can't create table 'magentonou.catalog_product_flat_3' (errno: 150)
Trace: #0 E:\Wamp\www\includes\src\__default.php(48621): Zend_Db_Statement_Pdo->_execute(Array)
#1 E:\Wamp\www\includes\src\__default.php(40291): Zend_Db_Statement->execute(Array)
#2 E:\Wamp\www\includes\src\__default.php(41312): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#3 E:\Wamp\www\includes\src\__default.php(42062): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#4 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(544): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#5 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(122): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->prepareFlatTable('3')
#6 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(115): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild('3')
#7 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Flat_Indexer.php(64): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild(NULL)
#8 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Indexer_Flat.php(301): Mage_Catalog_Model_Product_Flat_Indexer->rebuild()
#9 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(139): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#10 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(167): Mage_Index_Model_Process->reindexAll()
#11 E:\Wamp\www\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#12 E:\Wamp\www\includes\src\__default.php(11748): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 E:\Wamp\www\includes\src\__default.php(15669): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 E:\Wamp\www\includes\src\__default.php(15271): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 E:\Wamp\www\includes\src\__default.php(17470): Mage_Core_Controller_Varien_Front->dispatch()
#16 E:\Wamp\www\app\Mage.php(596): Mage_Core_Model_App->run(Array)
#17 E:\Wamp\www\index.php(80): Mage::run('', 'store')
#18 {main}

I receive this error "There was a problem with reindexing process." in Magento when I try to Reindex Data at Product Flat Data.
I use Magento 1.4.1.1, and I have over 50 000 itemes in database.

Is a way to fix this?

Here are the errors what I find in exception.log:

2011-04-14T19:24:05+00:00 DEBUG (7): Exception message: SQLSTATE[HY000]: General error: 1005 Can't create table 'magentonou.catalog_product_flat_3' (errno: 150)
Trace: #0 E:\Wamp\www\includes\src\__default.php(48621): Zend_Db_Statement_Pdo->_execute(Array)
#1 E:\Wamp\www\includes\src\__default.php(40291): Zend_Db_Statement->execute(Array)
#2 E:\Wamp\www\includes\src\__default.php(41312): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#3 E:\Wamp\www\includes\src\__default.php(42062): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#4 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(544): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#5 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(122): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->prepareFlatTable('3')
#6 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(115): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild('3')
#7 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Flat_Indexer.php(64): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild(NULL)
#8 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Indexer_Flat.php(301): Mage_Catalog_Model_Product_Flat_Indexer->rebuild()
#9 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(139): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#10 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(167): Mage_Index_Model_Process->reindexAll()
#11 E:\Wamp\www\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#12 E:\Wamp\www\includes\src\__default.php(11748): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 E:\Wamp\www\includes\src\__default.php(15669): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 E:\Wamp\www\includes\src\__default.php(15271): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 E:\Wamp\www\includes\src\__default.php(17470): Mage_Core_Controller_Varien_Front->dispatch()
#16 E:\Wamp\www\app\Mage.php(596): Mage_Core_Model_App->run(Array)
#17 E:\Wamp\www\index.php(80): Mage::run('', 'store')
#18 {main}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖树树初阳… 2024-11-08 21:51:31

我记得有一个数据库修复工具可以从 Varien 下载。

是的,检查过。它仍然存在:链接

我大约一年前在 Magento 1.3.x 中使用了该工具,并且能够修复数据库成功。

但我不知道它是否可以用于 1.4.x。不幸的是,他们没有说明该工具可以用于哪些版本。也许源代码中有说明。

编辑:

如果MySQL报告错误号1005
来自 CREATE TABLE 语句,以及
错误消息指的是错误150,
表创建失败,因为
外键约束不是
正确形成。同样,如果一个
ALTER TABLE 失败,它指的是
错误150,表示外键
定义的形式将不正确
对于更改后的表。您可以使用
SHOW ENGINE INNODB STATUS 显示
最详细的解释
最近的 InnoDB 外键错误
服务器。

来源: dev.mysql.com

I remember a database repair tool you could download from Varien.

Yeah, checked it. It still exists: Link

I used that tool about a year ago with Magento 1.3.x and was able to repair a database with it successfully.

I do not know, if it can be used for 1.4.x, though. They unfortunately do not state for which versions the tool can be used. Maybe it's stated in the source code.

EDIT:

If MySQL reports an error number 1005
from a CREATE TABLE statement, and the
error message refers to error 150,
table creation failed because a
foreign key constraint was not
correctly formed. Similarly, if an
ALTER TABLE fails and it refers to
error 150, that means a foreign key
definition would be incorrectly formed
for the altered table. You can use
SHOW ENGINE INNODB STATUS to display a
detailed explanation of the most
recent InnoDB foreign key error in the
server.

Source: dev.mysql.com

别低头,皇冠会掉 2024-11-08 21:51:31

解决方案

查看catalog_eav_attribute 和eav_attribute 表。对于设置为 1 的所有用户定义字段,将used_in_product_listing 字段更新为 0。在运行此命令之前,请使用 SELECT 子句并查看其提取哪些字段。另外,先在测试环境上运行!!

update `catalog_eav_attribute` as cea left join eav_attribute as ea on cea.attribute_id = ea.attribute_id set cea.used_in_product_listing = 0 where cea.used_in_product_listing = 1 and is_user_defined = 1

...并且已修复!

Solution

Take a look at the catalog_eav_attribute and eav_attribute tables. Update the used_in_product_listing field to 0 for all user defined fields that are set to 1. Before running this, use a SELECT clause and see what fields its pulling out. Also, run on a test environment first!!

update `catalog_eav_attribute` as cea left join eav_attribute as ea on cea.attribute_id = ea.attribute_id set cea.used_in_product_listing = 0 where cea.used_in_product_listing = 1 and is_user_defined = 1

…and Fixed!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文