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

Unable to get exception line numbers to show #3983

Open
nk-alex opened this issue Feb 19, 2025 · 23 comments · May be fixed by #4033
Open

Unable to get exception line numbers to show #3983

nk-alex opened this issue Feb 19, 2025 · 23 comments · May be fixed by #4033

Comments

@nk-alex
Copy link

nk-alex commented Feb 19, 2025

Package

Sentry.Maui

.NET Flavor

.NET

.NET Version

9.0

OS

Android

SDK Version

14.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

I initialize sentry in my MauiProgram.cs like this:

.UseSentry(options => {
	options.Dsn = "";
	options.Debug = true;
	options.AttachStacktrace = true;
})

Then I try to capture exceptions like this:

try
{
 ...
}
catch (Exception ex)
{
	SentrySdk.CaptureException(ex);
	SentrySdk.CaptureMessage(ex.ToString(), SentryLevel.Info);
}

I thought with CaptureException would have been enough. But since no line numers are showing, I also tried with CaptureMessage. No luck:

Image

Then I thought I could get line numbers information by uploading Debug Information Files. Which I did, but exceptions are still not showing exception line number information.

Image

Is sentry able to give me this information?
Am I missing anything?

I'm unable to find the problem without the line number information.

Expected Result

I would expect to find the line number where the exception is produced. I'm unable to find the problem without that information.

Actual Result

Posted above

@jamescrosswell
Copy link
Collaborator

Older (perhaps related) similar issue:

@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Feb 20, 2025

Hey @nk-alex,

It looks like you've uploaded some symbols and sources to Sentry so if you're still not seeing source context for exceptions, it seems likely Sentry isn't able to resolve to correct symbols/source.

One thing to ensure is that the version of the code that is running when exceptions are captured and sent to Sentry is exactly the same version that was built when you uploaded the symbols/source to Sentry. Otherwise you might end up with a different debug_id in the PE file for the application versus the debug_id that is included in the symbols/source being uploaded. See here for more details.

