1

I get this message "Requested store is not found" when I want to create a new product or edit it.

Magento 2.2.5

php -f bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

This already applies but does not solve

Any other solution?

Requested store is not found in product

Below error showing in log file.

main.CRITICAL: Requested store is not found {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): Requested store is not found at /vendor/magento/module-store/Model/StoreRepository.php:109)"}

Please help me.

1
  • 1
    main.CRITICAL: Requested store is not found {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): Requested store is not found at /vendor/magento/module-store/Model/StoreRepository.php:109)"} [] Nov 10 '18 at 16:15
0

At line no 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 line no 155 of Magento\Store\Model\StoreManager

=> FROM :

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

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

0

Try to use this query in your database :

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';
1
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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