sentry-dotnet
sentry-dotnet copied to clipboard
CaptureException returns empty SentryId but exception is sent to Sentry
Package
Sentry.AspNetCore
.NET Flavor
.NET Core
.NET Version
6.0.5
OS
Linux
SDK Version
3.16.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
No local repro
Expected Result
SentryId should not be 00000000000000000000000000000000
Actual Result
SentryId is 00000000000000000000000000000000
CaptureException will return an empty id if SentrySdk.Init has not been called.
sorry i just re read the title "but exception is sent to Sentry ". can you share a minimal repro of this?
@SimonCropp I'm going to try but it's unlikely to not work in a minimal repro. In fact it's intermittent even now :-\
could you try enabling Diagnostic Logger https://docs.sentry.io/platforms/dotnet/configuration/diagnostic-logger/ see FileAppenderDiagnosticLogger in that page as an example and persist error and above.
if you need a help writing a custom DiagnosticLogger that targets serilog/nlog/log4net etc let me know
also, if you are occasionally getting it on your local dev machine when debugging, can u try enabling "break on all exceptions"
In many cases you may have other logging enabled, and can just set options.Debug = true and send us any relevant output.
There shouldn't be any case where SentryId.Empty (all zeros) gets sent to Sentry. We should add a guard for this.
Given this was reported for version 3.16.0, it's possible we may have already fixed this, but still I think we should guard somewhere.
Sorry for the quiet - I'm hammered right now but will retry to do the above steps before end of August.
I'm only seeing this on older builds so I'll presume it's fixed! but like @mattjohnsonpint said, it would be a good idea to guard against it.
@SimonCropp please add some tests to ensure we don't encounter this again. (or see if we already have them. )
thanks
Closing, since we believe the bug is fixed already. But we'll still proceed with adding some more tests and safeguards.
@mattjohnsonpint I'm seeing this again for the first time since you closed the issue.
Can we debug it collaboratively somehow?
Can you please post a debug log or other code/output showing the failure?
If you would like to collaborate, please join our Discord server. https://discord.com/invite/Ww9hbqr
We use the #dotnet channel, or you can DM me there @mattjohnsonpint. Thanks.
I only have the 0000000000... sentry id in the database to show right now.
I am travelling but I'll ping you as soon as I get back.
Meantime, CaptureException is thread-safe right?
On Sun, 13 Nov 2022 at 18:05, Matt Johnson-Pint @.***> wrote:
If you would like to collaborate, please join our Discord server. https://discord.com/invite/Ww9hbqr
We use the #dotnet channel, or you can DM me there @mattjohnsonpint. Thanks.
— Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry-dotnet/issues/1657#issuecomment-1312788058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMYG5QMGZQY677EFCQNZNTWIEUWXANCNFSM5V6XVRJQ . You are receiving this because you authored the thread.Message ID: @.***>
CaptureException is thread-safe right?
Yes.
Stopped seeing this again after I got back 🤷
I'll ping you on discord if I see it again!