You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when one of the items is throwing an error, the standard error handler kicks in and is resetting the container in the child process.
This leads to the kernel not being available in the container any more. As the kernel is a synthetic service and initialises itself during boot(), it's not available any more after a container reset in the error handler.
Any subsequent access to the kernel service throws the following exception:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The "kernel" service is synthetic, it needs to be set at boot time before it can be used.
Options to reproduce:
Either enable the Symfony Profiler and provoke any error in one of the items to process. Stopwatch is accessing the kernel in console.terminate and thus throws the exception.
Or add some LOC for testing and access the kernel directly, for example directly after the container has been reset in ResetServiceErrorHandler:
public function handleError(string $item, Throwable $throwable, Logger $logger): int
{
$this->resettable->reset();
try {
$this->resettable->get('kernel');
} catch (\Throwable $e) {
dd($e->getMessage());
}
return $this->decoratedErrorHandler->handleError($item, $throwable, $logger);
}
Output: "The "kernel" service is synthetic, it needs to be set at boot time before it can be used."
Best regards!
Tim
The text was updated successfully, but these errors were encountered:
I don't know. In my personal case, I am not using the kernel service at all. But the WebProfilerBundle apparently does and is causing this issue. So it's more of an "internal" thing.
This sounds a bit weird, we do use this package extensively and did not have that issue so far ever since we used subscribed services. So having a clear way to check what is going on would be very helpful
Hi,
when one of the items is throwing an error, the standard error handler kicks in and is resetting the container in the child process.
This leads to the kernel not being available in the container any more. As the kernel is a synthetic service and initialises itself during
boot()
, it's not available any more after a container reset in the error handler.Any subsequent access to the
kernel
service throws the following exception:Options to reproduce:
console.terminate
and thus throws the exception.kernel
directly, for example directly after the container has been reset inResetServiceErrorHandler
:Output:
"The "kernel" service is synthetic, it needs to be set at boot time before it can be used."
Best regards!
Tim
The text was updated successfully, but these errors were encountered: