SQLSTATE [42S22]:找不到列:1.9.2升级后1054未知列'e.status'


18

我们刚刚从1.90更新到1.92,并且显示以下错误...

知道如何解决吗?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.status' in 'where clause',
query was:
SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_flat_1` AS `e`
INNER JOIN `catalog_category_product_index` AS `cat_index`
ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.category_id = '301' AND cat_index.is_parent=1
WHERE (e.status = 1)


Trace:
#0 public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT COUNT(DI...', Array)
#4 public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT COUNT(DI...', Array)
#5 public_html/lib/Zend/Db/Adapter/Abstract.php(828): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 public_html/lib/Varien/Data/Collection/Db.php(225): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#7 public_html/app/design/frontend/novaworks/bearstore/template/page/html/home-content.phtml(104): Varien_Data_Collection_Db->getSize()
#8 public_html/app/code/core/Mage/Core/Block/Template.php(241): include('...')
#9 public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/novawo...')
#10 public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#11 public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#12 public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#13 public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('home.content', true)
#14 public_html/app/design/frontend/novaworks/bearstore/template/page/html/header.phtml(117): Mage_Core_Block_Abstract->getChildHtml('home.content')
#15 public_html/app/code/core/Mage/Core/Block/Template.php(241): include('...')
#16 public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/novawo...')
#17 public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#18 public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#19 public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#20 public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#21 public_html/app/design/frontend/novaworks/bearstore/template/page/1column.phtml(65): Mage_Core_Block_Abstract->getChildHtml('header')
#22 public_html/app/code/core/Mage/Core/Block/Template.php(241): include('...')
#23 public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/novawo...')
#24 public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#25 public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#26 public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#27 public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#28 public_html/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#29 public_html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'shop')
#30 public_html/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'shop')
#31 public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#32 public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#33 public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#34 public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#35 public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#36 public_html/index.php(83): Mage::run('', 'store')
#37 {main}

3
您确定更新运行正常吗?好像缺少一列是您的平面表。在升级后,您是否尝试过为整个商店重新编制索引,刷新缓存...等?
朱利安·拉查

我们会收到此错误,但偶尔会出现。我已经尝试过重新索引和重新缓存,它只能暂时解决问题。除了可能通过cron安排之外,还有其他想法吗?如果这样做,性能不会受到影响吗?
sam yi

Answers:


28

看来是重新编制索引的问题。尝试执行以下步骤来重新编制索引:

  1. Magento管理面板
  2. 系统
  3. 索引管理
  4. 全选
  5. 提交(重新索引数据)

如果您无法登录管理控制台,请按照以下步骤操作

...如果您在访问任何页面时都遇到该SQL错误,可能就是这种情况...

要执行以下步骤,您需要能够进入您的托管服务提供商的终端控制台。

  1. SSH到您的虚拟主机提供商
  2. 导航到<magento_root>/shell文件夹

    cd /path/to/magento/installation/folder/shell

  3. 运行索引器以重新生成所有索引(这可能需要一段时间...)

    php -f indexer.php reindexall

  4. 如果您启用了编译功能(您可能不应该启用,但是如果您启用了编译功能),请重新编译:

    php -f compiler.php compile

  5. 清除所有Magento缓存

    php -f cleanCache.php clean all

完成上述所有操作后,您应该已经可以正常安装。您将能够登录到管理控制台,并且上面提到的错误应该消失了。


完善。重新索引,它现在可以正常工作。
迈克尔

Michael,您能够登录到管理控制台并执行以下步骤吗?我不能在我的测试中,当我转载的错误,所以我更新了关于如何在命令行中,我可以重现和确认也解决了这个问题做步骤接受的答案....
布莱恩“BJ” Hoffpauir JR 。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.