Skip to content

System.InvalidOperationException errors possibly caused by Sentry. #2344

@rodolfoBee

Description

@rodolfoBee

Environment

Unity: 6000.0.45f1
Sentry: Unity package 3.2.3

Steps to Reproduce

NA

Expected Result

No errors to be raised.

Actual Result

The app runs into System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. errors

Any logs or screenshots

The following errors are reported to Sentry with little context. Each show an action taken by Sentry when creating and sending events.

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException() in Generics__24.cpp:line 7307
  at Sentry.Protocol.Envelopes.EnvelopeItem.SerializeAsync() in Sentry__3.cpp:line 20735
  at System.Threading.ExecutionContext.RunInternal() in mscorlib__9.cpp:line 30488
  at System.Threading.ExecutionContext.RunInternal() in mscorlib__9.cpp:line 28945
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() in mscorlib__19.cpp:line 23443

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult() in Generics__24.cpp:line 7169
  at System.Text.Json.Utf8JsonWriter.DisposeAsync() in Sentry.System.Text.Json__3.cpp:line 19595
  at System.Threading.ExecutionContext.RunInternal() in mscorlib__9.cpp:line 30488
  at System.Threading.ExecutionContext.RunInternal() in mscorlib__9.cpp:line 28945
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() in mscorlib__19.cpp:line 23443

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException() in Generics__24.cpp:line 7307
  at System.Text.Json.Utf8JsonWriter.FlushAsync() in Sentry.System.Text.Json__3.cpp:line 19926
  at System.Threading.ExecutionContext.RunInternal() in mscorlib__9.cpp:line 30488
  at System.Threading.ExecutionContext.RunInternal() in mscorlib__9.cpp:line 28945
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() in mscorlib__19.cpp:line 23443

Original report: Discord

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions