Repository navigation
Closed
Description
Originally posted by @vyacheslav-volkov in #3851
I updated sentry to 5.2.0 (Android) and I see this unhandled error in logs, I think it's related:
System.InvalidOperationException: JsonElementHasWrongType, String, Number
?, in void ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType, JsonTokenType)
?, in void JsonDocument.CheckExpectedType(JsonTokenType, JsonTokenType)
?, in string JsonDocument.GetString(int, JsonTokenType)
?, in string JsonElement.GetString()
?, in Dictionary<string, string> JsonExtensions.GetStringDictionaryOrNull(JsonElement)
?, in Breadcrumb Breadcrumb.FromJson(JsonElement json)
?, in bool SelectEnumerableIterator<JsonElement, Breadcrumb>.MoveNext()
?, in new List<Breadcrumb>(IEnumerable<Breadcrumb>)
?, in List<Breadcrumb> Enumerable.ToList<Breadcrumb>(IEnumerable<Breadcrumb>)
?, in SentryEvent SentryEvent.FromJson(JsonElement, Exception)
?, in SentryEvent SentryEventExtensions.ToSentryEvent(SentryEvent, SentryOptions)
?, in SentryEvent BeforeSendCallback.Execute(SentryEvent, Hint)
?, in IntPtr IBeforeSendCallbackInvoker.n_Execute_Lio_sentry_SentryEvent_Lio_sentry_Hint_(IntPtr jnienv, IntPtr native__this, IntPtr native_p0, IntPtr native_p1)
?, in IntPtr JNINativeWrapper.Wrap_JniMarshal_PPLL_L(_JniMarshal_PPLL_L callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1)
@aritchie I don't use custom breadcrumb data, I use this sentry settings for Android:
options.Native.AnrEnabled = false;
options.Native.EnableAppComponentBreadcrumbs = false;
options.Native.EnableAppLifecycleBreadcrumbs = false;
options.Native.EnableSystemEventBreadcrumbs = false;
options.Native.EnableUserInteractionBreadcrumbs = false;
options.Native.EnableActivityLifecycleBreadcrumbs = false;
options.Native.EnableAutoActivityLifecycleTracing = false;
update 1: after I updated my app from sentry v4 to v5, I see errors in the log.
Metadata
Metadata
Assignees
Labels
No labels
Projects
- StatusShow more project fieldsDone
- StatusShow more project fieldsNo status
Activity
vyacheslav-volkov commentedon Mar 3, 2025
Maybe as a hotfix you will add a try-catch for this case and log it internally? The unhandled crash in the error tracking library is unacceptable.
dartasen commentedon Mar 3, 2025
I'm facing the same random issue
aritchie commentedon Mar 3, 2025
We'll look into this today and should be able to get it patched up this week.
aritchie commentedon Mar 3, 2025
@dartasen Could you please add any additional details you may have? Can you share your UseSentry call?
#4018 - Safety calls to json serialization between native & dotnet an…
dartasen commentedon Mar 3, 2025
@aritchie Sure, here is my Sentry setup for this error, nothing too fancy :
About the details, nothing much to provide since it's happening inside of Sentry without specific action from the end user.
Is there a built-in mechanism inside Sentry to disable breadcrumb collect and only toggle some of them ? Might help narrow down the issue to a specific category of data
dartasen commentedon Mar 4, 2025
@aritchie I dumped the parallel stack of my app booting up to this error, don't think it's that useful, but just in case.
aritchie commentedon Mar 4, 2025
@dartasen Appreciate the extra information. We are have a PR in that should fix up this issue.
dartasen commentedon Mar 4, 2025
@aritchie Awesome, is there any nightly build feed so we can test beforehand to confirm that the issue is gone ?
aritchie commentedon Mar 4, 2025
@dartasen Not at this time. Sentry doesn't do beta releases at all that I'm aware of & definitely not in the dotnet space.
jamescrosswell commentedon Mar 4, 2025
@aritchie we can make pre-releases from a branch at any time. If you think that PR could benefit from some user testing (particularly since we can't reproduce the error ourselves), we could discuss this at the sync tomorrow.
#4018 - Safety calls to/from Android Native Serialization (#4022)
AdamDiament commentedon Mar 13, 2025
Upgrading to nuget version 5.3.0 has fixed this for me