0

After migrated a Magento(CE 1.9.1) website from Apache server to Nginx server, i am getting error in frontend: dbModel read resource does not implement Zend_Db_Adapter_Abstract

But admin panel is working fine.

#0 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Varien_Data_Collection_Db->setConnection(false)
#1 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Array)
#2 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('wordpress_resou...', Array)
#3 /var/www/vhosts/example.com/htdocs/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('wordpress/post_...', Array)
#4 /var/www/vhosts/example.com/htdocs/app/design/frontend/bloonaway/default/template/page/home.phtml(197): Mage::getResourceModel('wordpress/post_...')
#5 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#6 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/bloona...')
#7 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#8 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#9 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#10 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#11 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#12 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#13 /var/www/vhosts/example.com/htdocs/app/design/frontend/bloonaway/default/template/page/1column.phtml(116): Mage_Core_Block_Abstract->getChildHtml('content')
#14 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#15 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/bloona...')
#16 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#17 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#18 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#19 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#20 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#21 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#22 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#23 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#24 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#25 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#26 /var/www/vhosts/example.com/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#27 /var/www/vhosts/example.com/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#28 /var/www/vhosts/example.com/htdocs/index.php(91): Mage::run('', 'store')
#29 {main}

I have tried all solutions provided in other similar threads but no luck.

I tried below following to fix this.

  1. Cleared all caches from the var/cache folder.
  2. Deleted all session from var/session folder.
  3. Given 777 file permission recursively to the entire application.
  4. Changed the DB setting in local.xml
  5. I have disabled all local modules also using local.xml <disable_local_modules>true</disable_local_modules>

How to fix this. Thanks.

2 Answers 2

1

I traced this same error to an event dispatcher which lead me to Fishpig_Wordpress_Model_Sitemap_Sitemap. My staging website could not connect to my Wordpress DB which somehow related to this error. I disabled Fishpig in my staging environment which resolved this issue.

In the class I mentioned, Fishpig has this snarky comment:

/**
 * Magento, if you're listening, you should have already added
 * the 2 variables below to this model (and every model!!)
 */

The two variables mentioned are...

protected $_eventPrefix = 'sitemap_sitemap';
protected $_eventObject = 'sitemap';

Removing these two variables will resolve the issue. However, since this works in my production, I restored them and simply disabled the module on staging only via the module configuration.

1
  • That's it. Failing to configure correct DB credentials on Fishpig_Wordpress can lead to "dbModel read resource does not implement Zend_Db_Adapter_Abstract" error. I just configured the correct credentials in admin and it worked. Nov 21, 2018 at 3:18
0

I got the same error when I am trying to upgrade a store.

How I avoid this issue, Backup all 3rd Party extension module XML files (from app/etc/modules) and then remove these files from app/etc/modules.

With this, above error is gone. I installed Magento and then add extensions files back. All things worked as expected.

Hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.