Closed caiofbpa closed 2 years ago
Here's a different exception that's being thrown in the same way inside the Sentry assembly:
System.AggregateException
A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ('0x00' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.)
System.Text.Json.JsonReaderException: '0x00' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
?, in void ThrowHelper.ThrowJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, ReadOnlySpan<byte> bytes)
?, in bool Utf8JsonReader.ConsumeValue(byte marker)
?, in bool Utf8JsonReader.ReadFirstToken(byte first)
?, in bool Utf8JsonReader.ReadSingleSegment()
?, in bool Utf8JsonReader.Read()
?, in void JsonDocument.Parse(ReadOnlySpan<byte> utf8JsonSpan, JsonReaderOptions readerOptions, ref MetadataDb database, ref StackRowStack stack) x 3
?, in JsonElement Json.Parse(byte[] json)
?, in async Task<IReadOnlyDictionary<string, object>> Envelope.DeserializeHeaderAsync(Stream stream, CancellationToken cancellationToken)
?, in async Task<Envelope> Envelope.DeserializeAsync(Stream stream, CancellationToken cancellationToken)
?, in async Task CachingTransport.InnerProcessCacheAsync(string file, CancellationToken cancellation) x 2
?, in async Task CachingTransport.ProcessCacheAsync(CancellationToken cancellation)
?, in async Task CachingTransport.FlushAsync(CancellationToken cancellationToken)
Here's yet another exception that's being reported as a crash coming from within the Sentry assembly:
System.AggregateException
A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Could not find file "/data/user/0/br.com.meuspedidos/files/.local/share/Sentry/EC64262B4D715A641F1FBF2FFBA5DCD08B93146A/1651680173_-6202_e2e2a80361cb47ca8c32ea45612e49d4_-1007682855.envelope")
System.IO.FileNotFoundException: Could not find file "/data/user/0/br.com.meuspedidos/files/.local/share/Sentry/EC64262B4D715A641F1FBF2FFBA5DCD08B93146A/1651680173_-6202_e2e2a80361cb47ca8c32ea45612e49d4_-1007682855.envelope"
?, in new FileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool anonymous, FileOptions options) x 2
?, in void FileSystem.CopyFile(string sourceFullPath, string destFullPath, bool overwrite)
?, in void File.Copy(string sourceFileName, string destFileName, bool overwrite)
?, in async Task<string> CachingTransport.TryPrepareNextCacheFileAsync(CancellationToken cancellationToken)
?, in async Task CachingTransport.ProcessCacheAsync(CancellationToken cancellation)
?, in async Task CachingTransport.FlushAsync(CancellationToken cancellationToken)
Hi Caio, Are you seeing those events being registered on Sentry.io or locally?
@lucas-zimerman I'm seeing them show up on sentry.io. But I've done some more digging, it seems this is an issue with CachingTransport in sentry-dotnet actually, and I've already created an issue over there: https://github.com/getsentry/sentry-dotnet/issues/1640
We're currently facing the same issue on our Production app :(
Despite being flagged as unhandled the above issues shouldn't crash the app. Once the fix is applied and released on Sentry .NET (https://github.com/getsentry/sentry-dotnet/issues/1640) I'll update the Xamarin SDK and release a new Version.
Although those exceptions don't actually crash the app, Sentry thinks it does and that impacts our Crash Free Users and Sessions metrics. For now we've ignored those exceptions, while we wait for the new version with the fix. Thanks for the help everyone!
@caiofbpa - The fix has been released in Sentry 3.17.1, bundled with Sentry.Xamarin 1.4.1. Please let us know here if this resolves the issue. Thanks.
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which SDK and version? Sentry.Xamarin 1.4.0
Steps to Reproduce
Expected Result
No crash should come from Sentry.Xamarin assemblies.
Actual Result
We're seeing this crash being reported in Sentry in our Xamarin.Droid app:
Additionally we get this assembly information:
Assembly:Sentry Version:3.16.0.0 Culture:neutral PublicKeyToken:fba2ec45388e2af0