Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Description
Symfony version(s) affected: 5.2.6
Description
Since the changes of#40497 (/cc@xabbuh) the HttpCache fails as the container is accessed inside theHttpCache class. This can only be done when the kernel is booted, which we in@sulu want to avoid when theHttpCache is used.
How to reproduce
git clone git@github.com:sulu/skeleton.gitcd skeletonAdd following to your.env.local file:
APP_ENV=prodDATABASE_URL=mysql://root:@127.0.0.1:3306/su_develop?serverVersion=5.7
bin/console sulu:build dev# optional error should appear beforeStart webserver.
Visit the homepage:
Fatal error: Uncaught LogicException: Cannot retrieve the container from a non-booted kernel. in /Sulu-cms/sulu-develop.localhost/vendor/symfony/http-kernel/Kernel.php:307 Stack trace: #0 /sulu-cms/sulu-develop.localhost/vendor/symfony/framework-bundle/HttpCache/HttpCache.php(68): Symfony\Component\HttpKernel\Kernel->getContainer()#1 /sulu-cms/sulu-develop.localhost/vendor/friendsofsymfony/http-cache/src/SymfonyCache/EventDispatchingHttpCache.php(103): Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)#2 /sulu-cms/sulu-develop.localhost/public/index.php(66): Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache->handle(Object(Symfony\Component\HttpFoundation\Request))#3 {main} thrown in /Users/sulu-cms/sulu-develop.localhost/vendor/symfony/http-kernel/Kernel.php on line 307
Possible Solution
Thecontainer should not be accessed as the Kernel could not be booted yet.
Additional context
The@sulu CMS does not use theframework.http_cache option it use the HttpCache without a bootet Kernel.