linuxserver / docker-sonarr

GNU General Public License v3.0
810 stars 140 forks source link

Sonarr container "freeze" while transfering from remote mapped to local folder #122

Closed OrpheeGT closed 5 years ago

OrpheeGT commented 5 years ago

Hello,

I'm using Sonarr v3 preview docker container on a Synology NAS DSM 6.2. I did not have this issue with v2.

Sonarr hangs while downloaded torrents are copied from remote mapped folder to local NAS drive

Sonarr conf : Remote Path Mappings Host : distant_ssh_torrent_server Remote Path : /home/user/rtorrent/share/complete Local Path : /volume1/video/seedbox/

Final folder destination : /volume1/video/Series/[Name]/[Season]/

mount command (cleaned) : user@distant_ssh_torrent_server:/home/user/rtorrent/share/complete on /volume1/video/seedbox type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,al low_other) /dev/md2 on /volume1 type btrfs (rw,relatime,synoacl,space_cache=v2,auto_reclaim_space,metadata_ratio=50)

Mount command at system start :

!/bin/sh

sshfs user@distant_ssh_torrent_server :/home/user/rtorrent/share/complete /volume1/video/seedbox -o gid=100,uid=1024,allow_other,reconnect,ServerAliveInterval= 180,ServerAliveCountMax=3,compression=yes

The container freeze until the file is fully copied on the final local folder with a "ls -l" on the local folder with ssh we can see the temp file .partial~ growing.

As soon as the file is fully copied, Sonarr unfreeze.

19-8-1 13:46:09.8|Error|GlobalExceptionHandlers|Task Error

[v3.0.2.553] System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Unable to write data to the transport connection: The socket has been shut down.) ---> System.IO.IOException: Unable to write data to the transport connection: The socket has been shut down. ---> System.Net.Sockets.SocketException: The socket has been shut down at System.Net.Sockets.Socket.Send (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00016] in <048f685b456c4326be453e3cc3faae14>:0 at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in <048f685b456c4326be453e3cc3faae14>:0 --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000e2] in <048f685b456c4326be453e3cc3faae14>:0 at System.Net.ResponseStream.InternalWrite (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x0001b] in <048f685b456c4326be453e3cc3faae14>:0 at System.Net.ResponseStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000cf] in <048f685b456c4326be453e3cc3faae14>:0 at Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00024] in <5086711574984403b242554b11c41440>:0 at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write (System.ArraySegment1[T] data) [0x0001b] in <bdaa0bfa6fe64e3aae5de4f1289a957c>:0 at Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport.WriteInit (Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport transport) [0x0002a] in <bdaa0bfa6fe64e3aae5de4f1289a957c>:0 at Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport+<>c.<InitializeResponse>b__9_0 (Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport s) [0x00000] in <bdaa0bfa6fe64e3aae5de4f1289a957c>:0 at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[T1] (System.Func2[T,TResult] func, T1 arg) [0x00000] in :0 --- End of stack trace from previous location where exception was thrown ---

at Microsoft.Owin.Mapping.MapMiddleware.Invoke (System.Collections.Generic.IDictionary2[TKey,TValue] environment) [0x00126] in <e28337575f6c4665b6ecaf25ff10dac6>:0 at NzbDrone.Host.Owin.MiddleWare.AddApplicationVersionHeader.Invoke (Microsoft.Owin.IOwinContext context) [0x00046] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Owin\MiddleWare\NzbDroneVersionMiddleWare.cs:38 --- End of inner exception stack trace --- ---> (Inner Exception #0) System.IO.IOException: Unable to write data to the transport connection: The socket has been shut down. ---> System.Net.Sockets.SocketException: The socket has been shut down at System.Net.Sockets.Socket.Send (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00016] in <048f685b456c4326be453e3cc3faae14>:0 at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in <048f685b456c4326be453e3cc3faae14>:0 --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000e2] in <048f685b456c4326be453e3cc3faae14>:0 at System.Net.ResponseStream.InternalWrite (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x0001b] in <048f685b456c4326be453e3cc3faae14>:0 at System.Net.ResponseStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000cf] in <048f685b456c4326be453e3cc3faae14>:0 at Microsoft.Owin.Host.HttpListener.RequestProcessing.ExceptionFilterStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00024] in <5086711574984403b242554b11c41440>:0 at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write (System.ArraySegment1[T] data) [0x0001b] in :0 at Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport.WriteInit (Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport transport) [0x0002a] in :0 at Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport+<>c.b__9_0 (Microsoft.AspNet.SignalR.Transports.ServerSentEventsTransport s) [0x00000] in :0 at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[T1] (System.Func`2[T,TResult] func, T1 arg) [0x00000] in :0 --- End of stack trace from previous location where exception was thrown ---

at Microsoft.Owin.Mapping.MapMiddleware.Invoke (System.Collections.Generic.IDictionary`2[TKey,TValue] environment) [0x00126] in :0 at NzbDrone.Host.Owin.MiddleWare.AddApplicationVersionHeader.Invoke (Microsoft.Owin.IOwinContext context) [0x00046] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Host\Owin\MiddleWare\NzbDroneVersionMiddleWare.cs:38 <---

The memory increase a lot while transfering ~4GB RAM used, less than 200Mo usually

thelamer commented 5 years ago

https://github.com/linuxserver/docker-sonarr/pull/125 https://github.com/linuxserver/docker-sonarr/pull/124 https://github.com/linuxserver/docker-sonarr/pull/123