3

In magento 2.2, I have 2 store in my website. When, I switch to default store to other store. Then, it will display error like this

1 exception(s): Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Requested store is not found

How can I solve this??

Please help me.

3 Answers 3

5

At line 164 add the below code of Magento\Store\Model\StoreManager:

    if(!$storeId){
        if(isset($_COOKIE['store']) && $_COOKIE['store'] !== ''){
            $storeId = $_COOKIE['store'];
        } else {
            $storeId = $this->getDefaultStoreView()->getCode();
        }           
    }

And then, change 155 line of Magento\Store\Model\StoreManager

=> FROM :

if (null === $this->currentStoreId) {

=> To :

if (null === $this->currentStoreId || '' === $this->currentStoreId) {
2

Method to Fix ‘Requested Store Is Not Found’ In Magento 2 When you’ve migrated your store to the latest Magento 2 version and encountered ‘Requested Store Is Not Found’ error, it is caused because you have not deleted old store data from the “core_config_data”.

So, the first thing you need to do to get rid of ‘Requested Store Is Not Found’ error is to execute the following SELECT query for deleting old store data correctly.

NOTE: Make sure you’ve created a fresh backup of your database before executing the following queries!

SELECT * FROM core_config_data WHERE scope = ‘stores’;

DELETE FROM core_config_data WHERE scope_id != 1 AND scope = ‘stores’;

After that, you need to execute the following commands in your Magento 2 store database:

SET FOREIGN_KEY_CHECKS=0;

UPDATE store SET store_id = 0 WHERE code=’admin’;

UPDATE store_group SET group_id = 0 WHERE name=’Default’;

UPDATE store_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;

Lastly, restore the tables – store, store_group, store_website – just as they were before you migrated your Magento 2 store.

Now, try to access your Magento 2 store from a web browser & confirm that the error is resolved.

0

You can see the notes on https://github.com/magento/magento2/issues/11453. I ran into same issue for magento 2.2.

Your Answer

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