3

My main admin login is not working though sub-admin are working well.

Error produce: I have created few sites and store views as well as few sub-admin with limited access. I deleted a website from admin and after that admin login display below error message. Other sub-admin can login to admin of site but Main administartor is not able to login to admin.

Error message:

There has been an error processing your request Invalid website id requested.

Trace: 0 /app/code/core/Mage/Core/Model/App.php(950): Mage::exception('Mage_Core', 'Invalid website...') 1 /app/code/core/Mage/Core/Model/Store.php(465): Mage_Core_Model_App->getWebsite('3') 2 /app/code/core/Mage/Tax/Block/Adminhtml/Notifications.php(150): Mage_Core_Model_Store->getWebsite() 3 /app/design/adminhtml/default/default/template/tax/notifications.phtml(31): Mage_Tax_Block_Adminhtml_Notifications->getWebsitesWithWrongDiscountSettings() 4 /app/code/core/Mage/Core/Block/Template.php(241): include('/home/develop/d...') 5 /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...') 6 /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView() 7 /app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml() 8 /app/code/core/Mage/Tax/Block/Adminhtml/Notifications.php(196): Mage_Adminhtml_Block_Template->_toHtml() 9 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Tax_Block_Adminhtml_Notifications->_toHtml() 10 /app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml() 11 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml() 12 /app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml() 13 /app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('notifications', true) 14 /app/design/adminhtml/default/default/template/page.phtml(55): Mage_Core_Block_Abstract->getChildHtml('notifications') 15 /app/code/core/Mage/Core/Block/Template.php(241): include('/home/develop/d...') 16 /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...') 17 /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView() 18 /app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml() 19 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml() 20 /app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml() 21 /app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput() 22 /app/code/core/Mage/Adminhtml/controllers/DashboardController.php(43): Mage_Core_Controller_Varien_Action->renderLayout() 23 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_DashboardController->indexAction() 24 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index') 25 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) 26 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch() 27 /app/Mage.php(684): Mage_Core_Model_App->run(Array) 28 /index.php(90): Mage::run('', 'store') 29 {main}

How to fix this issue. Urgent help required.

2 Answers 2

4

I sorted out this error as:

  1. Go to the database tables: core_website, core_store and core_store_group
  2. First look for website_id attribute in table core_website and delete that website id from this.
  3. Repeat same in tables: core_store and core_store_group.

You can see your website id number in error page. ie getWebsite('3'). Here '3' is website id number


Above solution works well if you delete Website ID but if you remove stores (not store view because that deleted with store automatically) from under main website then this solution doesn’t work.

For that you need go to table cms_page_store and delete rows related store_views those are deleted.

SQL: DELETE FROM cms_page_store WHERE store_id NOT IN (SELECT store_id FROM core_store)

Explanation:

You can check your store_view ids in admin->system->manage stores. All CMS pages should be assoicated with these id. If there is any extra/other id is in table cms_page_store field 'store_d' then 404 error will display.

1
2

Moving Magento from your Subdomain to your Main Domain (and vice versa): All you need to do is to follow the following steps:-

Step File: Go to your File Manager and click "Select All". Click "Move" and key in "/public_html" to move it to the main domain's directory. You may need to clear the caches at "var/cache" and "var/session" after you have moved all files over.

Step Admin:

Go to Magento Admin --> System --> Configurations --> Web --> Unsecure URL & Secure URL.

Change both the Secure URL and Unsecure URL to the domain that you are going to be moved to. Be sure to include the "/" at the end of the domain name.

Step DataBase:

##Must Be take Backup before do it
TRUNCATE TABLE dataflow_batch_export;
TRUNCATE TABLE dataflow_batch_import;
TRUNCATE TABLE log_customer;
TRUNCATE TABLE log_quote;
TRUNCATE TABLE log_summary;
TRUNCATE TABLE log_summary_type;
TRUNCATE TABLE log_url;
TRUNCATE TABLE log_url_info;
TRUNCATE TABLE log_visitor;
TRUNCATE TABLE log_visitor_info;
TRUNCATE TABLE log_visitor_online;
TRUNCATE TABLE report_event;
TRUNCATE TABLE  log_customer;
TRUNCATE TABLE  log_quote;

You can also perform the Step Admin above through the database instead of going through the Magento admin:- Go to phpMyAdmin. Find and click your Magento database from the list of the left bar. Scroll down and look for core_config_data. Click "Browse" (the first button at the side). Find the path "web/unsecure/base_url" and "web/secure/base_url". Click on the "Pencil" icon of both of the path above and edit the URLs accordingly (one path at a time). Click "Go" after the URLs have been edited.

Note:- It is advisable to backup your files and databases before performing the above stated steps.

If hosting problem you may take help: https://forum.mediatemple.net/topic/2286-help-with-magento-2nd-store-on-subdomain-dv/

5
  • I was not able to login into admin so cant access those features. And my sub-admin can access only categories tab of admin. Thx for instant response
    – Jarnail S
    Commented Aug 20, 2015 at 11:44
  • your site front-end is ok? Just show error when admin login at main domain.
    – matinict
    Commented Aug 20, 2015 at 11:47
  • ... Issue is solved dear. And yes my site was working fine on front end. And i posted the answer too.
    – Jarnail S
    Commented Aug 20, 2015 at 11:57
  • ..i get new issue. When I click on CMS->Pages. Its giving me error "404 error: Page not found" and all page is blank. BUT this error is coming on this tab only. if i go to back and i can do everything. Dont know what happened to CMS->Pages. Should i need to delete any data from other tables too?
    – Jarnail S
    Commented Aug 20, 2015 at 12:35
  • @jai directly update/delete database tables date not wise at migration , Magento use url just two time at core_config_data it can be changed from admin panel also, So i suggest u to restore ur backup again
    – matinict
    Commented Aug 20, 2015 at 13:19

Your Answer

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

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