sentry-symfony icon indicating copy to clipboard operation
sentry-symfony copied to clipboard

Duplicated event sent from dev environment.

Open rodolfoBee opened this issue 2 years ago • 1 comments

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

  1. add a sentry DSN to config/packages/sentry.yaml and .env
  2. Choose one of the environment to run first (prod/dev)
  3. run the server with symfony server:start
  4. go to localhost/l to trigger the warning event.
  5. 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.

rodolfoBee avatar Nov 29 '22 14:11 rodolfoBee

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?

darovic avatar Jan 12 '23 03:01 darovic

I was never able to reproduce this. Given it's bee a while, I'm closing the issue.

cleptric avatar Apr 08 '24 08:04 cleptric