Skip to content
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

Crash free rate is broken #2863

Closed
bruno-garcia opened this issue Nov 18, 2023 · 3 comments · Fixed by #2895
Closed

Crash free rate is broken #2863

bruno-garcia opened this issue Nov 18, 2023 · 3 comments · Fixed by #2895
Assignees

Comments

@bruno-garcia
Copy link
Member

image

I clearly have 1 crash event (unhandled) but still Sentry tells me 100% crash free.

In the logs I see one session update with "status":"abnormal" right after the crash, and without init=true and one without status at all (when init=true so might default to ok as it's a new session automatically started after the crash).

It's odd we automatically restart it because the process is crashing. We should check if it's an unhandled exception and not automatically start a fresh session.

I used options:

// Crash free run statistics (sends a ping for healthy and for crashes sessions)
o.AutoSessionTracking = true;

o.Debug = true;

// Caches files in the event device is offline
// Sentry creates a 'sentry' sub directory, no need to concat here
o.CacheDirectoryPath = appFolderInfo.GetAppDataPath();

And threw an exception right after Sentry was initialized

Relevant debug log bits:

  Debug: Ending session as Crashed, due to unhandled exception.
Warning: Failed to end session because there is none active.
[Fatal] ConsoleApp: EPIC FAIL! 
...
[v10.0.0.32241] System.Exception: test mechanism
   at NzbDrone.Console.ConsoleApp.Main(String[] args) in ./Sonarr.Console/ConsoleApp.cs:line 44
...
  Debug: Envelope successfully sent. Content: {"sdk":{"name":"sentry.dotnet","version":"4.0.0-beta.0"},"sent_at":"2023-11-18T22:54:46.450585+00:00"} {"type":"session","length":315} {"sid":"e5f3daf681bf47c793afb5bb3c771ba9","did":"82d98c16-cd54-46da-bb69-2b6ae4b9359d","init":false,"started":"2023-11-18T17:43:15.001553-05:00","timestamp":"2023-11-18T22:54:45.550827+00:00","seq":1,"duration":690,"errors":0,"status":"abnormal","attrs":{"release":"10.0.0.31593-Debug-dev","environment":"testing"}}
  Debug: Reading cached envelope: /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/__processing/1700348085_6036__51269976.envelope
  Debug: Sending cached envelope:
  Debug: Envelope successfully sent. Content: {"sdk":{"name":"sentry.dotnet","version":"4.0.0-beta.0"},"sent_at":"2023-11-18T22:54:46.511494+00:00"} {"type":"session","length":292} {"sid":"2ee32ddb4a354d4aa53028b17723efa5","did":"82d98c16-cd54-46da-bb69-2b6ae4b9359d","init":true,"started":"2023-11-18T17:54:45.564714-05:00","timestamp":"2023-11-18T22:54:45.566333+00:00","seq":0,"duration":0,"errors":0,"attrs":{"release":"10.0.0.32233-Debug-dev","environment":"testing"}}

Full Logs:

  Debug: Logging enabled with ConsoleDiagnosticLogger and min level: Debug
  Debug: Initializing Hub for Dsn: 'https://a30a09a2a91646b6bea5962944d8b002@o117736.ingest.sentry.io/4506249065332736'.
  Debug: This looks like a standard JIT/AOT application build.
  Debug: Starting CachingTransport worker.
  Debug: Blocking initialization to flush the cache.
  Debug: CachingTransport worker has started.
  Debug: CachingTransport worker signal triggered.
  Debug: Flushing cached envelopes.
  Debug: No cached file to process.
  Debug: Completed flushing the cache. Resuming initialization.
  Debug: Starting BackgroundWorker.
  Debug: BackgroundWorker Started.
  Debug: New scope pushed.
  Debug: Registering integration: 'AutoSessionTrackingIntegration'.
  Debug: Attempting to recover persisted session from file.
   Info: Recovered session: EndStatus: Abnormal. PauseTimestamp:
  Debug: Enqueuing envelope
   Info: Envelope queued up: ''
  Debug: Created directory for installation ID file (/Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F).
  Debug: Resolved installation ID '82d98c16-cd54-46da-bb69-2b6ae4b9359d'.
   Info: Started new session (SID: 2ee32ddb4a354d4aa53028b17723efa5; DID: 82d98c16-cd54-46da-bb69-2b6ae4b9359d).
  Debug: Persisting session (SID: '2ee32ddb4a354d4aa53028b17723efa5') to a file.
  Debug: Created persistence directory for session file '/Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F'.
  Debug: Storing file /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/1700348085_5769__4878312.envelope.
  Debug: Persisted session to a file '/Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/.session'.
  Debug: Enqueuing envelope
   Info: Envelope queued up: ''
  Debug: Registering integration: 'AppDomainUnhandledExceptionIntegration'.
  Debug: Registering integration: 'AppDomainProcessExitIntegration'.
  Debug: Registering integration: 'UnobservedTaskExceptionIntegration'.
  Debug: Registering integration: 'SentryDiagnosticListenerIntegration'.
   Info: DiagnosticSource Integration is disabled because tracing is disabled.
  Debug: Registering integration: 'WinUIUnhandledExceptionIntegration'.
  Debug: Envelope handed off to transport (event ID: ''). 2 items in queue.
  Debug: CachingTransport worker signal triggered.
  Debug: Flushing cached envelopes.
  Debug: De-queueing event
  Debug: Storing file /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/1700348085_6036__51269976.envelope.
  Debug: Envelope handed off to transport (event ID: ''). 1 items in queue.
  Debug: De-queueing event
  Debug: Reading cached envelope: /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/__processing/1700348085_5769__4878312.envelope
  Debug: Sending cached envelope:
  Debug: Using 'GzipBufferedRequestBodyHandler' body compression strategy with level Optimal.


  Debug: Creating the Dynamic Sampling Context from the Propagation Context
   Info: Capturing event.
  Debug: Running processor on exception: test mechanism
  Debug: Creating SentryStackTrace. isCurrentStackTrace: False.
  Debug: Got debug image for 'Sonarr.dll' having Debug ID: 60b50c03-1cc9-4ffb-9a10-5654e5ac9bbe-9858d4fd
  Debug: Created DebugStackTrace with 1 frames.
  Debug: Running main event processor on: Event 106f546f02a5477c8e82f5b040705de2
  Debug: Merging 1 debug images from stacktrace.
  Debug: Calling the BeforeSend callback
  Debug: Ending session as Crashed, due to unhandled exception.
Warning: Failed to end session because there is none active.
  Debug: Event not sampled.
  Debug: Enqueuing envelope 106f546f02a5477c8e82f5b040705de2
   Info: Envelope queued up: '106f546f02a5477c8e82f5b040705de2'
  Debug: Ending transaction as Aborted, due to unhandled exception.
  Debug: Storing file /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/1700348086_-70_106f546f02a5477c8e82f5b040705de2_35885827.envelope.
  Debug: Envelope handed off to transport (event ID: '106f546f02a5477c8e82f5b040705de2'). 1 items in queue.
[Fatal] ConsoleApp: EPIC FAIL! 

[v10.0.0.32241] System.Exception: test mechanism
   at NzbDrone.Console.ConsoleApp.Main(String[] args) in ./Sonarr.Console/ConsoleApp.cs:line 44

EPIC FAIL! System.Exception: test mechanism
   at NzbDrone.Console.ConsoleApp.Main(String[] args) in ./Sonarr.Console/ConsoleApp.cs:line 44
Press enter to exit...
  Debug: De-queueing event 106f546f02a5477c8e82f5b040705de2
  Debug: Envelope successfully sent. Content: {"sdk":{"name":"sentry.dotnet","version":"4.0.0-beta.0"},"sent_at":"2023-11-18T22:54:46.450585+00:00"} {"type":"session","length":315} {"sid":"e5f3daf681bf47c793afb5bb3c771ba9","did":"82d98c16-cd54-46da-bb69-2b6ae4b9359d","init":false,"started":"2023-11-18T17:43:15.001553-05:00","timestamp":"2023-11-18T22:54:45.550827+00:00","seq":1,"duration":690,"errors":0,"status":"abnormal","attrs":{"release":"10.0.0.31593-Debug-dev","environment":"testing"}}
  Debug: Reading cached envelope: /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/__processing/1700348085_6036__51269976.envelope
  Debug: Sending cached envelope:
  Debug: Envelope successfully sent. Content: {"sdk":{"name":"sentry.dotnet","version":"4.0.0-beta.0"},"sent_at":"2023-11-18T22:54:46.511494+00:00"} {"type":"session","length":292} {"sid":"2ee32ddb4a354d4aa53028b17723efa5","did":"82d98c16-cd54-46da-bb69-2b6ae4b9359d","init":true,"started":"2023-11-18T17:54:45.564714-05:00","timestamp":"2023-11-18T22:54:45.566333+00:00","seq":0,"duration":0,"errors":0,"attrs":{"release":"10.0.0.32233-Debug-dev","environment":"testing"}}
  Debug: Reading cached envelope: /Users/bruno/.config/Sonarr/Sentry/6B5D58608E674AC26BAF3CF583889982F0C7847F/__processing/1700348086_-70_106f546f02a5477c8e82f5b040705de2_35885827.envelope
  Debug: Sending cached envelope: 106f546f02a5477c8e82f5b040705de2
  Debug: Envelope '106f546f02a5477c8e82f5b040705de2' successfully sent. Content: {"sdk":{"name":"sentry.dotnet","version":"4.0.0-beta.0"},"event_id":"106f546f02a5477c8e82f5b040705de2","trace":{"trace_id":"191f8babcda34f2f9d49295336fe116c","public_key":"a30a09a2a91646b6bea5962944d8b002","release":"10.0.0.32233-Debug-dev","environment":"testing"},"sent_at":"2023-11-18T22:54:46.612051+00:00"} {"type":"event","length":5740} {"modules":{"System.Private.CoreLib":"6.0.0.0","Sonarr":"10.0.0.32241","System.Runtime":"6.0.0.0","JetBrains.Microsoft.Extensions.DotNetDeltaApplier":"1.0.0.0","System.Linq":"6.0.0.0","System.Collections":"6.0.0.0","Sonarr.Common":"10.0.0.32233","System.Net.Primitives":"6.0.0.0","Microsoft.Win32.Primitives":"6.0.0.0","Sonarr.Host":"10.0.0.32241","Sonarr.RuntimePatches":"10.0.0.29635","System.Console":"6.0.0.0","System.Collections.Concurrent":"6.0.0.0","NLog":"4.0.0.0","netstandard":"2.1.0.0","Microsoft.AspNetCore.Connections.Abstractions":"6.0.0.0","System.IO.Pipes":"6.0.0.0","0Harmony":"2.0.1.0","System.Text.RegularExpressions":"6.0.0.0","System.Threading":"6.0.0.0","System.Net.Sockets":"6.0.0.0","System.Diagnostics.Tracing":"6.0.0.0","System.Threading.ThreadPool":"6.0.0.0","System.Runtime.InteropServices.RuntimeInformation":"6.0.0.0","System.Threading.Thread":"6.0.0.0","System.Memory":"6.0.0.0","System.Runtime.Loader":"6.0.0.0","System.Reflection.Emit.ILGeneration":"6.0.0.0","System.Reflection.Emit.Lightweight":"6.0.0.0","System.Reflection.Primitives":"6.0.0.0","System.IO.FileSystem.Watcher":"6.0.0.0","System.Diagnostics.Process":"6.0.0.0","System.ComponentModel.Primitives":"6.0.0.0","System.Runtime.InteropServices":"6.0.0.0","Sentry":"4.0.0.0","System.IO.Compression":"6.0.0.0","System.Text.Json":"6.0.0.0","System.ComponentModel":"6.0.0.0","System.Diagnostics.TraceSource":"6.0.0.0","System.Data.Common":"6.0.0.0","System.Net.Mail":"6.0.0.0","System.ComponentModel.TypeConverter":"6.0.0.0","System.Linq.Expressions":"6.0.0.0","System.ObjectModel":"6.0.0.0","System.Private.Uri":"6.0.0.0","NLog.Extensions.Logging":"1.0.0.0","System.Diagnostics.FileVersionInfo":"6.0.0.0","System.Reflection.Metadata":"6.0.0.0","System.Collections.Immutable":"6.0.0.0","System.IO.MemoryMappedFiles":"6.0.0.0","System.Text.Encoding.Extensions":"6.0.0.0","Microsoft.Extensions.Logging.Abstractions":"6.0.0.0","Microsoft.Extensions.Logging":"6.0.0.0","NLog.Targets.Syslog":"6.0.0.0","System.Security.Cryptography.X509Certificates":"6.0.0.0","System.Security.Cryptography.Algorithms":"6.0.0.0","System.Security.Cryptography.Primitives":"6.0.0.0","System.Diagnostics.StackTrace":"6.0.0.0","System.Numerics.Vectors":"6.0.0.0","System.Runtime.CompilerServices.Unsafe":"6.0.0.0","System.Text.Encodings.Web":"6.0.0.0","System.Runtime.Intrinsics":"6.0.0.0","System.Diagnostics.DiagnosticSource":"6.0.0.0","System.Net.Http":"6.0.0.0","System.Net.Requests":"6.0.0.0","System.Net.Security":"6.0.0.0","System.Data.SQLite":"1.0.115.5","System.Net.NameResolution":"6.0.0.0"},"event_id":"106f546f02a5477c8e82f5b040705de2","timestamp":"2023-11-18T22:54:45.91968+00:00","logentry":{"message":"EPIC FAIL!"},"logger":"ConsoleApp","platform":"csharp","release":"10.0.0.32233-Debug-dev","exception":{"values":[{"type":"System.Exception","value":"test mechanism","module":"System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","thread_id":1,"stacktrace":{"frames":[{"filename":"./Sonarr.Console/ConsoleApp.cs","function":"void ConsoleApp.Main(string[] args)","lineno":44,"colno":17,"in_app":true,"package":"Sonarr, Version=10.0.0.32241, Culture=neutral, PublicKeyToken=null","instruction_addr":"0x42","addr_mode":"rel:0","function_id":"0x1"}]},"mechanism":{"type":"Logger.Fatal","description":"Logger.Fatal was called","handled":false}}]},"level":"fatal","request":{},"contexts":{"Current Culture":{"name":"en-CA","display_name":"English (Canada)","calendar":"GregorianCalendar"},"Dynamic Code":{"Compiled":true,"Supported":true},"Memory Info":{"allocated_bytes":4177560,"fragmented_bytes":312384,"heap_size_bytes":1562680,"high_memory_load_threshold_bytes":30923764531,"total_available_memory_bytes":34359738368,"memory_load_bytes":21646635171,"total_committed_bytes":2736128,"promoted_bytes":733944,"pinned_objects_count":2,"pause_time_percentage":0.29,"index":1,"finalization_pending_count":15,"compacted":true,"concurrent":false,"pause_durations":[3.524,0]},"ThreadPool Info":{"min_worker_threads":10,"min_completion_port_threads":10,"max_worker_threads":32767,"max_completion_port_threads":1000,"available_worker_threads":32765,"available_completion_port_threads":1000},"app":{"type":"app","app_start_time":"2023-11-18T22:54:45.168172+00:00","device_app_hash":"177a8117","app_name":"Sonarr","app_version":"10.0.0.32233","app_build":"10.0.0.32233-Debug-dev"},"device":{"type":"device","timezone":"Canada/Eastern","timezone_display_name":"(UTC-05:00) Eastern Time (Toronto)","boot_time":"2023-11-13T19:18:34.4294683+00:00"},"os":{"type":"os","raw_description":"Darwin 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000"},"runtime":{"type":"runtime","name":".NET","version":"6.0.25","raw_description":".NET 6.0.25","identifier":"osx.14-x64"},"trace":{"type":"trace","span_id":"7332702e3b2e78ef","trace_id":"191f8babcda34f2f9d49295336fe116c"}},"user":{"id":"177a8117"},"environment":"testing","sdk":{"packages":[{"name":"nuget:sentry.dotnet","version":"4.0.0-beta.0"}],"name":"sentry.dotnet","version":"4.0.0-beta.0"},"fingerprint":["Fatal","ConsoleApp","EPIC FAIL!","System.Exception","Void Main(System.String[])"],"breadcrumbs":[{"timestamp":"2023-11-18T22:54:45.882Z","message":"EPIC FAIL!","category":"ConsoleApp","level":"critical"}],"tags":{"culture":"en-CA","branch":"Debug-dev"},"debug_meta":{"images":[{"type":"pe_dotnet","debug_id":"60b50c03-1cc9-4ffb-9a10-5654e5ac9bbe-9858d4fd","debug_checksum":"SHA256:030cb560c91cfb3f9a105654e5ac9bbefdd458985d25122e166d712ad78082d6","debug_file":"/Users/bruno/git/Sonarr/_temp/obj/Sonarr.Console/Debug/net6.0/Sonarr.pdb","code_id":"655940B312000","code_file":"/Users/bruno/git/Sonarr/_output/net6.0/Sonarr.dll"}]}}
  Debug: No cached file to process.
  Debug: CachingTransport worker signal triggered.
  Debug: Flushing cached envelopes.
  Debug: No cached file to process.

@bruno-garcia bruno-garcia changed the title Crash free rate seems broken Crash free rate is broken Nov 18, 2023
@bitsandfoxes bitsandfoxes added this to GDX Nov 20, 2023
@bruno-garcia
Copy link
Member Author

Looks like I reported this 3 months ago: #2551

@bitsandfoxes bitsandfoxes self-assigned this Nov 22, 2023
@bitsandfoxes
Copy link
Contributor

I can reproduce this with a simple console app. Working on a fix..

@bruno-garcia
Copy link
Member Author

We really need tests to avoid regression, I know this broke before and I reported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants