-
Notifications
You must be signed in to change notification settings - Fork 171
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
Symfony error pages are not being show correctly #63
Comments
Can you provide us with a (redacted) copy of your config, regarding the Sentry bundle integration? |
Sure. // app/config/parameters.yml
...
sentry_dsn_backend: null
sentry_dsn_frontend: null
sentry_environment: development
... And: // app/config/config.yml
...
sentry:
dsn: "%sentry_dsn_backend%"
release: "%sentry_release%"
environment: "%sentry_environment%"
skip_capture: [ Symfony\Component\HttpKernel\Exception\NotFoundHttpException, Lexik\Bundle\MaintenanceBundle\Exception\ServiceUnavailableException ]
... |
|
|
I'm having issues trying to understand where the difference should be. Can you compare the listener behavior from the developer toolbar to see where the Sentry listener is interfering in this matter? |
Sorry, I don't know how to do that. I'll try, if I find something I will let you know, but until now I wasn't able to isolate the problem. |
I was talking about the "Events" panel on the Symfony Profiler. Try to compare that. |
Closing this a stale. Feel free to reply if the issue is still unresolved. |
I'm having a similar issue with v2.0 (I'm only enabling SentryBundle in prod environment). Right now the page that is being returned is blank and the status code is 500 (even it should be a 404, since I'm simply loading a non-existent page). I have no custom error handlers, I just overwritten the twig templates as specified in the Symfony docs. Sentry configuration has no option set other than the dns. Can anyone help? |
Since you got 500, you are getting an exception, probably it's a misconfiguration issue. Check your logs in |
This error still happens, since the moment I enable it in AppKernel the error handling of my application start to act weird, as I described above. This is for sure no support. This is a bug. I'll try to help, as soon as possible. |
This error is related with this listener: https://github.com/getsentry/sentry-symfony/blob/master/src/Resources/config/services.yml#L19 It actually doesn't matter the content of the method, just the fact of the listener being registered already breaks the expected behaviour. Anyone have any clue on how to fix this? |
The listener is there to trigger the loading of the Sentry client service, which is a dependency of the listener itself; when the Sentry client is instantiated, it will register itself as an error handler, and it's possible that that's the origin of the issue. What version of Symfony are you using? I just want to be sure that this isn't related to #119, which was solved by symfony/symfony#26568. That fix is included in Symfony version:
... or later patches. |
I'm using latest LTS, 3.4.10. Actually, the The line I've marked in my previous comment is the line that makes this class listen to the What I'm saying, is that just the fact of this class listen to the
Everything behave as expected. I don't think the issue you said has relation to this cause, I don't know why this weird behaviour is happening. What is even more weird, is that if I leave the I'll try to change the moment where the authenticated user is being registered to the Raven client. |
I think we can re-open the issue, due to its importance, and it is now active again. |
I've discovered something really special. Removing the I've discovered that in the same service.yml, in the My proposal is to remove the |
I'm reopening the issue to follow through with your reports, thanks for the effort. Yes, your finding are correct; the listener listens to the BTW, I closed this because I was unable to reproduce the issue. Do you have the issue in the dev environment or in prod? Can you reproduce the issue with a minimal Symfony 3 standard installation, to have an easier to debug situation? |
Is it possible that this bug is related to #120 (comment)? Maybe we can apply the same solution, trigger the listener later, after the Symfony's error handler registration? |
I can confirm that is related to #120, I am working on a fix. |
We are talking about different problems, but are some relation. When you've said:
You're saying that the bundle listens to And about don't call the I vote for removing the And about reproduce this, you can easily reproduce this in any symfony install you have. Just install the bundle, make an erroneus |
Thanks @murilolobato for your continued effort. It seems that you're also correct in pointing out that the Can you investigate on that? Otherwise I will be forced to implement this fix only in a future 2.1 version, supporting only PHP 7.1+ |
|
Ok, I had the time of using the reproducer given me by @PapyDanone. I'm not sure, but it seems that Sentry registration mess up with the Symfony error handler. What I've seen is that the Symfony handler does I think I'll report this to Symfony, but for this bundle the suggested workaround is to disable the |
Thanks for looking into this @Jean85 Note: I found this issue on the Symfony project that sounds very similar. Although it is marked as closed, it seems to have resurfaced for some.
Could you please document the cleanest way to achieve this? |
To disable the |
Did anyone made progress on this? I may have some time to investigate if needed? |
I don't have any more time to throw at this right now. Also, any spare time on my side will be dedicated on the next major of this bundle, to support the new Sentry 2.0 SDK; in that version, I hope to solve this issue once and for all. |
I cannot make it work I've tried with redeclaring the service omitting the call of install() also tried to inherit from class SentrySymfonyClient and override install() I've created a class
and in services.yaml
It registers properly the sentry.client as php 7.1.11 |
I think this is fixed now by symfony/symfony#30264 |
Sorry, it is not. I was testing it in a production-like env and it fixed the situation where I throw an exception in the ps. Throwing an exception in |
I've just tagged the first beta for the 3.0 release, can you test against that? |
@Jean85 same results with |
Ok, thanks @PapyDanone. |
Quick question for you @Jean85 . On sentry:
dsn: '%env(SENTRY_DSN)%'
options:
curl_method: async
skip_capture:
- 'SevenShores\Hubspot\Exceptions\BadRequest'
services:
sentry.client:
class: '%sentry.client%'
arguments: ['%sentry.dsn%', '%sentry.options%', '%sentry.skip_capture%']
public: true
|
The skip capture option is passed to the listener, not the client. It's unrelated to this. |
I can confirm that with the new release of this bundle 3.0, this issue is resolved, and the error page is shown correctly, and the error is captured in sentry.io Awesome work @Jean85 |
Great, happy to hear that! Thank you for testing & reporting, closing! |
@starred-gijs did you test with the reproducer? I'm still experiencing the same issue with |
Nope I used my own project, that reproducer project indeed still has that bug. I will double check my project and see what is the difference. |
No idea what is going on, but now it does not work anymore. Must have been a configuration issue on my side. Oops second time I incorrectly reported this issue as resolved, sorry for that. |
Reopening. I'll try to dig deeper here, but I fear it's something deeply routed and hard to fix. |
I've launched it again and I may have found at least one precise problem; the error now is the following:
So it seems that Sentry is already kicking in and trying to serialize the controller for the callback, and doing that it fails due to autoloading a broken class. I'll try do see if this is fixable in the base SDK. |
I can confirm that with getsentry/sentry-php#818 the issue is fixed! 🎉 You can try it out with I'll try to check if I can backport it to previous versions too. |
getsentry/sentry-php#818 got merged and released in sentry/sentry 2.1.0 🎉 You can now fix everything with a simple |
Thanks for all the work @Jean85 🙏 |
After I enable sentry, when a error 500 happens, the error page is not shown correctly. When I'm in 'dev' environment, the symfony debug page is not shown, as stated in the following images:
Bad:
Good:
And when I'm in 'prod' environment, my customized error page is also not shown, as stated in the following images:
Bad:
Good:
The text was updated successfully, but these errors were encountered: