Home » Magento

Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website

17 August 2010 Share/Bookmark

Problem:

I was transfering Magento files and database from one server to another. I did complete all the transfer process of files and also exported and imported the database. After that, when I tried to access the site, I got the following error:-

Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in /path/app/code/core/Mage/Core/Model/App.php on line 427 and defined in /path/app/code/core/Mage/Core/Model/Store.php on line 279

Solution:

It’s very simple. Although I had to search for sometime for the solution. :)

Delete the following file:-

app/etc/use_cache.ser

That’s it. You are done. Now, you can access your site.

After doing this, you might get the next error which says:-

Notice: Undefined index: 0 in /srv/www/vhosts/javra.com/htdocs/munchad2/app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92

If you get this error then please have a look at the solution for this error over here:-

http://blog.chapagain.com.np/magento-error-%E2%80%93-notice-undefined-index-0-appcodecoremagecoremodelmysql4config-php-on-line-92/

Hope this helps. Thanks.

From Mukesh Chapagain's Blog, post Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website

email

php magento mukesh chapagain

Get New Post by Email
RSS Feed Subscribe RSS Feed
  • Pingback: Magento Templates And Magento Extensions Can Work Wonders For Online Stores :Blueprints To Profits

  • Sarath Tomy

    Magento redirect to old url after clearing the cache, add/edit/store, System>Configuration>Web . Then click save.Then also It redirects to old url. I checked the database, clear the var/ cache etc.. Now also.. Please help..

  • http://www.facebook.com/sijuas Siju Sundaresan

    Hi Mukesh,

    I have the same problem, website front end is working fine, only the admin back end is showing error.

    The error message I am getting is –

    2012-04-18T12:11:24+00:00 ERR (3):
    Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in D:wampwwwsitenameappcodecoreMageCoreModelApp.php on line 628 and defined  in D:wampwwwsitenameappcodecoreMageCoreModelStore.php on line 390

    2012-04-18T12:11:24+00:00 ERR (3):
    Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in D:wampwwwsitenameappcodecoreMageCoreModelApp.php on line 648 and defined  in D:wampwwwsitenameappcodecoreMageCoreModelStoreGroup.php on line 235

    But there is no “use_cache.ser” file in my app/etc/ folder.

    How to fix this, Please help.

    Thanks,
    Siju

  • http://blog.chapagain.com.np/ Mukesh
  • http://www.facebook.com/sijuas Siju Sundaresan

     Thank you very much Mukesh, you have saved my life!!  The issue has been solved.

    you are great.. :)

    Thanks,
    Siju

  • xingze ma

    oh,Thx. Your blog help me solve the issue. Mukesh , You are so great!