Closed CvekCoding closed 6 months ago
I tried to reproduce the issue but everything works as expected: https://github.com/dunglas/frankenphp-demo/compare/chore/reproducer-authorization?expand=1
Could you please edit this patch to provide a minimal reproducer?
I'll try to reproduce it, thanks
I had similar experience with a similar setup - strange behaviour with 401 responses just after sucessful login. This was not reliably reproducable and only occured after the instance has run for some time.
Could it be some cache related issue in Symfony (https://github.com/symfony/symfony/pull/52079 mentions some left over work for cache in long running processes)?
I don't see how it can relate to cache issues but it's hard to tell without a reproducer. Do you use the PHP cache proxy provided by Symfony or something like that?
Do you use the PHP cache proxy provided by Symfony or something like that?
The one provided by Symfony, yes. We use remote keys sets for JWT verification and we cache the sets locally (cache.app
pool), but those just can't be the problem, as they would have been re-fetched on cache miss and the keys were not rotated when the issue occured. I also did not see any hits on the JWK server in that time frame, which would also indicate it is not cache related. Sadly I don't have a reproducer yet :(
Hi @dunglas i have the same problem maybe like on apache where we must add set-env Authorization *() HTTP_AUTORIZATION ?did it is not needed on caddy ?
What do you think?
@filoucrackeur it's unlikely. Would you be able to provide a reproducer (even if it happens randomly)?
I'm observing something similar, leak between workers or something. If I try to xdebug it only 3rd request in getting connected to IDE.
https://github.com/dunglas/frankenphp/assets/1244112/03245b58-cde3-49b9-92c3-f10d700fddda
It looks like some cache, because process is not connecting to IDE, and if could cache ignore QS?
This looks like a known EasyAdmin bug. Are you using EA?
It yes, this is an issue that is being tracked by EasyAdmin. There is nothing we can do on our side: https://github.com/EasyCorp/EasyAdminBundle/issues/5986
We're working with @javiereguiluz to solve it. I plan to work on it soon but not ETA :(
@dunglas yes, it's EA, from what I've observed EasyAdminTwigExtension
is not called, thus not setting ea
variable, extension is not called because \Twig\ExtensionSet::getGlobals
is not executed - probably due to $initialized = true
so maybe it's actually a Twig issue
Looks like a valid "solution": https://github.com/EasyCorp/EasyAdminBundle/issues/5986#issuecomment-1999794853
@oleg-andreyev please note that even if this issue happens in EasyAdmin ... it not only happens in EasyAdmin. Some people are reporting the same issue when using Shopware and FrankenPHP and for the exact same reason: Twig globals.
Let's see if this can be solved at Twig level somehow. See https://github.com/twigphp/Twig/issues/4007
@javiereguiluz Yes, already figured out that it's not EA itself .
Closing here, this should be fixed in EasyAdmin/ShopWare or/and in Twig.
What happened?
In Worker mode, I ran into the problem that the context is shared between different requests - it looks like the headers of the previous request remain in the context and are used in the next request. In particular, the Authorization header - a new request has arrived on the server, and the code continues to work with the Authorizztion's value of previous one. As soon as I turn off the worker mode, everything starts working correctly.
I have a pretty standard installation: Symfony 6.4 + lexikjwt.
What can you suggest me? Thanks.
Build Type
Docker (Alpine)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration