[Bug] Websocket and Keyframes break Server #6747

Closed
opened 2026-02-07 04:03:29 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @MultigamingDE on GitHub (Feb 17, 2025).

Description of the bug

Since my medias reached a big amount it occurs, that a websocket breaks the whole server:

Keyframes Error:
ting keyframes from /mnt/mega/FTP/Serien/ZENSHU/Staffel 1/ZENSHU.S01E07.German.DL.AAC.1080p.CR.WEB.h264-DRiFTKiNG.mkv using matroska metadata failed
Feb 17 17:01:35 srv10187 jellyfin[2202692]: System.InvalidOperationException: SeekHead is missing or does not contain Info, Tracks and Cues positions. SeekHead referencing another SeekHead is not supported
Feb 17 17:01:35 srv10187 jellyfin[2202692]: at Jellyfin.MediaEncoding.Keyframes.Matroska.Extensions.EbmlReaderExtensions.ReadSeekHead(EbmlReader reader)

Reproduction steps

No Idea on what it happens

What is the current bug behavior?

It crashes the whole server

What is the expected correct behavior?

Not to crash the whole server?

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.5

Environment

- OS: Debian 12
- Linux Kernel: 6.12
- Virtualization: Docker
- Clients: Browser, Jellyfin Apps
- Browser: Firefox
- FFmpeg Version: 7.0.2
- Playback Method: Direct
- Hardware Acceleration: none
- GPU Model: none
- Plugins: 
- Reverse Proxy: npm
- Base URL:
- Networking:
- Storage: local, rclone

Jellyfin logs

[2025-02-17 17:04:25.702 +01:00] [INF] WS "External IP" request
[2025-02-17 17:04:26.778 +01:00] [ERR] Error sending web socket message Sessions
System.Net.WebSockets.WebSocketException (2): The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseReceived'
   at System.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
   at System.Net.WebSockets.ManagedWebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, WebSocketMessageFlags messageFlags, CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at MediaBrowser.Controller.Net.BasePeriodicWebSocketListener`2.SendDataInternal(TReturnDataType data, ValueTuple`3 tuple)




[2025-02-17 17:03:59.962 +01:00] [ERR] Extracting keyframes from "/mnt/mega/FTP/Serien/ZENSHU/Staffel 1/ZENSHU.S01E01.German.DL.AAC.1080p.CR.WEB.h264-DRiFTKiNG.mkv" using matroska metadata failed
System.InvalidOperationException: SeekHead is missing or does not contain Info, Tracks and Cues positions. SeekHead referencing another SeekHead is not supported
   at Jellyfin.MediaEncoding.Keyframes.Matroska.Extensions.EbmlReaderExtensions.ReadSeekHead(EbmlReader reader)
   at Jellyfin.MediaEncoding.Keyframes.Matroska.MatroskaKeyframeExtractor.GetKeyframeData(String filePath)
   at Jellyfin.MediaEncoding.Hls.Extractors.MatroskaKeyframeExtractor.TryExtractKeyframes(String filePath, KeyframeData& keyframeData)



[2025-02-17 17:03:19.000 +01:00] [ERR] Error sending web socket message Sessions
System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseReceived'
   at System.Net.WebSockets.ManagedWebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, WebSocketMessageFlags messageFlags, CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at MediaBrowser.Controller.Net.BasePeriodicWebSocketListener`2.SendDataInternal(TReturnDataType data, ValueTuple`3 tuple)

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @MultigamingDE on GitHub (Feb 17, 2025). ### Description of the bug Since my medias reached a big amount it occurs, that a websocket breaks the whole server: Keyframes Error: ting keyframes from /mnt/mega/FTP/Serien/ZENSHU/Staffel 1/ZENSHU.S01E07.German.DL.AAC.1080p.CR.WEB.h264-DRiFTKiNG.mkv using matroska metadata failed Feb 17 17:01:35 srv10187 jellyfin[2202692]: System.InvalidOperationException: SeekHead is missing or does not contain Info, Tracks and Cues positions. SeekHead referencing another SeekHead is not supported Feb 17 17:01:35 srv10187 jellyfin[2202692]: at Jellyfin.MediaEncoding.Keyframes.Matroska.Extensions.EbmlReaderExtensions.ReadSeekHead(EbmlReader reader) ### Reproduction steps No Idea on what it happens ### What is the current _bug_ behavior? It crashes the whole server ### What is the expected _correct_ behavior? Not to crash the whole server? ### 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.5 ### Environment ```markdown - OS: Debian 12 - Linux Kernel: 6.12 - Virtualization: Docker - Clients: Browser, Jellyfin Apps - Browser: Firefox - FFmpeg Version: 7.0.2 - Playback Method: Direct - Hardware Acceleration: none - GPU Model: none - Plugins: - Reverse Proxy: npm - Base URL: - Networking: - Storage: local, rclone ``` ### Jellyfin logs ```shell [2025-02-17 17:04:25.702 +01:00] [INF] WS "External IP" request [2025-02-17 17:04:26.778 +01:00] [ERR] Error sending web socket message Sessions System.Net.WebSockets.WebSocketException (2): The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseReceived' at System.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates) at System.Net.WebSockets.ManagedWebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, WebSocketMessageFlags messageFlags, CancellationToken cancellationToken) --- End of stack trace from previous location --- at MediaBrowser.Controller.Net.BasePeriodicWebSocketListener`2.SendDataInternal(TReturnDataType data, ValueTuple`3 tuple) [2025-02-17 17:03:59.962 +01:00] [ERR] Extracting keyframes from "/mnt/mega/FTP/Serien/ZENSHU/Staffel 1/ZENSHU.S01E01.German.DL.AAC.1080p.CR.WEB.h264-DRiFTKiNG.mkv" using matroska metadata failed System.InvalidOperationException: SeekHead is missing or does not contain Info, Tracks and Cues positions. SeekHead referencing another SeekHead is not supported at Jellyfin.MediaEncoding.Keyframes.Matroska.Extensions.EbmlReaderExtensions.ReadSeekHead(EbmlReader reader) at Jellyfin.MediaEncoding.Keyframes.Matroska.MatroskaKeyframeExtractor.GetKeyframeData(String filePath) at Jellyfin.MediaEncoding.Hls.Extractors.MatroskaKeyframeExtractor.TryExtractKeyframes(String filePath, KeyframeData& keyframeData) [2025-02-17 17:03:19.000 +01:00] [ERR] Error sending web socket message Sessions System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseReceived' at System.Net.WebSockets.ManagedWebSocket.SendAsync(ReadOnlyMemory`1 buffer, WebSocketMessageType messageType, WebSocketMessageFlags messageFlags, CancellationToken cancellationToken) --- End of stack trace from previous location --- at MediaBrowser.Controller.Net.BasePeriodicWebSocketListener`2.SendDataInternal(TReturnDataType data, ValueTuple`3 tuple) ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
OVERLORD added the bugstale labels 2026-02-07 04:03:29 +03:00
Author
Owner

@jellyfin-bot commented on GitHub (Jun 18, 2025):

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

@jellyfin-bot commented on GitHub (Jun 18, 2025): This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs. If you have any questions you can use one of several ways to [contact us](https://jellyfin.org/contact).
Author
Owner

@jellyfin-bot commented on GitHub (Jul 9, 2025):

This issue was closed due to inactivity.

@jellyfin-bot commented on GitHub (Jul 9, 2025): This issue was closed due to inactivity.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#6747