mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-24 07:30:57 +01:00
Intermittent crashing when jellyfin tries to access a websocket that has been disposed #7340
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#7340
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sandermoen on GitHub (Sep 22, 2025).
Description of the bug
Keeping the server running normally in Unraid will make it crash after a random amount of days/hours, I am unsure if this bug is present in installs that are not within Docker and Unraid. I've had the Jellyfin instance running concurrently for a month before and then suddenly it crashes or it might crash within the hour, very random seeminlgy.
This issue has persisted through several Jellyfin versions and is still present now.
Reproduction steps
What is the current bug behavior?
The server crashes after X amount of days with the error System.ObjectDisposedException: Cannot access a disposed object.
Seemingly trying to close a socket connection that doesn't exist anymore. Possibly a race condition?
What is the expected correct behavior?
The server shouldn't crash and should handle and check that a socket is in an acceptable state/isn't already closed when attempting to close the connection.
Jellyfin Server version
10.10.0+
Specify commit id
No response
Specify unstable release number
No response
Specify version number
No response
Specify the build version
10.10.7
Environment
Jellyfin logs
FFmpeg logs
Client / Browser logs
No response
Relevant screenshots or videos
No response
Additional information
Is it not possible to handle this error gracefully so the server at least doesn't suffer an unhandled exception and can keep on chugging?
@felix920506 commented on GitHub (Sep 23, 2025):
Can you enable debug logging?
@Sandermoen commented on GitHub (Sep 27, 2025):
Enabled now, just waiting for it to crash again to collect more data :)
@bakaxazian commented on GitHub (Oct 10, 2025):
Hello, i am having the exact same issue. I just closed the bug report i just created before i saw this post..
Please see:
https://github.com/jellyfin/jellyfin/issues/14974 for more info!
@gnattu commented on GitHub (Oct 10, 2025):
We would need debug logging for more detail as this is too hard to reproduce on our side
@bakaxazian commented on GitHub (Oct 11, 2025):
Sounds good, turned on debugging like Sandermoen and will wait for another crash.
@bakaxazian commented on GitHub (Oct 12, 2025):
Hello all,
My server has crashed again due to what looks like the same issue:
Please see the debug log of when the crash happened.
Let me know if the full log is required,
Thanks!
[2025-10-12 130218.585 -0700] [INF].txt
@Lax4ever commented on GitHub (Dec 6, 2025):
Hello!
I can also confirm this issue exists on 10.11.4
Jellyfin Version 10.11.4 (non-portable)
Running on Windows 10
[2025-12-05 19:25:28.744 -06:00] [FTL] [50] Main: Unhandled Exception
System.OperationCanceledException: The operation was canceled.
---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.WebSockets.WebSocket'.
at System.Net.WebSockets.ManagedWebSocket.ThrowIfInvalidState(WebSocketState[] validStates)
at System.Net.WebSockets.ManagedWebSocket.WriteFrameToSendBuffer(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlySpan
1 payloadBuffer) at System.Net.WebSockets.ManagedWebSocket.SendFrameFallbackAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory1 payloadBuffer, Task lockTask, CancellationToken cancellationToken)--- End of inner exception stack trace ---
at System.Net.WebSockets.ManagedWebSocket.SendFrameFallbackAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory
1 payloadBuffer, Task lockTask, CancellationToken cancellationToken) at Emby.Server.Implementations.HttpServer.WebSocketConnection.SendAsync[T](OutboundWebSocketMessage1 message, CancellationToken cancellationToken)at Emby.Server.Implementations.Session.SessionWebSocketListener.SendForceKeepAlive(IWebSocketConnection webSocket)
at Emby.Server.Implementations.Session.SessionWebSocketListener.KeepAliveSockets(Object o, EventArgs e)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
[2025-12-05 19:25:31.367 -06:00] [FTL] [17] Main: Unhandled Exception
System.OperationCanceledException: The operation was canceled.
---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.WebSockets.WebSocket'.
at System.Net.WebSockets.ManagedWebSocket.ThrowIfInvalidState(WebSocketState[] validStates)
at System.Net.WebSockets.ManagedWebSocket.WriteFrameToSendBuffer(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlySpan
1 payloadBuffer) at System.Net.WebSockets.ManagedWebSocket.SendFrameFallbackAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory1 payloadBuffer, Task lockTask, CancellationToken cancellationToken)--- End of inner exception stack trace ---
at System.Net.WebSockets.ManagedWebSocket.SendFrameFallbackAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory
1 payloadBuffer, Task lockTask, CancellationToken cancellationToken) at Emby.Server.Implementations.HttpServer.WebSocketConnection.SendAsync[T](OutboundWebSocketMessage1 message, CancellationToken cancellationToken)at Emby.Server.Implementations.Session.SessionWebSocketListener.SendForceKeepAlive(IWebSocketConnection webSocket)
at Emby.Server.Implementations.Session.SessionWebSocketListener.KeepAliveSockets(Object o, EventArgs e)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
@JKamsker commented on GitHub (Dec 13, 2025):
I can confirm the same crash signature as this issue, but on macOS (not Docker/Unraid).
Environment
/Applications/Jellyfin.app)10.0.0.0/24~/Library/Application Support/jellyfin/plugins):What happened
On 2025-12-13 00:31:59 (+01:00) a LAN client (
10.0.0.44) dropped a WebSocket without completing the close handshake.Jellyfin then attempted a keep-alive / send on a socket that was already
Aborted/disposed, and the server crashed with an unhandled exception.Result / impact
Logs (crash excerpt)
Repro (best guess)