sentry-symfony
sentry-symfony copied to clipboard
Duplicated event sent from dev environment.
When forcing a warning event to Sentry I noticed that two events are sent when running in dev mode, while it is sent just once when running on prod mode.
Events from dev:
https://sentry.io/organizations/dev-curumas/issues/3767108540/?project=5505764&query=is%3Aunresolved&referrer=issue-stream
Note that the 1st event is marked as handled:false while the second event is marked as handled:true.
Event from prod: https://sentry.io/organizations/dev-curumas/issues/3775484061/?project=5505764&query=is%3Aunresolved&referrer=issue-stream
This event is marked as unhandled, the same way as the 1st event from dev.
Environment
Symfony: 5.4.14 Sentry Symfony SDK: v4.4.0 (not tested in the new v4.5.0). PHP: 7.4.33
Steps to Reproduce
Repro app: sentryTest.zip
- add a sentry DSN to
config/packages/sentry.yamland.env - Choose one of the environment to run first (prod/dev)
- run the server with
symfony server:start - go to localhost/l to trigger the warning event.
- Repeat 2-4 with the second environment.
The events are sent from the LuckyController class in src/Controller/LuckyController.php
Expected Result
just one event sent from both environments.
You have monolog enabled but not configured to use sentry. I suspect the reason it happens in dev and not prod is that the settings are different, the error is being logged by monolog in a sentry-detectable way in dev but not in prod, and you're getting sentry entries either way.
If you follow the instructions to integrate with monolog does the issue persist?
I was never able to reproduce this. Given it's bee a while, I'm closing the issue.