Sonarr hangs when nfs share is unavaliable

Sonarr version (exact version): 3.0.9.1549
Mono version (if Sonarr is not running on Windows): 6.8.0.123
OS: FreeBSD 13.1-RELEASE-p2
Debug logs: (below)
Description of issue:

I am doing something abnormal here so I don’t see it as a Sonarr problem to deal with. Instead I am looking for suggestions from the community on how this could be pulled off. Granted it would be helpful if Sonarr didn’t hang like it does.

My Sonarr (and Sab etc) instance is on one server, and has its own scratch disk for downloading (shared with Sab). Once done it then moves/renames onto the NFS share on a separate storage server /mnt/tv.

My plan is to take the storage server offline where possible (overnight/mornings), whilst still having Sonarr grab episides ASAP.

Because the /mnt/tv folder “stops responding” (typical for NFS), eventually the Sonarr service hangs. It seems to do this before it tries grabbing anything so its not specifically failing on writing out to /mnt/tv

At this point the service will not restart - even sending SIGKILL does not stop it.

If I umount the directory (the underlying folder has the immutable bit set) it knows this and just warns in the status menu, it will still queue and download episodes in this state. Once mounted again I can restart Sonarr’s service and it will continue as normal (it wont resume without the restart).

Any suggestions? Maybe its possible to stop it scanning the folders etc? The logs show the last line(s) I receive before it gets restarted.

The only suggestion I can think so far is use autofs to keep the nfs mount unmounted as often as possible and let that deal with the problem of not being able to remount it. There is still a chance this process will hang if the timing is wrong.

2022-10-11 01:03:05.4|Error|CommandExecutor|Error occurred while executing task MessagingCleanup

[v3.0.9.1549] code = Corrupt (11), message = System.Data.SQLite.SQLiteException (0x800007EF): database disk image is malformed
database disk image is malformed
at System.Data.SQLite.SQLite3.Reset (System.Data.SQLite.SQLiteStatement stmt) [0x00088] in :0
at System.Data.SQLite.SQLite3.Step (System.Data.SQLite.SQLiteStatement stmt) [0x0006e] in :0
at System.Data.SQLite.SQLiteDataReader.NextResult () [0x00174] in :0
at System.Data.SQLite.SQLiteDataReader…ctor (System.Data.SQLite.SQLiteCommand cmd, System.Data.CommandBehavior behave) [0x0008e] in :0
at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteDataReader…ctor(System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
at System.Data.SQLite.SQLiteCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x0000c] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery (System.Data.CommandBehavior behavior) [0x00006] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery () [0x00006] in :0
at Marr.Data.DataMapper.Delete[T] (System.String tableName, System.Linq.Expressions.Expression1[TDelegate] filter) [0x00093] in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:803 at Marr.Data.DataMapper.Delete[T] (System.Linq.Expressions.Expression1[TDelegate] filter) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:777
at NzbDrone.Core.Datastore.BasicRepository1[TModel].Delete (System.Linq.Expressions.Expression1[TDelegate] filter) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\BasicRepository.cs:56
at NzbDrone.Core.Messaging.Commands.CommandRepository.Trim () [0x00022] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandRepository.cs:35
at NzbDrone.Core.Messaging.Commands.CommandQueueManager.CleanCommands () [0x00051] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandQueueManager.cs:225
at NzbDrone.Core.Messaging.Commands.CleanupCommandMessagingService.Execute (NzbDrone.Core.Messaging.Commands.MessagingCleanupCommand message) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CleanupCommandMessagingService.cs:14
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x000e0] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:96
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x00035] in /wrkdirs/usr/ports/lang/mono6.8/work/mono-6.8.0.123/external/corefx/src/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs:1795
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands () [0x00027] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:41

2022-10-11 01:08:06.6|Error|CommandExecutor|Error occurred while executing task MessagingCleanup

