cancel
Showing results for 
Search instead for 
Did you mean: 

DomainException] Default website is not defined

SOLVED

DomainException] Default website is not defined

Hello,

I've a problem with my Magento2.2. I've created a backup of my database before make changes in back-office (just in case). I want to replace this backup because I make a mistake. Then with SequelPro, I go on my database and import my .sql (database backup).

 

But there are problem... I've no more access on my website (front & back/admin). This is the error message:

"Magento\Framework\Exception\NoSuchEntityException: No such entity. in /var/www/html/vendor/magento/module-store/Model/WebsiteRepository.php:102 Stack trace: #0 /var/www/html/vendor/magento/module-store/Model/StoreManager.php(204): Magento\Store\Model\WebsiteRepository->getById('0') #1 /var/www/html/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php(135): Magento\Store\Model\StoreManager->getWebsite('0') #2 /var/www/html/vendor/magento/module-store/Model/Resolver/Website.php(30): Magento\Store\Model\StoreManagerInterface\Proxy->getWebsite('0') #3 /var/www/html/vendor/magento/framework/App/Config/ScopeCodeResolver.php(49): Magento\Store\Model\Resolver\Website->getScope('0') #4 /var/www/html/vendor/magento/module-config/App/Config/Source/RuntimeConfigSource.php(86): Magento\Framework\App\Config\ScopeCodeResolver->resolve('website', '0') #5 /var/www/html/vendor/magento/module-config/App/Config/Source/RuntimeConfigSource.php(62): Magento\Config\App\Config\Source\RuntimeConfigSource->loadConfig() #6 /var/www/html/vendor/magento/framework/App/Config/ConfigSourceAggregated.php(40): Magento\Config\App\Config\Source\RuntimeConfigSource->get('') #7 /var/www/html/vendor/magento/module-config/App/Config/Type/System/Reader.php(60): Magento\Framework\App\Config\ConfigSourceAggregated->get() #8 /var/www/html/generated/code/Magento/Config/App/Config/Type/System/Reader/Proxy.php(95): Magento\Config\App\Config\Type\System\Reader->read() #9 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(292): Magento\Config\App\Config\Type\System\Reader\Proxy->read() #10 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(191): Magento\Config\App\Config\Type\System->readData() #11 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(152): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default') #12 /var/www/html/vendor/magento/framework/App/Config.php(131): Magento\Config\App\Config\Type\System->get('default/newreli...') #13 /var/www/html/vendor/magento/framework/App/Config.php(80): Magento\Framework\App\Config->get('system', 'default/newreli...') #14 /var/www/html/vendor/magento/module-new-relic-reporting/Model/Config.php(91): Magento\Framework\App\Config->getValue('newrelicreporti...') #15 /var/www/html/vendor/magento/module-new-relic-reporting/Plugin/HttpPlugin.php(49): Magento\NewRelicReporting\Model\Config->isNewRelicEnabled() #16 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\NewRelicReporting\Plugin\HttpPlugin->beforeCatchException(Object(Magento\Framework\App\Http\Interceptor), Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\NoSuchEntityException)) #17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\NoSuchEntityException)) #18 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(39): Magento\Framework\App\Http\Interceptor->___callPlugins('catchException', Array, Array) #19 /var/www/html/vendor/magento/framework/App/Bootstrap.php(261): Magento\Framework\App\Http\Interceptor->catchException(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\NoSuchEntityException)) #20 /var/www/html/pub/index.php(38): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor)) #21 {main}"

 

 

And if I want to make a cache:clean (flush), ... or another command, there are problem...

Capture d’écran 2018-09-18 à 14.04.13.png

 

And in my "core_config_data" table, "web/unsecure/base_url" and "web/secure/base_url" are ok. This is a multi store...

 

Any idea, because I'm blocked with this fu**** error Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions

Re: DomainException] Default website is not defined

2 REPLIES 2

Re: DomainException] Default website is not defined

Re: DomainException] Default website is not defined

The solution here didn't work for me. My problem was no store was identified as the default store in the store_website table. I changed column 'is_default' in one row to a 1 and the problem was solved.