Magento 2 Error after Product Search

by Travis   Last Updated May 15, 2018 20:09 PM

I'm getting frequent 503 errors on my production and development site. It doesn't seem to happen every time or to everyone, but for some people, Including me, it happens at least 75% of the time. It's not a cache issue and I've had multiple support techs from my hosting and extension devs look into this to no avail.

Here is the error report:

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Area code is not set

Exception #0 (Magento\Framework\Exception\LocalizedException): Area code is not set
#0 /srv/public_html/vendor/magento/module-customer/Model/Plugin/CustomerNotification.php(78): Magento\Framework\App\State->getAreaCode()
#1 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Customer\Model\Plugin\CustomerNotification->beforeDispatch(Object(Smartwave\Porto\Controller\CatalogSearch\Result\Index\Interceptor), Object(Magento\Framework\App\Request\Http))
#2 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Smartwave\Porto\Controller\CatalogSearch\Result\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#3 /srv/public_html/generated/code/Smartwave/Porto/Controller/CatalogSearch/Result/Index/Interceptor.php(26): Smartwave\Porto\Controller\CatalogSearch\Result\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#4 /srv/public_html/vendor/magento/framework/App/FrontController.php(55): Smartwave\Porto\Controller\CatalogSearch\Result\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#5 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#6 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#7 /srv/public_html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#8 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#9 /srv/public_html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#10 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#11 /srv/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#12 /srv/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#13 /srv/public_html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#14 /srv/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#15 /srv/public_html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#16 {main}

A few third party extensions are listed, but even with those disabled the error happens and the lines with the third party extensions are obviously no longer in the error.

This is happening on my production 2.2.3 and my development site which is at 2.2.4. I updated to 2.2.4 to see if it would solve the problem, but it has not. I've seen "Area Code Not Set" errors before, but they were always during CLI commands. I haven't run into it at all running any CLI command and have only seen it in the error reports for this search problem.

How it happens:
1. Customer goes to any page on the site.
2. Customer enters any search term.
3. Page either loads correctly, or roughly 50% of the time it throws a 503 error.
4. If the error happened, simply refreshing the page leads to the correct search results being displayed.

Any ideas? I've disabled every extension I have and nothing has helped. So I'm open to any possible solutions.

Thanks



Related Questions



Magento 2.2 Not Loading theme and blocks

Updated January 11, 2018 02:09 AM


Magento 2 contributing tests to the new MFTF

Updated February 13, 2018 10:09 AM

How to change the product list 'desc' direction

Updated May 05, 2018 13:09 PM