Fix 404 error when access admin panel after upgrade or fresh install

Posted on October 14, 2011 by admin There have been 0 comments

Some time, you meet this 404 error after upgrade you magento website, or even fresh installation. Your frontend running smooth but you can not access your backend. Do the following ways to bring your backend accessible. One at a time, if problem fixed, it's not necessary to do anothers.

  1. Clean your cache by manually remove var/cache dir content.
  2. Check your local.xml (app/etc/local.xml). Look for following line:
    
        
            
                
                    {{admin_frontname}}
                
            
        
    

By default frontName hold this value:

If changed, please change it back to:

Clean cache by manually remove var/cache dir content.

  1. Check your var/log/system.log for error log. If you can see following error log:
2011-10-14T18:59:31+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 /home/ngoc/www/m1600/app/code/core/Mage/Core/Model/App.php on line 644 and defined  in /home/ngoc/www/m1600/app/code/core/Mage/Core/Model/Store/Group.php on line 235
2011-10-14T19:18:35+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 /home/ngoc/www/m1600/app/code/core/Mage/Core/Model/App.php on line 624 and defined  in /home/ngoc/www/m1600/app/code/core/Mage/Core/Model/Store.php on line 304

If you see this error message, please make sure that you can access your database to execute this SQL command:

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

Result will be:

SET FOREIGN_KEY_CHECKS =0;# MySQL returned an empty result set (i.e. zero rows).
UPDATE `core_store` SET store_id =0 WHERE code = 'admin';# 1 row(s) affected.
UPDATE `core_store_group` SET group_id =0 WHERE name = 'Default';# 1 row(s) affected.
UPDATE `core_website` SET website_id =0 WHERE code = 'admin';# 1 row(s) affected.
UPDATE `customer_group` SET customer_group_id =0 WHERE customer_group_code = 'NOT LOGGED IN';# 1 row(s) affected.
SET FOREIGN_KEY_CHECKS =1;# MySQL returned an empty result set (i.e. zero rows).

Clean cache by manually remove var/cache dir content.

Last error is popular for many developer. Hope everyone can fix your error and bring back your magento backend again.


			

This post was posted in Magento Tutorials and was tagged with 404

Comments