If you're doing this on a local development machine then basically you'd:

  • Build the solution
  • Upload the symbols/source files (if this isn't done automatically as part of your build process)
  • Then run the app... any errors captured in that specific build of the app should be captured with the same debug_id that was included in the symbols/source you just uploaded.

@nk-alex
Copy link
Author

nk-alex commented Feb 20, 2025

Hi @jamescrosswell, the process I've been following is pretty much what you have described:

  1. Compile on release mode.
  2. Upload application to google play.
  3. Upload debug file generated by compilation by using sentry-cli

I can get more information from the error by checking Breadcrumbs, but not much more than this. I don't know where (line) it's happening:

Image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 20, 2025
@jamescrosswell
Copy link
Collaborator

@nk-alex it would be great to get a copy of the JSON file for that event, to compare the debug_id in the event with the debug_id on the PDB that you uploaded to Sentry. If these match then that's the first pre-requisite to getting this all working.

@nk-alex
Copy link
Author

nk-alex commented Feb 21, 2025

@jamescrosswell My json for the event doesn't contain information for debug_id:

{"event_id":"06fdc54cef13456fbfd1234bd086710e","project":4508805397938256,"release":"[email protected]+97","dist":"97","platform":"csharp","message":"System.NullReferenceException: Object reference not set to an instance of an object\n   at Myapp.ViewModels.MainPageViewModel.OnNavigatedTo(INavigationParameters parameters)","datetime":"2025-02-20T13:31:20+00:00","tags":[["device","2209116AG"],["device.family","2209116AG"],["environment","production"],["level","info"],["os","Android 13"],["os.name","Android"],["os.rooted","no"],["runtime",".NET 9.0.2"],["runtime.name",".NET"],["dist","97"],["release","[email protected]+97"],["user","id:78dec457-f96e-44d4-849e-c3b267316f76"]],"_dsc":{"environment":"production","public_key":"8c618c6d35cbadbe740121ca14262c15","release":"[email protected]+97","replay_id":null,"trace_id":"feafccfa-3b60-41b5-8c9c-70aa93e513ff","transaction":null},"_metrics":{"bytes.ingested.event":17365,"bytes.stored.event":49814},"breadcrumbs":{"values":[{"timestamp":1740058278.78,"type":"default","category":"Microsoft.Maui.Controls.Element","level":"warning","message":"Microsoft.Maui.Controls.Grid is already a child of Sharpnado.Tabs.TabHostView. Remove Microsoft.Maui.Controls.Grid from Sharpnado.Tabs.TabHostView before adding to Microsoft.Maui.Controls.Border."},{"timestamp":1740058279.258,"type":"default","category":"Microsoft.Maui.Controls.Element","level":"warning","message":"Microsoft.Maui.Controls.Grid is already a child of Sharpnado.Tabs.TabHostView. Remove Microsoft.Maui.Controls.Grid from Sharpnado.Tabs.TabHostView before adding to Microsoft.Maui.Controls.Border."},{"timestamp":1740058279.268,"type":"default","category":"Microsoft.Maui.Controls.Style","level":"warning","message":"Style TargetType Sharpnado.Tabs.BottomTabItem is not compatible with element target type Sharpnado.Tabs.UnderlinedTabItem"},{"timestamp":1740058279.27,"type":"default","category":"Microsoft.Maui.Controls.Style","level":"warning","message":"Style TargetType Sharpnado.Tabs.BottomTabItem is not compatible with element target type Sharpnado.Tabs.UnderlinedTabItem"},{"timestamp":1740058280.2,"type":"default","category":"Exception","level":"fatal","message":"Object reference not set to an instance of an object"}]},"contexts":{"Current Culture":{"calendar":"GregorianCalendar","display_name":"español (España)","name":"es-ES","type":"Current Culture"},"Dynamic Code":{"Compiled":true,"Supported":true,"type":"Dynamic Code"},"Memory Info":{"allocated_bytes":7847560,"compacted":false,"concurrent":false,"finalization_pending_count":0,"fragmented_bytes":1579072,"heap_size_bytes":7192576,"high_memory_load_threshold_bytes":102640435,"pause_durations":[0,0],"total_available_memory_bytes":114044928,"total_committed_bytes":5613504,"type":"Memory Info"},"ThreadPool Info":{"available_completion_port_threads":1000,"available_worker_threads":32766,"max_completion_port_threads":1000,"max_worker_threads":32767,"min_completion_port_threads":1,"min_worker_threads":8,"type":"ThreadPool Info"},"app":{"app_start_time":"2025-02-20T13:31:17.7044084+00:00","type":"app"},"device":{"name":"Redmi Note 12 Pro","family":"2209116AG","model":"2209116AG","model_id":"TKQ1.221114.001","arch":"Arm64","battery_level":76.0,"orientation":"portrait","manufacturer":"Xiaomi","brand":"Redmi","screen_resolution":"1080x2400","screen_density":2.75,"screen_dpi":440,"online":true,"charging":false,"low_memory":false,"simulator":false,"memory_size":7934406656,"free_memory":2020048896,"storage_size":241595035648,"free_storage":157360631808,"external_storage_size":7960788992,"external_free_storage":1857093632,"boot_time":"2025-02-11T00:15:27.3025165+00:00","timezone":"Europe/Madrid","device_type":"Phone","device_unique_identifier":"ec09d781-e118-4c98-888f-da249a46082c","supports_vibration":true,"supports_accelerometer":true,"supports_gyroscope":true,"timezone_display_name":"(UTC+01:00) hora de Europa central (Madrid)","type":"device"},"os":{"os":"Android 13","name":"Android","version":"13","build":"TKQ1.221114.001 test-keys","rooted":false,"raw_description":"Linux 4.14.190-perf-g1d01cd293 #1 SMP PREEMPT Tue Dec 10 15:19:54 UTC 2024","type":"os"},"runtime":{"runtime":".NET 9.0.2","name":".NET","version":"9.0.2","raw_description":".NET 9.0.2","identifier":"android-arm64","type":"runtime"},"trace":{"trace_id":"feafccfa3b6041b58c9c70aa93e513ff","span_id":"47bb709169ac332e","status":"unknown","origin":"manual","type":"trace"}},"culprit":"","environment":"production","fingerprint":["{{ default }}"],"grouping_config":{"enhancements":"KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ","id":"newstyle:2023-01-11"},"hashes":["ff32787d4b632dfe3ec5e66b376564f7","aead6f52edc4a02513f00d1ba252e7a6"],"ingest_path":[{"version":"25.1.0","public_key":"7pLPdtCQBMLtodCJ3yOtI9MDBUWfX0k5eDa4ZP4CX6A"}],"key_id":"171458","level":"info","logentry":{"formatted":"System.NullReferenceException: Object reference not set to an instance of an object\n   at Myapp.ViewModels.MainPageViewModel.OnNavigatedTo(INavigationParameters parameters)"},"logger":"","metadata":{"in_app_frame_mix":"mixed","title":"System.NullReferenceException: Object reference not set to an instance of an object"},"modules":{"BarcodeScanning.Native.Maui":"2.1.6.0","CommunityToolkit.Maui":"11.1.0.0","CommunityToolkit.Maui.Camera":"2.0.2.0","CommunityToolkit.Maui.Core":"11.1.0.0","DryIoc":"5.4.3.0","FFImageLoading.Maui":"5.0.0.0","InputKit.Maui":"4.4.7.0","Java.Interop":"9.0.0.0","Myapp":"1.0.0.0","Myapp.resources":"1.0.0.0","LocalizationResourceManager.Maui":"1.3.0.0","LocalizationResourceManager.Maui.Core":"1.0.0.0","Maui.PDFView":"1.0.6.0","Maui.Tabs":"3.2.1.0","Microsoft.Extensions.Configuration":"9.0.0.0","Microsoft.Extensions.Configuration.Abstractions":"9.0.0.0","Microsoft.Extensions.Configuration.Binder":"9.0.0.0","Microsoft.Extensions.DependencyInjection.Abstractions":"9.0.0.0","Microsoft.Extensions.Http":"9.0.0.0","Microsoft.Extensions.Logging":"9.0.0.0","Microsoft.Extensions.Logging.Abstractions":"9.0.0.0","Microsoft.Extensions.Options":"9.0.0.0","Microsoft.Extensions.Primitives":"9.0.0.0","Microsoft.Maui":"1.0.0.0","Microsoft.Maui.Controls":"1.0.0.0","Microsoft.Maui.Controls.Xaml":"1.0.0.0","Microsoft.Maui.Essentials":"1.0.0.0","Microsoft.Maui.Graphics":"1.0.0.0","Mono.Android":"0.0.0.0","Mono.Android.Runtime":"0.0.0.0","Plainer.Maui":"1.0.0.0","Plugin.NFC":"1.0.0.0","Prism":"9.0.537.60525","Prism.Container.Abstractions":"9.0.106.9543","Prism.Container.DryIoc":"9.0.106.9543","Prism.DryIoc.Maui":"9.0.537.60525","Prism.Events":"9.0.537.60525","Prism.Maui":"9.0.537.60525","SQLite-net":"1.9.172.0","SQLitePCLRaw.batteries_v2":"2.1.2.1721","SQLitePCLRaw.core":"2.1.2.1721","SQLitePCLRaw.provider.e_sqlite3":"2.1.2.1721","Sentry":"5.1.0.0","Sentry.Android.AssemblyReader":"5.1.0.0","Sentry.Bindings.Android":"5.1.0.0","Sentry.Extensions.Logging":"5.1.0.0","Sentry.Maui":"5.1.0.0","Sharpnado.TaskMonitor":"1.0.2.0","SkiaSharp":"2.88.0.0","SkiaSharp.Extended.UI":"2.0.0.0","SkiaSharp.Skottie":"2.88.0.0","SkiaSharp.Views.Android":"2.88.0.0","SkiaSharp.Views.Maui.Controls":"2.88.0.0","SkiaSharp.Views.Maui.Core":"2.88.0.0","System.Collections":"9.0.0.0","System.Collections.Concurrent":"9.0.0.0","System.Collections.Immutable":"9.0.0.0","System.Collections.NonGeneric":"9.0.0.0","System.ComponentModel":"9.0.0.0","System.ComponentModel.TypeConverter":"9.0.0.0","System.Console":"9.0.0.0","System.Diagnostics.DiagnosticSource":"9.0.0.0","System.Diagnostics.StackTrace":"9.0.0.0","System.Diagnostics.TraceSource":"9.0.0.0","System.IO.Compression":"9.0.0.0","System.IO.Compression.Brotli":"9.0.0.0","System.IO.Compression.ZipFile":"9.0.0.0","System.IO.Pipelines":"9.0.0.0","System.Linq":"9.0.0.0","System.Linq.Expressions":"9.0.0.0","System.Memory":"9.0.0.0","System.Net.Http":"9.0.0.0","System.Net.Primitives":"9.0.0.0","System.Net.Requests":"9.0.0.0","System.Net.WebProxy":"9.0.0.0","System.Numerics.Vectors":"9.0.0.0","System.ObjectModel":"9.0.0.0","System.Private.CoreLib":"9.0.0.0","System.Private.Uri":"9.0.0.0","System.Private.Xml":"9.0.0.0","System.Reflection.Emit":"9.0.0.0","System.Reflection.Emit.ILGeneration":"9.0.0.0","System.Reflection.Metadata":"9.0.0.0","System.Runtime":"9.0.0.0","System.Runtime.InteropServices":"9.0.0.0","System.Runtime.InteropServices.RuntimeInformation":"9.0.0.0","System.Security.Cryptography":"9.0.0.0","System.Text.Encodings.Web":"9.0.0.0","System.Text.Json":"9.0.0.0","System.Text.RegularExpressions":"9.0.0.0","System.Threading":"9.0.0.0","System.Threading.Thread":"9.0.0.0","System.Threading.ThreadPool":"9.0.0.0","System.Xml.ReaderWriter":"9.0.0.0","UraniumUI":"2.11.0.0","UraniumUI.Material":"2.11.0.0","Xamarin.AndroidX.Activity":"1.0.0.0","Xamarin.AndroidX.AppCompat":"1.0.0.0","Xamarin.AndroidX.Camera.View":"1.0.0.0","Xamarin.AndroidX.CardView":"1.0.0.0","Xamarin.AndroidX.CoordinatorLayout":"1.0.0.0","Xamarin.AndroidX.Core":"1.0.0.0","Xamarin.AndroidX.CustomView":"1.0.0.0","Xamarin.AndroidX.DrawerLayout":"1.0.0.0","Xamarin.AndroidX.Fragment":"1.0.0.0","Xamarin.AndroidX.Lifecycle.Common.Jvm":"1.0.0.0","Xamarin.AndroidX.Lifecycle.ViewModel.Android":"1.0.0.0","Xamarin.AndroidX.Loader":"1.0.0.0","Xamarin.AndroidX.Navigation.Runtime":"1.0.0.0","Xamarin.AndroidX.RecyclerView":"1.0.0.0","Xamarin.AndroidX.SavedState":"1.0.0.0","Xamarin.AndroidX.SwipeRefreshLayout":"1.0.0.0","Xamarin.Google.Android.Material":"1.0.0.0","ZXing.Net.MAUI":"1.0.0.0","ZXing.Net.MAUI.Controls":"1.0.0.0","netstandard":"2.1.0.0","zxing":"0.16.9.0"},"nodestore_insert":1740058282.192806,"received":1740058280.542593,"sdk":{"name":"sentry.dotnet.maui","version":"5.1.0","packages":[{"name":"nuget:sentry.dotnet","version":"5.1.0"}]},"threads":{"values":[{"id":1,"stacktrace":{"frames":[{"function":"void JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0)","package":"Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)","package":"Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void MainActivity.OnCreate(Bundle savedInstanceState)","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void MauiAppCompatActivity.OnCreate(Bundle savedInstanceState)","package":"Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void ApplicationExtensions.CreatePlatformWindow(Activity activity, IApplication application, Bundle savedInstanceState)","package":"Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"IWindow Application.Microsoft.Maui.IApplication.CreateWindow(IActivationState activationState)","package":"Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Window Application.CreateWindow(IActivationState activationState)","package":"Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Window PrismWindowManager.CreateWindow(Application app, IActivationState activationState)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void PrismAppBuilder.OnCreateWindow()","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"PrismAppBuilder PrismAppBuilderExtensions.CreateWindow(PrismAppBuilder builder, string uri)+(IContainerProvider _, INavigationService n) => { }","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task <>c.<CreateMauiApp>b__0_10(?)+(INavigationService navigationService) => { }","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<<CreateMauiApp>b__0_10>d>(ref <<CreateMauiApp>b__0_10>d)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"async Task <>c.<CreateMauiApp>b__0_10(?)+(?) => { }","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task<INavigationResult> INavigationServiceExtensions.NavigateAsync(INavigationService navigationService, string name, INavigationParameters parameters) x 2","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task<INavigationResult> PageNavigationService.NavigateAsync(Uri uri, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<NavigateAsync>d__26>(ref <NavigateAsync>d__26)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"async Task<INavigationResult> PageNavigationService.NavigateAsync(Uri uri, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task PageNavigationService.ProcessNavigationForAbsoluteUri(Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task PageNavigationService.ProcessNavigation(Page currentPage, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<ProcessNavigation>d__29>(ref <ProcessNavigation>d__29)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"async Task PageNavigationService.ProcessNavigation(Page currentPage, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task PageNavigationService.ProcessNavigationForRootPage(string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<ProcessNavigationForRootPage>d__36>(ref <ProcessNavigationForRootPage>d__36)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"async Task PageNavigationService.ProcessNavigationForRootPage(string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"Task PageNavigationService.DoNavigateAction(Page fromPage, string toSegment, Page toPage, INavigationParameters parameters, Func<Task> navigationAction, Action<INavigationParameters> onNavigationActionCompleted)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<DoNavigateAction>d__43>(ref <DoNavigateAction>d__43)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"async Task PageNavigationService.DoNavigateAction(Page fromPage, string toSegment, Page toPage, INavigationParameters parameters, Func<Task> navigationAction, Action<INavigationParameters> onNavigationActionCompleted)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void PageNavigationService.OnNavigatedTo(Page toPage, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void MvvmHelpers.OnNavigatedTo(object page, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void MvvmHelpers.InvokeViewAndViewModelAction<INavigatedAware>(object view, Action<INavigatedAware> action)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void MvvmHelpers.OnNavigatedTo(object view, NavigationContext navigationContext)+(INavigatedAware v) => { }","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void MainPageViewModel.OnNavigatedTo(INavigationParameters parameters)","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<OnNavigatedTo>d__48>(ref <OnNavigatedTo>d__48)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"},{"function":"async void MainPageViewModel.OnNavigatedTo(INavigationParameters parameters)","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"data":{"symbolicator_status":"unknown_image"},"instruction_addr":"0x0"}]},"raw_stacktrace":{"frames":[{"function":"void JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0)","package":"Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065","in_app":false,"instruction_addr":"0x0"},{"function":"void Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)","package":"Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065","in_app":false,"instruction_addr":"0x0"},{"function":"void MainActivity.OnCreate(Bundle savedInstanceState)","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void MauiAppCompatActivity.OnCreate(Bundle savedInstanceState)","package":"Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"instruction_addr":"0x0"},{"function":"void ApplicationExtensions.CreatePlatformWindow(Activity activity, IApplication application, Bundle savedInstanceState)","package":"Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"instruction_addr":"0x0"},{"function":"IWindow Application.Microsoft.Maui.IApplication.CreateWindow(IActivationState activationState)","package":"Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"instruction_addr":"0x0"},{"function":"Window Application.CreateWindow(IActivationState activationState)","package":"Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":false,"instruction_addr":"0x0"},{"function":"Window PrismWindowManager.CreateWindow(Application app, IActivationState activationState)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void PrismAppBuilder.OnCreateWindow()","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"PrismAppBuilder PrismAppBuilderExtensions.CreateWindow(PrismAppBuilder builder, string uri)+(IContainerProvider _, INavigationService n) => { }","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task <>c.<CreateMauiApp>b__0_10(?)+(INavigationService navigationService) => { }","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<<CreateMauiApp>b__0_10>d>(ref <<CreateMauiApp>b__0_10>d)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"instruction_addr":"0x0"},{"function":"async Task <>c.<CreateMauiApp>b__0_10(?)+(?) => { }","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task<INavigationResult> INavigationServiceExtensions.NavigateAsync(INavigationService navigationService, string name, INavigationParameters parameters) x 2","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task<INavigationResult> PageNavigationService.NavigateAsync(Uri uri, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<NavigateAsync>d__26>(ref <NavigateAsync>d__26)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"instruction_addr":"0x0"},{"function":"async Task<INavigationResult> PageNavigationService.NavigateAsync(Uri uri, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task PageNavigationService.ProcessNavigationForAbsoluteUri(Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task PageNavigationService.ProcessNavigation(Page currentPage, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<ProcessNavigation>d__29>(ref <ProcessNavigation>d__29)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"instruction_addr":"0x0"},{"function":"async Task PageNavigationService.ProcessNavigation(Page currentPage, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task PageNavigationService.ProcessNavigationForRootPage(string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<ProcessNavigationForRootPage>d__36>(ref <ProcessNavigationForRootPage>d__36)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"instruction_addr":"0x0"},{"function":"async Task PageNavigationService.ProcessNavigationForRootPage(string nextSegment, Queue<string> segments, INavigationParameters parameters, bool? useModalNavigation, bool? animated)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"Task PageNavigationService.DoNavigateAction(Page fromPage, string toSegment, Page toPage, INavigationParameters parameters, Func<Task> navigationAction, Action<INavigationParameters> onNavigationActionCompleted)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<DoNavigateAction>d__43>(ref <DoNavigateAction>d__43)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"instruction_addr":"0x0"},{"function":"async Task PageNavigationService.DoNavigateAction(Page fromPage, string toSegment, Page toPage, INavigationParameters parameters, Func<Task> navigationAction, Action<INavigationParameters> onNavigationActionCompleted)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void PageNavigationService.OnNavigatedTo(Page toPage, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void MvvmHelpers.OnNavigatedTo(object page, INavigationParameters parameters)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void MvvmHelpers.InvokeViewAndViewModelAction<INavigatedAware>(object view, Action<INavigatedAware> action)","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void MvvmHelpers.OnNavigatedTo(object view, NavigationContext navigationContext)+(INavigatedAware v) => { }","package":"Prism.Maui, Version=9.0.537.60525, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void MainPageViewModel.OnNavigatedTo(INavigationParameters parameters)","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"},{"function":"void AsyncMethodBuilderCore.Start<<OnNavigatedTo>d__48>(ref <OnNavigatedTo>d__48)","package":"System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","in_app":false,"instruction_addr":"0x0"},{"function":"async void MainPageViewModel.OnNavigatedTo(INavigationParameters parameters)","package":"Myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","in_app":true,"instruction_addr":"0x0"}]},"crashed":false,"current":true}]},"timestamp":1740058280.20886,"title":"System.NullReferenceException: Object reference not set to an instance of an object","type":"default","user":{"id":"78dec457-f96e-44d4-849e-c3b267316f76","sentry_user":"id:78dec457-f96e-44d4-849e-c3b267316f76"},"version":"7","location":null}

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 21, 2025
@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Feb 23, 2025

Hm... I see all of the frames in the event have:

                            "data": {
                              "symbolicator_status": "unknown_image"
                            },
                            "instruction_addr": "0x0"

"symbolicator_status": "unknown_image" doesn't come from the SDK... so it must be created by Sentry.io (perhaps when trying to resolve symbols for the frames).

Are you able to capture a log of the envelope that the .NET SDK is sending to Sentry (rather than downloading the JSON file from Sentry once the event has been captured)? You should be able to get this from the debug window or the console in your IDE when running the application in a debugger. A lot of stuff will get logged - we're interested specifically in the envelope representing this exception event though.

@nk-alex
Copy link
Author

nk-alex commented Feb 24, 2025

@jamescrosswell I haven't been able to reproduce this on my side. I tried both debug & release mode but this exception never happens. It must be related to some client device configuration. That's why I considered adding sentry to my solution.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 24, 2025
@jamescrosswell
Copy link
Collaborator

@jamescrosswell I haven't been able to reproduce this on my side. I tried both debug & release mode but this exception never happens. It must be related to some client device configuration. That's why I considered adding sentry to my solution.

@nk-alex the lack of symbolication probably isn't specific to the exception that your clients are seeing. So you should be able to simulate one of these (it's just a null reference exception). You could do something like:

try {
    string s = null!
    Console.WriteLine($"{s!.length}");
}
catch (Exception ex)
{
    SentrySdk.CaptureException(ex);
}

At that point you should be able to see the Envelope that gets sent to Sentry when capturing the above exception (in the Debug window or console of your IDE)... and we should be able to see the frames that are being sent to Sentry. If the resulting event that you see in Sentry.io is not symbolicated correctly (which I don't think it will be) then we've managed to reproduce the problem.

@nk-alex
Copy link
Author

nk-alex commented Feb 25, 2025

@jamescrosswell sorry for the confusion. I thought you were asking specifically for the output/debug window form that exception. I put your code on my application and that's what I get:

[DOTNET]   Debug: No permission to read battery state from the device.
[0:]   Debug: No permission to read battery state from the device.
[DOTNET]   Debug: Event not sampled.
[0:]   Debug: Event not sampled.
[DOTNET]   Debug: Enqueuing envelope ed2f082308a74386871c5aa19fa211eb
[0:]   Debug: Enqueuing envelope ed2f082308a74386871c5aa19fa211eb
[DOTNET]    Info: Envelope queued up: 'ed2f082308a74386871c5aa19fa211eb'
[0:]    Info: Envelope queued up: 'ed2f082308a74386871c5aa19fa211eb'
[DOTNET]   Debug: Storing file /data/user/0/io.myapp.com/cache/Sentry/1CD108B95E40862991AA7C4BA5C8BA3EC466A400/1740469306_7039_ed2f082308a74386871c5aa19fa211eb_796657433.envelope.
[0:]   Debug: Storing file /data/user/0/io.myapp.com/cache/Sentry/1CD108B95E40862991AA7C4BA5C8BA3EC466A400/1740469306_7039_ed2f082308a74386871c5aa19fa211eb_796657433.envelope.
[DOTNET]   Debug: Envelope handed off to transport (event ID: 'ed2f082308a74386871c5aa19fa211eb'). 1 items in queue.
[DOTNET]   Debug: Android: Overwriting breadcrumbs.json in scope cache
[0:]   Debug: Envelope handed off to transport (event ID: 'ed2f082308a74386871c5aa19fa211eb'). 1 items in queue.

This is what my sentry dashboard shows me about this error:

Image

So here I can clearly see the line where it happened.

But on other exceptions I don't have that information.

Image

(Both of the exceptions are from the same release version. The only difference is one being from debug mode and the second one being from release mode)

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 25, 2025
@nk-alex
Copy link
Author

nk-alex commented Feb 27, 2025

@bruno-garcia Since is a company application I can share the link only via mail

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 27, 2025
@bruno-garcia
Copy link
Member

np, mine is my first name at sentry io

@nk-alex
Copy link
Author

nk-alex commented Feb 28, 2025

@bruno-garcia I sent you some links

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 28, 2025
@bruno-garcia
Copy link
Member

bruno-garcia commented Feb 28, 2025

Thank you.

First problem looks like Android exceptions, captured through UnhandledExceptionRaiser. SDK sentry.dotnet.maui version 5.1.0.
.NET version 9.0.2

private static void AndroidEnvironment_UnhandledExceptionRaiser(object? _, RaiseThrowableEventArgs e)
{
var description = "This exception was caught by the Android global error handler.";
if (!e.Handled)
{
description += " The application likely crashed as a result of this exception.";
}
e.Exception.SetSentryMechanism("UnhandledExceptionRaiser", description, e.Handled);
CaptureException(e.Exception);
if (!e.Handled)
{
Close();
}

We're adding debug_meta to the event for some reason. So Sentry doesn't know what symbols to load. I do see a pdb was uploaded to Sentry so it seems that the debug_meta is all that's missing.

I also saw the iOS crashes don't have line numbers. And are also missing debug_meta in the events. And even frames from .NET itself that should be symbolicate through nuget.org's symbols have no line number.


Second one is a native crash SIGSEGV, Segfault. Captured through sentry.native.android.dotnet version 0.7.16. It does have debug_meta though. But there's no native debug file in Sentry, so it can't symbolicate things.
Any chance you have still all files from under bin (or even obj) perhaps? If so, you could upload everything and see if what's needed to symbolicate is still there.

@vaind
Copy link
Collaborator

vaind commented Feb 28, 2025

@nk-alex what's the project configuration regarding trimming, AOT, etc?

@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Mar 3, 2025

So I think I'm able to reproduce this with the Sentry.Samples.Maui app. When I run this in Debug mode, I'm seeing source context:

Image

But for the same exception in Release mode, there's no source context and no line numbers:

Image

In both cases, the source debug companion file is uploaded and present on Sentry.

@jamescrosswell
Copy link
Collaborator

It looks like we're not able to find the debug image for the frame:

03-03 19:45:25.765 17228 17228 I DOTNET  :   Info: Capturing event.
03-03 19:45:25.769 17228 17228 I DOTNET  :   Debug: Running processor on exception: This exception was thrown and captured manually, without crashing the app.
03-03 19:45:25.772 17228 17228 I DOTNET  :   Debug: Creating SentryStackTrace. isCurrentStackTrace: False.
03-03 19:45:25.787 17228 17228 I DOTNET  :   Debug: Opening APK: /data/app/~~I37eGdMitCWkwQu75Wu7pA==/io.sentry.dotnet.samples.maui-iqW_7F87BnQXZizgf0-bPA==/base.apk
03-03 19:45:25.796 17228 17228 I DOTNET  :   Debug: APK doesn't use AssemblyStore
03-03 19:45:25.796 17228 17228 I DOTNET  :   Debug: Couldn't find assembly Sentry.Samples.Maui.dll in the APK
03-03 19:45:25.796 17228 17228 I DOTNET  :   Debug: Skipping debug image for module 'Sentry.Samples.Maui.dll' because assembly wasn't found: 'Sentry.Samples.Maui.dll'
03-03 19:45:25.799 17228 17228 I DOTNET  :   Debug: Created DebugStackTrace with 1 frames.
03-03 19:45:25.804 17228 17228 I DOTNET  :   Debug: Running main event processor on: Event 17bda4b9c3054aff91d824be974e6d8d
03-03 19:45:25.809 17228 17228 I DOTNET  :   Debug: Merging 0 debug images from stacktrace.

Which comes from here:

// Finally, admit defeat
options.LogDebug("Skipping debug image for module '{0}' because assembly wasn't found: '{1}'",
moduleName, assemblyName);
return null;

@nk-alex
Copy link
Author

nk-alex commented Mar 3, 2025

@vaind

Image

The pdb file uploaded to sentry was via sentry-cli (directly downloaded form https://github.com/getsentry/sentry-cli). This pdb file is related to Android app version 1.2.0.7 and iOS app version 83.

By the way, this application release (Android 1.2.0.7 and iOS 83) doesn't use SentrySdk.Flush().

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Mar 3, 2025
@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Mar 4, 2025

Aha... I suspect this is related to:

And here is a hint as to what's changed:

@jamescrosswell
Copy link
Collaborator

Just an update, I've identified the issue here. All that's left to do now is implement the solution.

For details, see the parent issue:

@nk-alex
Copy link
Author

nk-alex commented Mar 7, 2025

Thank you all for the support and dedication. I'll keep an eye on this issue, tell me if I can provide any helpful logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants