Meant to say sqlite, my bad. It’s running sqlite 3.11.0
I’m using a mounted cloud drive, but never experienced any issues up until now. The mount has worked perfectly before and is set up in a way that sonarr can correctly analyze it. So I would be surprised if the drive would be the issue, it has never failed before with sonarr, so it would be strange to just fail without any reason. No changes have been made to the mount or the way sonarr uses the drive, just same old settings that always worked like a charm.
EDIT: I’ve found a new error that occurred, an I/O write error, but I’m fairly sure that’s because from the moment the ‘refresh disks’ segment starts running, it takes up an entire CPU core.
Pastebin for error: https://pastebin.com/gQkZtYzX
EDIT2: After further research, it appears I can ignore the above mentioned error.
EDIT: After further investigation, it seems that sonarr really has an issue with importing series from a mounted drive. I’ve done numerous fresh installs, and as soon as I point sonarr to a mounted drive to import already downloaded series, it immediately jumps up to 100% I/O wait on one CPU core. Could it be that the sonarr user doesn’t have the correct permissions to access the cloud drive or something? But wouldn’t the logs reflect such an issue then? I can try to run sonarr as root perhaps to try and import my existing series maybe, see if that helps? Adding non-existing shows to sonarr works without issues, the importing of existing makes it go crazy.
The “|Trace|Owin|SQLite error (5): database is locked” error is without a doubt related to my high I/O results.
ATTEMPT: So I tried running the sonarr instance as root and saw a much cleaner trace log, although “database is locked” errors still persisted. My statistics of my I/O wait have now gone from 100% continuous to an interrupted stream of 100% I/O. I think in the end, sonarr was able to correctly handle everything, but it took about 7 minutes for 13 episodes that I just imported. I’m not really looking forward for the hundreds remaining. If this issue can be resolved another way, that’d be a better solution.
EDIT: The attempt didn’t seem to solve the issues, they returned after I added another serie. It seems that once the DB get “locked”, it messes up any future requests and my system keeps hanging at 100% I/O on one CPU thread.
I guess this issue is created by having multiple threads open to the DB, where one could take a significant longer time than another. The issue that results in the DB lock is where one process makes a change while another is still selecting data from the database, effectively making sqlite lock the database to prevent inconsistencies. I’m unsure whether this is the actual reason of the issue, but to narrow it down, it happens in the process of refreshing series info from the disk, while it’s scanning for files and analyzing them. I presume there are simultaneous requests and pulls going on to the database, where I guess it messes up the write and read processes. SQLite WAL might prevent this?