[v3.0.9.1549] code = Corrupt (11), message = System.Data.SQLite.SQLiteException (0x800007EF): database disk image is malformed
database disk image is malformed
at System.Data.SQLite.SQLite3.Reset (System.Data.SQLite.SQLiteStatement stmt) [0x00088] in :0
at System.Data.SQLite.SQLite3.Step (System.Data.SQLite.SQLiteStatement stmt) [0x0006e] in :0
at System.Data.SQLite.SQLiteDataReader.NextResult () [0x00174] in :0
at System.Data.SQLite.SQLiteDataReader…ctor (System.Data.SQLite.SQLiteCommand cmd, System.Data.CommandBehavior behave) [0x0008e] in :0
at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteDataReader…ctor(System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
at System.Data.SQLite.SQLiteCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x0000c] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery (System.Data.CommandBehavior behavior) [0x00006] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery () [0x00006] in :0
at Marr.Data.DataMapper.Delete[T] (System.String tableName, System.Linq.Expressions.Expression1[TDelegate] filter) [0x00093] in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:803 at Marr.Data.DataMapper.Delete[T] (System.Linq.Expressions.Expression1[TDelegate] filter) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:777
at NzbDrone.Core.Datastore.BasicRepository1[TModel].Delete (System.Linq.Expressions.Expression1[TDelegate] filter) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\BasicRepository.cs:56
at NzbDrone.Core.Messaging.Commands.CommandRepository.Trim () [0x00022] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandRepository.cs:35
at NzbDrone.Core.Messaging.Commands.CommandQueueManager.CleanCommands () [0x00051] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandQueueManager.cs:225
at NzbDrone.Core.Messaging.Commands.CleanupCommandMessagingService.Execute (NzbDrone.Core.Messaging.Commands.MessagingCleanupCommand message) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CleanupCommandMessagingService.cs:14
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x000e0] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:96
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x00035] in /wrkdirs/usr/ports/lang/mono6.8/work/mono-6.8.0.123/external/corefx/src/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs:1795
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands () [0x00027] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:41

2022-10-11 01:08:36.7|Info|RssSyncService|Starting RSS Sync
2022-10-11 01:08:39.4|Info|DownloadDecisionMaker|Processing 100 releases
2022-10-11 01:08:39.8|Info|RssSyncService|RSS Sync Completed. Reports found: 100, Reports grabbed: 0
2022-10-11 01:13:07.4|Error|CommandExecutor|Error occurred while executing task MessagingCleanup

[v3.0.9.1549] code = Corrupt (11), message = System.Data.SQLite.SQLiteException (0x800007EF): database disk image is malformed
database disk image is malformed
at System.Data.SQLite.SQLite3.Reset (System.Data.SQLite.SQLiteStatement stmt) [0x00088] in :0
at System.Data.SQLite.SQLite3.Step (System.Data.SQLite.SQLiteStatement stmt) [0x0006e] in :0
at System.Data.SQLite.SQLiteDataReader.NextResult () [0x00174] in :0
at System.Data.SQLite.SQLiteDataReader…ctor (System.Data.SQLite.SQLiteCommand cmd, System.Data.CommandBehavior behave) [0x0008e] in :0
at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteDataReader…ctor(System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
at System.Data.SQLite.SQLiteCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x0000c] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery (System.Data.CommandBehavior behavior) [0x00006] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery () [0x00006] in :0
at Marr.Data.DataMapper.Delete[T] (System.String tableName, System.Linq.Expressions.Expression1[TDelegate] filter) [0x00093] in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:803 at Marr.Data.DataMapper.Delete[T] (System.Linq.Expressions.Expression1[TDelegate] filter) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\Marr.Data\DataMapper.cs:777
at NzbDrone.Core.Datastore.BasicRepository1[TModel].Delete (System.Linq.Expressions.Expression1[TDelegate] filter) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\BasicRepository.cs:56
at NzbDrone.Core.Messaging.Commands.CommandRepository.Trim () [0x00022] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandRepository.cs:35
at NzbDrone.Core.Messaging.Commands.CommandQueueManager.CleanCommands () [0x00051] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandQueueManager.cs:225
at NzbDrone.Core.Messaging.Commands.CleanupCommandMessagingService.Execute (NzbDrone.Core.Messaging.Commands.MessagingCleanupCommand message) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CleanupCommandMessagingService.cs:14
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x000e0] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:96
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x00035] in /wrkdirs/usr/ports/lang/mono6.8/work/mono-6.8.0.123/external/corefx/src/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs:1795
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands () [0x00027] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:41

2022-10-11 01:14:37.7|Info|RefreshSeriesService|Skipping refresh of series: The 100
2022-10-11 09:18:05.1|Info|Bootstrap|Starting Sonarr - /usr/local/share/sonarr/bin/Sonarr.exe - Version 3.0.9.1549

Maybe unrelated, but your DB is corrupt, I’d suggest fixing that before investigating more time into the other issue.

Media Management options, you can disable rescanning on refresh of series, but is that actually where it’s failing? Trace logs up to the point it stops responding will be the most valuable (post them elsewhere and link them here).

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