Sonarr stopped working after a while, Too many open file

Sonarr version (exact version): 20150721
Mono version (if Sonarr is not running on Windows):3.10.0-4
OS: synology
((Debug logs)):http://pastebin.com/hKjRHN0b
(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)
Description of issue: After about a week, Sonarr stop working.At some point, I can see everything failing in the logs because “Too many open file”

I didn’t even find how to increase the File Descriptor limit on synology? Why is Sonarr opening so much file ? What should I do ?

That’s the Sonarr Synology package version (the Sonarr version is 2.0.0.4389 as shown in the logs).

We’ll need to see ((trace logs)) of the issue in order to better see where the errors are coming from.

If they’re coming from sqlite (there are errors logs for sqlite) then it may be an issue with the SQLite library.
The too many open files error is coming from web requests, which seems weird, perhaps an issue with curl or something else blocking it.

Which synology is Sonarr running on?
Which DSM version?

DS412+
DSM 6.0.2-8451 Update 2

I enabled the trace logs but since i can’t reproduce it at will, i can just wait until it crashes, may take a week or two :confused: I sent the logs from the very first occurrence of the “Too many open file”, since its something about a request to indexer, I disabled them and only kept one. Maybe something was hanging with one of them ?

I will re-enable to try to replicate.

1 Like

Can you tell me what to search in the debug logs, some text that will indicate a failure ?

I don’t know why, but I have a tons of logs with show I don’t even know about, like :

16-11-22 16:55:51.7|Debug|QualityParser|Trying to parse quality for [GJM-DDY] Flip Flappers - 07 [A0C99428].mkv
16-11-22 16:55:51.7|Debug|Parser|Quality parsed: HDTV-720p v1
16-11-22 16:55:51.7|Debug|Parser|Release Group parsed: GJM-DDY
16-11-22 16:55:51.7|Debug|Parser|Release Hash parsed: A0C99428
16-11-22 16:55:51.8|Debug|ParsingService|No matching series Flip Flappers
16-11-22 16:55:51.8|Debug|DownloadDecisionMaker|Release rejected for the following reasons: [Permanent] Unknown Series
16-11-22 16:55:51.9|Debug|Parser|Parsing string '[Kawaii] Stella no Mahou - 06 [5485C2D4].mkv’
16-11-22 16:55:51.9|Debug|Parser|Episode Parsed. Stella no Mahou - 006
16-11-22 16:55:51.9|Debug|Parser|Language parsed: English

16-11-24 16:10:24.0|Error|Sabnzbd|Unable to connect to SABnzbd, please check your settings
[v2.0.0.4389] NzbDrone.Core.Download.Clients.DownloadClientException: Unable to connect to SABnzbd, please check your settings ---> System.Net.WebException: Error: ConnectFailure (Too many open files) ---> System.Net.Sockets.SocketException: Too many open files
  at System.Net.Sockets.Socket..ctor (AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) [0x00058] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:951
  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x000cf] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net/WebConnection.cs:189
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00065] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net/HttpWebRequest.cs:971
  at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net/HttpWebRequest.cs:985
  at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x000fe] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:61
  --- End of inner exception stack trace ---
  at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.ProcessRequest (NzbDrone.Common.Http.HttpRequestBuilder requestBuilder, NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdSettings settings) [0x0003a] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:175
  at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.GetHistory (Int32 start, Int32 limit, System.String category, NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdSettings settings) [0x0004a] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:109
  at NzbDrone.Core.Download.Clients.Sabnzbd.Sabnzbd.GetHistory () [0x00000] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\Sabnzbd\Sabnzbd.cs:117

That’s the error, we’ll need to see the logs that lead up to that (as well as following it).

There’s way too many noise in the 50 log files for me to find the issue. What keywords I should look for ?

Search for the error you’re seeing… how did you find the error in the first place?

Either of these should give you results (if the error is still there):

  • Too many open files
  • ConnectFailure (Too many open files)

I found the error because Sonarr stop working, responding to web ui, it crashed. I open the logs and I found that error.

The very first occurence of this error is identical :

16-11-24 05:00:40.4|Error|Sabnzbd|Unable to connect to SABnzbd, please check your settings

[v2.0.0.4389] NzbDrone.Core.Download.Clients.DownloadClientException: Unable to connect to SABnzbd, please check your settings ---> System.Net.WebException: Error: ConnectFailure (Too many open files) ---> System.Net.Sockets.SocketException: Too many open files
  at System.Net.Sockets.Socket..ctor (AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) [0x00058] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:951
  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x000cf] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net/WebConnection.cs:189
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00065] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net/HttpWebRequest.cs:971
  at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /spksrc/native/mono/work-native/mono-3.10.0/mcs/class/System/System.Net/HttpWebRequest.cs:985
  at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x000fe] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:61
  --- End of inner exception stack trace ---
  at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.ProcessRequest (NzbDrone.Common.Http.HttpRequestBuilder requestBuilder, NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdSettings settings) [0x0003a] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:175
  at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.GetHistory (Int32 start, Int32 limit, System.String category, NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdSettings settings) [0x0004a] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:109
  at NzbDrone.Core.Download.Clients.Sabnzbd.Sabnzbd.GetHistory () [0x00000] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\Sabnzbd\Sabnzbd.cs:117

This tells me Sonarr is opening more than the default 1024 files on linux (ulimit), so I think debug logs won’t give more than that.

I haven’t found how to increase this limit on Synology.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.