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

Console shows error when launching game in the editor #1841

Closed
bruno-garcia opened this issue Oct 13, 2024 · 2 comments
Closed

Console shows error when launching game in the editor #1841

bruno-garcia opened this issue Oct 13, 2024 · 2 comments
Labels
Bug Something isn't working Editor

Comments

@bruno-garcia
Copy link
Member

I'm updating Sentry in sentry-defenses from 1.1.0 to 2.2.0. When I launch it in the Editor, I get an error about persisting the session id.

Unity version 2022.3.46 (bump'ed in this PR)

Sentry: (Error) Failed to persist session on the file system. System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Stream has been closed'.
  at System.IO.FileStream.Flush () [0x0000d] in <606c2e0a56af495988c860a4ac613e74>:0 
  at System.Text.Json.Utf8JsonWriter.Flush () [0x00094] in <106b5ea9b1fa4ad5922e9fb9e8765bf0>:0 
  at System.Text.Json.Utf8JsonWriter.Dispose () [0x00011] in <106b5ea9b1fa4ad5922e9fb9e8765bf0>:0 
  at Sentry.GlobalSessionManager.PersistSession (Sentry.SessionUpdate update, System.Nullable`1[T] pauseTimestamp) [0x0011b] in /sentry-unity/src/sentry-dotnet/src/Sentry/GlobalSessionManager.cs:91 
UnityEngine.Logger:Log (UnityEngine.LogType,string,object)
Sentry.Unity.UnityLogger:Log (Sentry.SentryLevel,string,System.Exception,object[]) (at /sentry-unity/src/Sentry.Unity/UnityLogger.cs:33)
Sentry.Extensibility.DiagnosticLoggerExtensions:LogIfEnabled (Sentry.Extensibility.IDiagnosticLogger,Sentry.SentryLevel,System.Exception,string) (at /sentry-unity/src/sentry-dotnet/src/Sentry/Extensibility/DiagnosticLoggerExtensions.cs:478)
Sentry.Extensibility.DiagnosticLoggerExtensions:LogError (Sentry.SentryOptions,System.Exception,string) (at /sentry-unity/src/sentry-dotnet/src/Sentry/Extensibility/DiagnosticLoggerExtensions.cs:288)
Sentry.GlobalSessionManager:PersistSession (Sentry.SessionUpdate,System.Nullable`1<System.DateTimeOffset>) (at /sentry-unity/src/sentry-dotnet/src/Sentry/GlobalSessionManager.cs:95)
Sentry.GlobalSessionManager:StartSession () (at /sentry-unity/src/sentry-dotnet/src/Sentry/GlobalSessionManager.cs:242)
Sentry.Internal.Hub:StartSession () (at /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/Hub.cs:286)
Sentry.Integrations.AutoSessionTrackingIntegration:Register (Sentry.IHub,Sentry.SentryOptions) (at /sentry-unity/src/sentry-dotnet/src/Sentry/Integrations/AutoSessionTrackingIntegration.cs:9)
Sentry.Internal.Hub:.ctor (Sentry.SentryOptions,Sentry.ISentryClient,Sentry.ISessionManager,Sentry.Infrastructure.ISystemClock,Sentry.Internal.IInternalScopeManager,Sentry.Internal.RandomValuesFactory) (at /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/Hub.cs:79)
Sentry.SentrySdk:InitHub (Sentry.SentryOptions) (at /sentry-unity/src/sentry-dotnet/src/Sentry/SentrySdk.cs:80)
Sentry.SentrySdk:Init (Sentry.SentryOptions) (at /sentry-unity/src/sentry-dotnet/src/Sentry/SentrySdk.cs:204)
Sentry.Unity.SentryUnitySdk:Init (Sentry.Unity.SentryUnityOptions) (at /sentry-unity/src/Sentry.Unity/SentryUnitySDK.cs:50)
Sentry.Unity.SentryUnity:Init (Sentry.Unity.SentryUnityOptions) (at /sentry-unity/src/Sentry.Unity/SentryUnity.cs:38)
Sentry.Unity.SentryInitialization:Init () (at ./Library/PackageCache/io.sentry.unity@45693349cd/Runtime/SentryInitialization.cs:88)

Image

@bruno-garcia bruno-garcia added Bug Something isn't working Editor labels Oct 13, 2024
@lcnvdl
Copy link

lcnvdl commented Oct 14, 2024

I'm having the same issue. My Unity version is 2021.3.34f1

@bruno-garcia
Copy link
Member Author

We figured out what's wrong and fix is coming out on 2.2.1

Closing this as a dupe of:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Editor
Projects
Status: Done
Archived in project
Development

No branches or pull requests

2 participants