Jellyfin Forum
Container Restarting Unexpectedly - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Container Restarting Unexpectedly (/t-container-restarting-unexpectedly)



Container Restarting Unexpectedly - Blaskowski - 2024-08-12

Hello! 

I am trying to troubleshoot and solve an issue that has recently came up with my Jellyfin Server docker install.

I started getting emails notifications from my Synology NAS on August 3rd stating the container unexpectedly stopped. Yesterday I had 5 restarts of the container and today I have had 2 so far.

Yesterday I went ahead an updated to 10.9.9 to see if that would resolve the issue and it doesn't not appear to have helped.


Code:
2024/08/12 08:18:16,stdout,"[15:18:16] [INF] [1] Main: Environment Variables: [\"[DOTNET_SYSTEM_GLOBALIZATION_INVARIANT, 1]\", \"[JELLYFIN_LOG_DIR, /config/log]\", \"[JELLYFIN_DATA_DIR, /config]\", \"[JELLYFIN_FFMPEG, /usr/lib/jellyfin-ffmpeg/ffmpeg]\", \"[JELLYFIN_WEB_DIR, /jellyfin/jellyfin-web]\", \"[JELLYFIN_CONFIG_DIR, /config/config]\", \"[JELLYFIN_CACHE_DIR, /cache]\"]
"
2024/08/12 08:18:16,stdout,[?1h=[15:18:16] [INF] [1] Main: Jellyfin version: 10.9.9

2024/08/12 08:18:02,stdout,  at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

2024/08/12 08:18:02,stdout,  at System.Threading.ThreadPoolWorkQueue.Dispatch()

2024/08/12 08:18:02,stdout,  at System.Threading.QueueUserWorkItemCallback.Execute()

2024/08/12 08:18:02,stdout,  at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)

2024/08/12 08:18:02,stdout,"  at Emby.Server.Implementations.Session.SessionWebSocketListener.KeepAliveSockets(Object o, EventArgs e)
"
2024/08/12 08:18:02,stdout,  --- End of inner exception stack trace ---

2024/08/12 08:18:02,stdout,"  at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory`1 payloadBuffer)
"
2024/08/12 08:18:02,stdout,  at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpUpgradeStream.FlushAsync(CancellationToken cancellationToken)

2024/08/12 08:18:02,stdout,  at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.<ValidateState>g__ThrowObjectDisposedException|15_0()

2024/08/12 08:18:02,stdout,Object name: 'HttpResponseStream'.

2024/08/12 08:18:02,stdout," ---> System.ObjectDisposedException: Cannot write to the response body, the response has completed.
"
2024/08/12 08:18:02,stdout,Unhandled exception. System.OperationCanceledException: The operation was canceled.

2024/08/12 08:18:02,stdout,  at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

2024/08/12 08:18:02,stdout,  at System.Threading.ThreadPoolWorkQueue.Dispatch()

2024/08/12 08:18:02,stdout,  at System.Threading.QueueUserWorkItemCallback.Execute()

2024/08/12 08:18:02,stdout,  at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)

2024/08/12 08:18:02,stdout,"  at Emby.Server.Implementations.Session.SessionWebSocketListener.KeepAliveSockets(Object o, EventArgs e)
"
2024/08/12 08:18:02,stdout,  --- End of inner exception stack trace ---

2024/08/12 08:18:02,stdout,"  at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory`1 payloadBuffer)
"
2024/08/12 08:18:02,stdout,  at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpUpgradeStream.FlushAsync(CancellationToken cancellationToken)

2024/08/12 08:18:02,stdout,  at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.<ValidateState>g__ThrowObjectDisposedException|15_0()

2024/08/12 08:18:02,stdout,Object name: 'HttpResponseStream'.

2024/08/12 08:18:02,stdout," ---> System.ObjectDisposedException: Cannot write to the response body, the response has completed.
"
2024/08/12 08:18:02,stdout,System.OperationCanceledException: The operation was canceled.

2024/08/12 08:18:02,stdout,[15:18:02] [FTL] [37] Main: Unhandled Exception


2024/08/12 15:05:30 stdout [22:05:30] [INF] [1] Main: Environment Variables: ["[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_FFMPEG, /usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_WEB_DIR, /jellyfin/jellyfin-web]", "[JELLYFIN_CACHE_DIR, /cache]", "[DOTNET_SYSTEM_GLOBALIZATION_INVARIANT, 1]", "[JELLYFIN_DATA_DIR, /config]", "[JELLYFIN_CONFIG_DIR, /config/config]"]
2024/08/12 15:05:30 stdout [?1h=[22:05:30] [INF] [1] Main: Jellyfin version: 10.9.9
2024/08/12 15:05:09 stdout   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
2024/08/12 15:05:09 stdout   at System.Threading.ThreadPoolWorkQueue.Dispatch()
2024/08/12 15:05:09 stdout   at System.Threading.QueueUserWorkItemCallback.Execute()
2024/08/12 15:05:09 stdout   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
2024/08/12 15:05:09 stdout   at Emby.Server.Implementations.Session.SessionWebSocketListener.KeepAliveSockets(Object o, EventArgs e)
2024/08/12 15:05:09 stdout   --- End of inner exception stack trace ---
2024/08/12 15:05:09 stdout   at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory`1 payloadBuffer)
2024/08/12 15:05:09 stdout   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpUpgradeStream.FlushAsync(CancellationToken cancellationToken)
2024/08/12 15:05:09 stdout   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.<ValidateState>g__ThrowObjectDisposedException|15_0()
2024/08/12 15:05:09 stdout Object name: 'HttpResponseStream'.
2024/08/12 15:05:09 stdout ---> System.ObjectDisposedException: Cannot write to the response body, the response has completed.
2024/08/12 15:05:09 stdout Unhandled exception. System.OperationCanceledException: The operation was canceled.
2024/08/12 15:05:09 stdout   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
2024/08/12 15:05:09 stdout   at System.Threading.ThreadPoolWorkQueue.Dispatch()
2024/08/12 15:05:09 stdout   at System.Threading.QueueUserWorkItemCallback.Execute()
2024/08/12 15:05:09 stdout   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
2024/08/12 15:05:09 stdout   at Emby.Server.Implementations.Session.SessionWebSocketListener.KeepAliveSockets(Object o, EventArgs e)
2024/08/12 15:05:09 stdout   --- End of inner exception stack trace ---
2024/08/12 15:05:09 stdout   at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, Boolean disableCompression, ReadOnlyMemory`1 payloadBuffer)
2024/08/12 15:05:09 stdout   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpUpgradeStream.FlushAsync(CancellationToken cancellationToken)
2024/08/12 15:05:09 stdout   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.<ValidateState>g__ThrowObjectDisposedException|15_0()
2024/08/12 15:05:09 stdout Object name: 'HttpResponseStream'.
2024/08/12 15:05:09 stdout  ---> System.ObjectDisposedException: Cannot write to the response body, the response has completed.
2024/08/12 15:05:09 stdout System.OperationCanceledException: The operation was canceled.
2024/08/12 15:05:09 stdout [22:05:09] [FTL] [107] Main: Unhandled Exception
2024/08/12 15:05:09 stdout [22:05:09] [INF] [89] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 192.168.0.78 closed
2024/08/12 15:05:09 stdout [22:05:09] [WRN] [89] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 192.168.0.78 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.


Above are the two most recent unexpected reboots from today. 

Thank you for the help and let me know if I can provide any more information.


RE: Container Restarting Unexpectedly - TheDreadPirate - 2024-08-13

Which image are you using? The official image or Linuxserver image? Can you check if this docker environment variable is set?

MALLOC_TRIM_THRESHOLD_=131072

Also experiment with capping the library scan thread counts. Dashboard > General, Parallel library scan tasks limit and Parallel image encoding limit.