Home » Magento17 August 2010

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

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.

Magento

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS 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..

  • 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

  •  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!

  • C3

    So I do not have a “app/etc/use_cache.ser” file, and I have already done the database queries listed in that blog post, yet I am still getting the recoverable 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 /var/www/vhosts/[SITENAME]/public/app/code/core/Mage/Core/Model/App.php on line 634 and defined in /var/www/vhosts/[SITENAME]/public/app/code/core/Mage/Core/Model/Store.php on line 395

    I get this when I try to login to the backend admin panel. Any thoughts?? Thank you!

  • Ravendra Verma

    Hi Mukesk,

    I have deleted app/etc/use_cache.ser after i have the same problem, website front end is working fine, only the admin back end is showing error.

    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 /home2/sulk/public_html/frank/app/code/core/Mage/Core/Model/App.php on line 645 and defined in /home2/sulk/public_html/frank/app/code/core/Mage/Core/Model/Store.php on line 453
    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 /home2/sulk/public_html/frank/app/code/core/Mage/Core/Model/App.php on line 665 and defined in /home2/sulk/public_html/frank/app/code/core/Mage/Core/Model/Store/Group.php on line 275