SQLite errors: cannot open file and then too many open files

Sonarr version (exact version): Sonarr Ver. 2.0.0.5228
Mono version (if Sonarr is not running on Windows): 5.8.0.108
OS: Synology (SynoCommunity package 20180303-13)
Trace logs: https://pastebin.com/kM1WW0DM
Description of issue: After a 2-3 days, sonarr hangs with SQLite errors in the trace logs. Restarting the service fixes it for a couple more days.

18-8-15 03:46:55.0|Trace|Http|Req: 1423 [GET] /api/queue?sort_by=timeleft&order=asc
18-8-15 03:46:55.0|Trace|Owin|SQLite error (14): cannot open file at line 35486 of [a65a62893c]

then

18-8-15 03:46:55.0|Trace|Owin|SQLite error (14): os_unix.c:35486: (24) open(/volume1/@appstore/nzbdrone/var/.config/NzbDrone/nzbdrone.db) - Too many open files

then

[v2.0.0.5228] System.Data.SQLite.SQLiteException (0x80004005): unable to open database file
at System.Data.SQLite.SQLite3.Open (System.String strFilename, System.Data.SQLite.SQLiteConnectionFlags connectionFlags, System.Data.SQLite.SQLiteOpenFlagsEnum openFlags, System.Int32 maxPoolSize, System.Boolean usePool) [0x00074] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteConnection.Open () [0x00959] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at Marr.Data.DataMapper.OpenConnection () [0x00024] in :0
at Marr.Data.DataMapper.Query[T] (System.String sql, System.Collections.Generic.ICollection1[T] entityList, System.Boolean useAltName) [0x00065] in <aad67c5ef7e9488f9fc401912117ef28>:0 at Marr.Data.QGen.QueryBuilder1[T].ToList () [0x00052] in :0
at Marr.Data.QGen.SortBuilder1[T].ToList () [0x00000] in <aad67c5ef7e9488f9fc401912117ef28>:0 at Marr.Data.QGen.SortBuilder1[T].GetEnumerator () [0x00000] in :0
at System.Linq.Enumerable.SingleOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0003a] in :0
at NzbDrone.Core.Authentication.UserRepository.FindUser (System.Guid identifier) [0x00085] in :0
at NzbDrone.Core.Authentication.UserService.FindUser (System.Guid identifier) [0x00000] in :0
at NzbDrone.Api.Authentication.AuthenticationService.GetUserFromIdentifier (System.Guid identifier, Nancy.NancyContext context) [0x0000d] in <7b154c4ebae14bb98d2c2d5a3cebd316>:0
at Nancy.Authentication.Forms.FormsAuthentication+<>c__DisplayClass7.b__6 (Nancy.NancyContext context) [0x00026] in <91c66dca293e4531909364de82529d4c>:0
at Nancy.BeforePipeline+<>c__DisplayClass4.b__3 (Nancy.NancyContext ctx, System.Threading.CancellationToken ct) [0x00006] in <63c44d6f8d7e4f339a987bf9eb94d931>:0

then the logging stops and the thread is hung.

Which file system are you using on your synology?

Latest, DSM 6.2-23739 Update 2

Not OS version, file system.

Storage Manager: Volume then check the File System.

Oops! It’s ext4.

The link below has some information on checking the limits, though I don’t think you’d need to boost the limit as high as they suggest (or if you can even do it on Synology (not a lot of information on their forums about it).

https://community.pivotal.io/s/article/Session-failures-with-Too-many-open-files

There haven’t been many reports of with this error and I’m not sure what could cause it, since files aren’t kept open indefinitely, not really sure what to suggest to track it down and resolve it.

Thanks for the link. I will look into increasing the limit, and report back if I figure anything out.

I ended up adding “ulimit -n 4096” to /etc/profile as root (not sure this will make any difference), and adding “fs.file-nr=262144” to /etc/sysctl.conf. In addition to the link Marcus provided, I referenced this post on the Synology forums.

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