Open erikbaan opened 1 year ago
Some extra info: this issue happens with both PHP 8.1.2 and PHP 8.1.13. After disabling opcache, the problem has not occured anymore (so far so good).
So it seems like an opcache related bug..
Some extra info: this issue happens with both PHP 8.1.2 and PHP 8.1.13. After disabling opcache, the problem has not occured anymore (so far so good).
So it seems like an opcache related bug..
good tip ! that makes sense
Has anyone got a reduced reproduce case already for this? It would likely need hammering with ab
or siege
, but anything that exhibits the problem would help with opening a bug upstream and getting it fixed in PHP. I am happy to do all that coordination work, I just need an initial reproduce case; I'd be happy to even try and further simplify it myself.
Could anyone affected try if upgrading symfony/monolog-bundle to 3.x-dev fixes it? I'm wondering if https://github.com/symfony/monolog-bundle/pull/446 might help as it stops doing level resolution in the container build. In theory the old code was fine but who knows. Opcache bugs can be hard to pinpoint.
Thanks @Seldaek for pointing to that fix. Unfortunately it's hard to test a dev version in production for us. At least I can confirm that I haven't seen this bug anymore, but I still have opcache disabled.
I will try enabling opcache again when monolog-bundle gets a new release.
Monolog version 2 & 3
Since upgrading to Symfony 6.1 (and PHP 8.1), I have been seeing a very rare Symfony container construction issue within the Monolog code. The error is logged by PHP-FPM to nginx:
This error only gets triggered once every 500 requests. The code is deployed using docker to multiple hosts (ubuntu 22.04 host and container), and the same rare issue happens on multiple hosts.
When looking at the monolog Logger.php code, it seems impossible that a
pushHandler
will trigger agetLevelName
, and even more will cause aConsoleHandler
to be given as level argument. But still this is the only issue I'm seeing, with the exact same trace every time.Is this a bug within Monolog? Are there any similar issues known?