-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Http-Kernel] [Cache] Warning on deploy with empty cache #36472
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
The error is silenced L432, see
It should thus not be reported. Why is it? |
@nicolas-grekas You're right - but there is another |
@nicolas-grekas I found the reason: I have |
@nicolas-grekas Still answering your question)) According to docs, |
Closing as this has been identified as an issue on Sentry's side. |
Could you elaborate on the reasons behind this, @nicolas-grekas? Since now I've preferred wiring Sentry in the bundle through the error handler since it's natively present from the base SDK, and the handler is designed taking inspiration from Symfony's. The Monolog approach seemed fragile in the past, since I would have to rely on a secondary bundle (MonologBundle) to work; also, I'm not sure I would be able to collect some collateral info; not sure about this last point, I need to reevaluate now. |
@Jean85 sure, let me try: The error handler is a global piece of non-trivial code. I would expect all Symfony apps to behave exactly the same no matter whether there is a bug catcher around (Sentry, Bugsnag, etc). When there is a bug catcher, I would expect it to not change any global state - that's too tricky, especially when there is already a stack in place. Since Symfony already has this stack for handling errors, I would expect bug catchers to standardize on reusing it when used within a Symfony app. If you need one example of how this can go wrong, this very issue is the example. By definition, the Symfony stack is more proven (since it runs on apps that don't have Sentry). It can be trusted more. The conclusion is that: don't hook here Sentry. Then:
If you want the bundle to be useful without Monolog bundle, I would recommend you to provide Sentry as a PSR-3 logger then. But when Monolog is installed, it should be leveraged, as it allows more powerful setups (e.g with the finger-crossed handler, etc.) But I wouldn't be shocked if monolog-bundle would be a dependency of sentry-bundle. Monolog is also more widely used than sentry-bundle - requiring it would satisfy the package principles.
I don't think you'd miss any info, but please report back if you find any of course. |
Luckily PSR-3 handler is already present in the base SDK, so that option is already covered: if a user wants that, just skip the bundle. The bundle should just be a fast way to install Sentry with a nice out-of-the-box experience in a Symfony app. I could try to change the hook, only downside that I see is that requiring explicitly the Monolog bundle is a no-go, because I would "silently" install it for the user. So I thought of a different approach: what do you think about hooking the PSR-3 handler directly to the Symfony error handler? I see that it has already some logger support there... Otherwise, I could detect the presence of the bundle and act accordingly, but I would have to fall back to the current approach if Monolog is absent.. |
That should be the way to go then I think. |
Loosely related: I would recommend sentry-bundle to use the symfony http-client by default also :) |
@Jean85 No PSR-3 handler is provided from
If we decorate the |
We do have this: https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php
That's too generic and risky IMHO. I would stick to the previous suggested approach.
The bundle doesn't have a direct dep, and the base library relies on PSR-18. Guzzle is just the out-of-the-box suggestion, you can change it anytime. Also, to use the Symfony client I would have to drop support for Symfony < 4.3, so maybe I could consider that in the future. |
actually, since you already have php 7.1 as a minimum dependency, and since the http-client component is standalone, this can be used even if the rest of the stack is using mostly previous versions of Symfony components. |
Symfony version(s) affected: 5.0.7
Description
Each time on deploy, I keep receiving such warning:
How to reproduce
I have Symfony installation with default cache settings. It happens every deploy. So I guess it's enough to just make Symfony bootstrap with cold cache.
Possible Solution
The root and reason is in "include" without suppressing warning as several lines above.
I am going to create PR to fix it.
According to #25999 (comment) as stated in #26158 (comment) , I am going to replace
file_exists
with the trick of suppressing warning on include as in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Kernel.php#L431 , turning it into the reusable method.Additional context
symfony/src/Symfony/Component/HttpKernel/Kernel.php
Lines 455 to 466 in 67948a7
Looks like regression of: #27234 .
The text was updated successfully, but these errors were encountered: