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

Failed to persist session on the file system. #3653

Closed
pulmuone opened this issue Oct 4, 2024 · 3 comments · Fixed by #3655
Closed

Failed to persist session on the file system. #3653

pulmuone opened this issue Oct 4, 2024 · 3 comments · Fixed by #3655

Comments

@pulmuone
Copy link

pulmuone commented Oct 4, 2024

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

When I start my app on Maui.iOS, I get an Exception error from Sentry.

2024-10-04 20:35:37.251 ExpiryDateScanner.iOS[1520:378218] Info: Envelope queued up: ''
Debug: Created directory for installation ID file (/var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA).
Debug: Resolved installation ID '4fff81ed-63d1-41a4-809b-22abb303548d'.
Info: Started new session (SID: 03e879f3c47b477ea0179ad05feecff9; DID: 4fff81ed-63d1-41a4-809b-22abb303548d).
Debug: Storing file /var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA/1728041737_684__1114545838.envelope.
Debug: Persisting session (SID: '03e879f3c47b477ea0179ad05feecff9') to a file.
Debug: Creating persistence directory for session file at '/var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA'.
2024-10-04 20:35:37.253 ExpiryDateScanner.iOS[1520:378218] Debug: Created directory for installation ID file (/var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA).
2024-10-04 20:35:37.255 ExpiryDateScanner.iOS[1520:378218] Debug: Resolved installation ID '4fff81ed-63d1-41a4-809b-22abb303548d'.
2024-10-04 20:35:37.256 ExpiryDateScanner.iOS[1520:378218] Info: Started new session (SID: 03e879f3c47b477ea0179ad05feecff9; DID: 4fff81ed-63d1-41a4-809b-22abb303548d).
2024-10-04 20:35:37.257 ExpiryDateScanner.iOS[1520:378259] Debug: Storing file /var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA/1728041737_684__1114545838.envelope.
2024-10-04 20:35:37.258 ExpiryDateScanner.iOS[1520:378218] Debug: Persisting session (SID: '03e879f3c47b477ea0179ad05feecff9') to a file.
2024-10-04 20:35:37.258 ExpiryDateScanner.iOS[1520:378218] Debug: Creating persistence directory for session file at '/var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA'.
Debug: Persisted session to a file '/var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA/.session'.
Debug: Envelope handed off to transport (event ID: ''). 1 items in queue.
2024-10-04 20:35:37.271 ExpiryDateScanner.iOS[1520:378218] Debug: Persisted session to a file '/var/mobile/Containers/Data/Application/F2E510BB-A8AA-4283-9F53-B5191AA45840/Library/Caches/Sentry/4D9C78D8B2C334529A61CC489DAB4D5ED749FBFA/.session'.
2024-10-04 20:35:37.273 ExpiryDateScanner.iOS[1520:378259] Debug: Envelope handed off to transport (event ID: ''). 1 items in queue.
2024-10-04 20:35:37.282 ExpiryDateScanner.iOS[1520:378218] Error: Failed to persist session on the file system.
System.ObjectDisposedException: Cannot access a closed file.
at System.IO.FileStream.Flush(Boolean flushToDisk)
at System.IO.FileStream.Flush()
at System.Text.Json.Utf8JsonWriter.Flush()
2024-10-04 20:35:37.282 ExpiryDateScanner.iOS[1520:378218] at System.Text.Json.Utf8JsonWriter.Dispose()
at Sentry.GlobalSessionManager.PersistSession(SessionUpdate update, Nullable1 pauseTimestamp) Error: Failed to persist session on the file system. System.ObjectDisposedException: Cannot access a closed file. at System.IO.FileStream.Flush(Boolean flushToDisk) at System.IO.FileStream.Flush() at System.Text.Json.Utf8JsonWriter.Flush() at System.Text.Json.Utf8JsonWriter.Dispose() at Sentry.GlobalSessionManager.PersistSession(SessionUpdate update, Nullable1 pauseTimestamp)

@getsantry
Copy link

getsantry bot commented Oct 4, 2024

Assigning to @getsentry/support for routing ⏲️

@JLuse JLuse transferred this issue from getsentry/sentry Oct 4, 2024
@jamescrosswell
Copy link
Collaborator

@pulmuone which version of the Sentry.Maui NuGet package are you referencing in your project?

@jamescrosswell
Copy link
Collaborator

@pulmuone this should be fixed in the 4.12.1 release. Let us know if you still have issues after upgrading to that version though.

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

Successfully merging a pull request may close this issue.

2 participants