-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Exception because HttpCache tries to access the container #40618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
see symfony/symfony#40618 Should be set to an exact version once this is fixed in Symfony
see symfony/symfony#40618 Should be set to an exact version once this is fixed in Symfony
Can you please confirm that #40619 fixes the issue ? |
Hmm, I fail to understand how you can configure the HttpCache in the container, if the instance is supposed to run outside the kernel & container at all. Maybe @Toflar knows some details about that? Not accessing |
I don't see how |
You might have missed #37351 |
Ah, indeed. Thanks for the hint :) |
Thanks for the PR link! Since the kernel seems now always bootet, shouldn't the |
I mean, since the kernel is always bootet, https://github.com/symfony/symfony/blob/5.x/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php#L95-L97 should always be called and the additional call shouldn't be necessary? |
…ttp_cache (nicolas-grekas) This PR was merged into the 5.2 branch. Discussion ---------- [FrameworkBundle] dont access the container to configure http_cache | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #40618 | License | MIT | Doc PR | - Commits ------- 8aa6818 [FrameworkBundle] dont access the container to configure http_cache
Thanks for the quick fix @nicolas-grekas ! |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 5.2.6
Description
The changes in #40497 can cause an exception if the container is not yet bootet. As far as I understand the HttpCache concept, the kernel SHOULD not be bootet for performance reasons if the request is in the cache. Therefore, the changes in #40497 must be wrong.
How to reproduce
Here's the exception trace we're getting in a Contao 4.11 setup. We're also using the FOSHttpCacheBundle and a custom entry point setup (not based on Symfony Flex)
Possible Solution
As the HttpCache is imho not allowed to access container parameters, the only solution I can think of is keep behaviour in Symfony 4.4 and set
Request::enableHttpMethodParameterOverride();
in the entry point./cc @xabbuh
The text was updated successfully, but these errors were encountered: