Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[HttpKernel] fixed kernel re-init (when getting unserialized for eg.)#6326
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
When a kernel object gets unserialized, it's being constructed, theninitialized, there shouldn't be any need to call the init methodtwice in a process, it basically only contains static callsaffecting some PHP ini settings or error handlers, actually it can leadto unexpected things if it's called more than once, for eg. havingduplicate error messages or registering DebugClassLoaders forDebugClassLoaders.Imo this method shouldn't even be publicly accessible, but I didn'twanted to break things.
I'd rather fix the root cause because IIUC, in your case, you then have 2 kernels. |
Yes but I don't think this is specific to me, I can see the kernel has been designed to support serialization (it implements Serializable), so the same issue will likely occur anytime the kernel or a class depending on the kernel gets unserialized. It looks related to some Symfony internals, here is the class causing me this issue :https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Config/FileLocator.php This class depends on the Kernel, and an instance of it is being serialized in If nobody can reproduce this I'll try to push something on github. |
I'm getting this error with a fresh standard edition (latest and deps updated to their latest too) if I only remove the semi-colon at the end of this line for eg :https://github.com/symfony/symfony-standard/blob/master/src/Acme/DemoBundle/Controller/DemoController.php#L30 and request the |
@mpdude : this "init()" method has been deprecated, so it's fixed now. |
fixes#6254
This was happening to me because in
app/cache/dev/appDevUrlMatcher.php.meta
I have aSymfony\Component\HttpKernel\Config\FileLocator
serialized object, at some point a ConfigCache needs to unserialize this file, when it does, a Kernel gets unserialized too (because this FileLocator class depends on it), and it leads to re-initializing the kernel.