Magento类别平面数据不会重新索引错误'重建索引过程出现问题。'

时间:2011-09-26 14:25:25

标签: php mysql zend-framework magento

我最近将版本1.5.0.1的magento安装移动到了实时服务器,但前端没有显示任何产品。在检查索引之后,我看到类别平面数据索引需要重新索引,但是当尝试重新索引时,我得到一个错误通知框,说“重建索引过程有问题。”

到目前为止,我已尝试过以下

  1. 重置文件夹的文件权限755,文件的文件664

    找到。 -type f -exec chmod 644 {} \;

    找到。 -type d -exec chmod 755 {} \;

  2. 删除var文件夹的内容,包括缓存和锁定文件夹

  3. 尝试使用public_html / shell中的以下命令通过控制台手动处理索引

      

    php indexer.php reindexall

  4. 我检查了错误日志,并且存在以下内容

    2011-09-26T08:16:11+00:00 DEBUG (7): Exception message: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
    `store_id` smallint(5) unsigned not null default '0',
    `all_children` text defau' at line 10
    Trace: #0 /home/bboutique/www.bassboutique.co.uk/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
    #1 /home/bboutique/www.bassboutique.co.uk/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
    #2 /home/bboutique/www.bassboutique.co.uk/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
    #3 /home/bboutique/www.bassboutique.co.uk/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
    #4 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php(526): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
    #5 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php(433): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Flat->_createTable('1')
    #6 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php(237): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Flat->rebuild()
    #7 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Index/Model/Process.php(139): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
    #8 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Index/Model/Process.php(167): Mage_Index_Model_Process->reindexAll()
    #9 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
    #10 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
    #11 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
    #12 /home/bboutique/www.bassboutique.co.uk/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))
    #13 /home/bboutique/www.bassboutique.co.uk/public_html/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
    #14 /home/bboutique/www.bassboutique.co.uk/public_html/app/Mage.php(627): Mage_Core_Model_App->run(Array)
    #15 /home/bboutique/www.bassboutique.co.uk/public_html/index.php(80): Mage::run('', 'store')
    #16 {main}
    

    非常感谢任何帮助

    由于

    伊恩

1 个答案:

答案 0 :(得分:0)

我在将Magento的样本数据加载到Magento 1.5.1.0时遇到了同样的错误(尽管Varien说,他们的样本数据不能与所有Magento版本一起工作)

在/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Flat.php我在第549行找到了这个:

switch ($column['DATA_TYPE']) {
                case 'smallint':
                case 'int':
                    $_type = $column['DATA_TYPE'] . '(11)';
                    $_is_unsigned = (bool)$column['UNSIGNED'];
                    if ($column['DEFAULT'] === '') {
                        $column['DEFAULT'] = null;
                    }
                    break;
                case 'varchar':.........................

没有'timestamp'的案例陈述; Magento在Magento 1.6.1.0中使用的'updated_at'和'created_at'列中使用的数据类型

我做了一些alter table语句,将catalog_category_entity和catalog_product_entity中的'timestamp'列更改为'datetime',索引问题就消失了。

我现在已经对示例数据中的所有'timestamp'列进行了查找和替换,以使其与1.5.1.0兼容

我希望这有助于某人:)

相关问题