cancel
Showing results for 
Search instead for 
Did you mean: 

Catalog Layer has been already created error during the search

Catalog Layer has been already created error during the search

I am experiencing a very strange issue on Magento (version 2.4).

Due to a mistake, we imported some incorrect products. To rectify this, we reimported the correct ones.

Now, all the products are correct, and the ecommerce works fine but the search function no longer works. When attempting to search for something, an error page is displayed.

Screenshot 2023-10-18 at 18.36.24.png

I am experiencing a very strange issue on Magento (version 2.4).

Due to a mistake, we imported some incorrect products. To rectify this, we reimported the correct ones.

Now, all the products are correct, and the ecommerce works fine but the search function no longer works. When attempting to search for something, an error page is displayed.

 

main.ERROR: Catalog Layer has been already created [] []
main.CRITICAL: RuntimeException: Catalog Layer has been already created in /var/www/magento/vendor/magento/module-catalog/Model/Layer/Resolver.php:54
Stack trace:
#0 /var/www/magento/vendor/magento/module-catalog-search/Controller/Result/Index.php(82): Magento\Catalog\Model\Layer\Resolver->create()
#1 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\CatalogSearch\Controller\Result\Index->execute()
#2 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent()
#3 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}()
#4 /var/www/magento/generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php(23): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins()
#5 /var/www/magento/vendor/magento/framework/App/Action/Action.php(111): Magento\CatalogSearch\Controller\Result\Index\Interceptor->execute()
#6 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch()
#7 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent()
#8 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}()
#9 /var/www/magento/generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php(32): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins()
#10 /var/www/magento/vendor/magento/framework/App/FrontController.php(245): Magento\CatalogSearch\Controller\Result\Index\Interceptor->dispatch()
#11 /var/www/magento/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#12 /var/www/magento/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#13 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#14 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#15 /var/www/magento/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#16 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch()
#17 /var/www/magento/vendor/amasty/aminvisiblecaptcha/Plugin/Framework/App/FrontControllerInterface/ValidateCaptcha.php(124): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#18 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Amasty\InvisibleCaptcha\Plugin\Framework\App\FrontControllerInterface\ValidateCaptcha->aroundDispatch()
#19 /var/www/magento/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(71): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#20 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#21 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#22 /var/www/magento/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#23 /var/www/magento/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#24 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#25 /var/www/magento/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
2 REPLIES 2

Re: Catalog Layer has been already created error during the search

Must be an issue with some extension or custom code. From the stack trace you privded, I'd recommend you have a look at Amasty\InvisibleCaptcha

Founder at https://agency418.com

Re: Catalog Layer has been already created error during the search

I disabled it, but the issue still persists (without the related log).