Sonarr will freeze and get stuck on disk scan refreshes

I have the exact same issue just randomly sticks while scanning. I would start a scan and leave for work then come back to it still on scanning. Windows 8.1 Sonarr version 2.0.0.3004
Here is today’s log where it stopped on Ncis but it has stopped on Andromeda, Marvel’s Daredevil, Agents of Shield and more in the last 2 weeks. No new system updates downloaded, just started hanging while scanning.

15-5-13 06:56:50.4|Error|XemService|Error updating scene numbering mappings for: [259393][Fast N’ Loud]

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
— End of inner exception stack trace —
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
— End of inner exception stack trace —
at System.Net.HttpWebRequest.GetResponse()
at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\HttpClient.cs:line 94
at NzbDrone.Common.Http.HttpClient.Get[T](HttpRequest request) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\HttpClient.cs:line 169
at NzbDrone.Core.DataAugmentation.Xem.XemProxy.GetSceneTvdbMappings(Int32 id) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\DataAugmentation\Xem\XemProxy.cs:line 67
at NzbDrone.Core.DataAugmentation.Xem.XemService.PerformUpdate(Series series) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\DataAugmentation\Xem\XemService.cs:line 39

15-5-13 06:56:50.4|Info|DiskScanService|Scanning disk for Fast N’ Loud
15-5-13 06:56:50.5|Info|DiskScanService|Completed scanning disk for Fast N’ Loud
15-5-13 06:56:50.6|Info|RefreshSeriesService|Updating Info for Fast N’ Loud: Demolition Theater
15-5-13 06:56:51.3|Info|RefreshEpisodeService|Starting episode info refresh for: [287572][Fast N’ Loud: Demolition Theater]
15-5-13 06:56:51.3|Info|RefreshEpisodeService|Finished episode refresh for series: [287572][Fast N’ Loud: Demolition Theater].
15-5-13 06:56:51.3|Info|DiskScanService|Scanning disk for Fast N’ Loud: Demolition Theater
15-5-13 06:56:51.3|Info|DiskScanService|Completed scanning disk for Fast N’ Loud: Demolition Theater
15-5-13 06:56:51.3|Info|RefreshSeriesService|Updating Info for Fish Tank Kings
15-5-13 06:56:51.9|Info|RefreshEpisodeService|Starting episode info refresh for: [259249][Fish Tank Kings]
15-5-13 06:56:52.0|Info|RefreshEpisodeService|Finished episode refresh for series: [259249][Fish Tank Kings].
15-5-13 06:56:52.0|Info|DiskScanService|Scanning disk for Fish Tank Kings
15-5-13 06:56:52.0|Info|DiskScanService|Completed scanning disk for Fish Tank Kings
15-5-13 06:56:52.0|Info|RefreshSeriesService|Updating Info for Game of Thrones
15-5-13 06:56:52.7|Info|RefreshEpisodeService|Starting episode info refresh for: [121361][Game of Thrones]
15-5-13 06:56:52.7|Info|RefreshEpisodeService|Finished episode refresh for series: [121361][Game of Thrones].
15-5-13 06:56:52.7|Info|DiskScanService|Scanning disk for Game of Thrones
15-5-13 06:56:52.7|Info|DiskScanService|Completed scanning disk for Game of Thrones
15-5-13 06:56:52.8|Info|RefreshSeriesService|Updating Info for Gotham
15-5-13 06:56:53.2|Info|RefreshEpisodeService|Starting episode info refresh for: [274431][Gotham]
15-5-13 06:56:53.3|Info|RefreshEpisodeService|Finished episode refresh for series: [274431][Gotham].
15-5-13 06:56:53.3|Info|DiskScanService|Scanning disk for Gotham
15-5-13 06:56:53.3|Info|DiskScanService|Completed scanning disk for Gotham
15-5-13 06:56:53.3|Info|RefreshSeriesService|Updating Info for Grimm
15-5-13 06:56:54.2|Info|RefreshEpisodeService|Starting episode info refresh for: [248736][Grimm]
15-5-13 06:56:54.3|Info|RefreshEpisodeService|Finished episode refresh for series: [248736][Grimm].
15-5-13 06:56:54.3|Info|DiskScanService|Scanning disk for Grimm
15-5-13 06:56:54.3|Info|DiskScanService|Completed scanning disk for Grimm
15-5-13 06:56:54.3|Info|RefreshSeriesService|Updating Info for Hawaii Five-0
15-5-13 06:56:55.1|Info|RefreshEpisodeService|Starting episode info refresh for: [164541][Hawaii Five-0]
15-5-13 06:56:55.1|Info|RefreshEpisodeService|Finished episode refresh for series: [164541][Hawaii Five-0].
15-5-13 06:56:55.1|Info|DiskScanService|Scanning disk for Hawaii Five-0
15-5-13 06:56:55.2|Info|DiskScanService|Completed scanning disk for Hawaii Five-0
15-5-13 06:56:55.2|Info|RefreshSeriesService|Skipping refresh of series: Hogan’s Heroes
15-5-13 06:56:55.2|Info|DiskScanService|Scanning disk for Hogan’s Heroes
15-5-13 06:56:55.3|Info|DiskScanService|Completed scanning disk for Hogan’s Heroes
15-5-13 06:56:55.3|Info|RefreshSeriesService|Skipping refresh of series: Jericho (2006)
15-5-13 06:56:55.3|Info|DiskScanService|Scanning disk for Jericho (2006)
15-5-13 06:56:55.3|Info|DiskScanService|Completed scanning disk for Jericho (2006)
15-5-13 06:56:55.3|Info|RefreshSeriesService|Skipping refresh of series: MASH
15-5-13 06:56:55.3|Info|DiskScanService|Scanning disk for M
ASH
15-5-13 06:56:55.3|Info|DiskScanService|Completed scanning disk for MAS*H
15-5-13 06:56:55.3|Info|RefreshSeriesService|Skipping refresh of series: Magnum, P.I.
15-5-13 06:56:55.3|Info|DiskScanService|Scanning disk for Magnum, P.I.
15-5-13 06:56:55.9|Info|DiskScanService|Completed scanning disk for Magnum, P.I.
15-5-13 06:56:56.8|Info|RefreshSeriesService|Updating Info for Marvel’s Agent Carter
15-5-13 06:56:57.7|Info|RefreshEpisodeService|Starting episode info refresh for: [281485][Marvel’s Agent Carter]
15-5-13 06:56:57.7|Info|RefreshEpisodeService|Finished episode refresh for series: [281485][Marvel’s Agent Carter].
15-5-13 06:56:57.7|Info|DiskScanService|Scanning disk for Marvel’s Agent Carter
15-5-13 06:56:57.9|Info|DiskScanService|Completed scanning disk for Marvel’s Agent Carter
15-5-13 06:56:58.0|Info|RefreshSeriesService|Updating Info for Marvel’s Agents of S.H.I.E.L.D.
15-5-13 06:56:58.7|Info|RefreshEpisodeService|Starting episode info refresh for: [263365][Marvel’s Agents of S.H.I.E.L.D.]
15-5-13 06:56:58.8|Info|RefreshEpisodeService|Finished episode refresh for series: [263365][Marvel’s Agents of S.H.I.E.L.D.].
15-5-13 06:56:58.8|Info|DiskScanService|Scanning disk for Marvel’s Agents of S.H.I.E.L.D.
15-5-13 06:56:58.8|Info|DiskScanService|Completed scanning disk for Marvel’s Agents of S.H.I.E.L.D.
15-5-13 06:56:59.0|Info|RefreshSeriesService|Updating Info for Marvel’s Daredevil
15-5-13 06:57:00.5|Error|XbmcMetadata|Unable to process episode image for file: E:\Television\Marvel’s Agents of S.H.I.E.L.D\Season 2\Marvel’s Agents of S.H.I.E.L.D. S02E13 One of Us.mkv
15-5-13 06:57:02.4|Error|XbmcMetadata|Unable to process episode image for file: E:\Television\Marvel’s Agent Carter\Season 1\Marvel’s Agent Carter - S01E03 - Time and Tide.mp4
15-5-13 06:57:02.5|Info|RefreshEpisodeService|Starting episode info refresh for: [281662][Marvel’s Daredevil]
15-5-13 06:57:02.5|Info|RefreshEpisodeService|Finished episode refresh for series: [281662][Marvel’s Daredevil].
15-5-13 06:57:02.5|Info|DiskScanService|Scanning disk for Marvel’s Daredevil
15-5-13 06:57:02.5|Info|DiskScanService|Completed scanning disk for Marvel’s Daredevil
15-5-13 06:57:02.6|Info|RefreshSeriesService|Updating Info for Masters of Sex
15-5-13 06:57:03.2|Info|RefreshEpisodeService|Starting episode info refresh for: [261557][Masters of Sex]
15-5-13 06:57:03.2|Info|RefreshEpisodeService|Finished episode refresh for series: [261557][Masters of Sex].
15-5-13 06:57:03.2|Info|DiskScanService|Scanning disk for Masters of Sex
15-5-13 06:57:03.3|Info|DiskScanService|Completed scanning disk for Masters of Sex
15-5-13 06:57:03.3|Info|RefreshSeriesService|Updating Info for Mike & Molly
15-5-13 06:57:03.5|Error|RestSharpExtensions|Error communicating with server

System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9091
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
— End of inner exception stack trace —
at System.Net.HttpWebRequest.GetResponse()
at RestSharp.Http.GetRawResponse(HttpWebRequest request)
at RestSharp.Http.GetResponse(HttpWebRequest request)

15-5-13 06:57:03.5|Warn|DownloadMonitoringService|Unable to retrieve queue and history items from utorrent

System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9091
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
— End of inner exception stack trace —
at NzbDrone.Core.Rest.RestSharpExtensions.ValidateResponse(IRestResponse response, IRestClient restClient) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Rest\RestSharpExtensions.cs:line 0
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.GetAuthToken(IRestClient client) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 228
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.BuildClient(UTorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 254
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.ProcessRequest(IEnumerable`1 arguments, UTorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 174
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.GetTorrents(UTorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 71
at NzbDrone.Core.Download.Clients.UTorrent.UTorrent.GetItems() in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrent.cs:line 72
at NzbDrone.Core.Download.TrackedDownloads.DownloadMonitoringService.ProcessClientDownloads(IDownloadClient downloadClient) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\TrackedDownloads\DownloadMonitoringService.cs:line 68

15-5-13 06:57:04.1|Info|RefreshEpisodeService|Starting episode info refresh for: [164501][Mike & Molly]
15-5-13 06:57:04.2|Info|RefreshEpisodeService|Finished episode refresh for series: [164501][Mike & Molly].
15-5-13 06:57:04.2|Info|DiskScanService|Scanning disk for Mike & Molly
15-5-13 06:57:04.2|Info|DiskScanService|Completed scanning disk for Mike & Molly
15-5-13 06:57:04.3|Info|RefreshSeriesService|Updating Info for Misfit Garage
15-5-13 06:57:04.8|Info|RefreshEpisodeService|Starting episode info refresh for: [286987][Misfit Garage]
15-5-13 06:57:04.8|Info|RefreshEpisodeService|Finished episode refresh for series: [286987][Misfit Garage].
15-5-13 06:57:06.5|Info|DiskScanService|Scanning disk for Misfit Garage
15-5-13 06:57:06.6|Info|DiskScanService|Completed scanning disk for Misfit Garage
15-5-13 06:57:06.8|Info|RefreshSeriesService|Updating Info for NCIS
15-5-13 06:57:08.1|Error|XbmcMetadata|Unable to process episode image for file: E:\Television\Misfit Garage\Season 2\Misfit.Garage.S02E01.Flipped.for.a.69.Chevy.Shortbed.Part.I.720p.HDTV.x264-DHD.mkv
15-5-13 06:57:08.2|Info|RefreshEpisodeService|Starting episode info refresh for: [72108][NCIS]
15-5-13 06:57:08.3|Info|RefreshEpisodeService|Finished episode refresh for series: [72108][NCIS].
15-5-13 06:57:08.3|Info|DiskScanService|Scanning disk for NCIS
15-5-13 06:57:08.4|Info|DiskScanService|Completed scanning disk for NCIS
15-5-13 06:57:13.6|Error|RestSharpExtensions|Error communicating with server

System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9091
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
— End of inner exception stack trace —
at System.Net.HttpWebRequest.GetResponse()
at RestSharp.Http.GetRawResponse(HttpWebRequest request)
at RestSharp.Http.GetResponse(HttpWebRequest request)

15-5-13 06:57:13.6|Warn|DownloadMonitoringService|Unable to retrieve queue and history items from utorrent

System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9091
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
— End of inner exception stack trace —
at NzbDrone.Core.Rest.RestSharpExtensions.ValidateResponse(IRestResponse response, IRestClient restClient) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Rest\RestSharpExtensions.cs:line 0
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.GetAuthToken(IRestClient client) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 228
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.BuildClient(UTorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 254
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.ProcessRequest(IEnumerable`1 arguments, UTorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 174
at NzbDrone.Core.Download.Clients.UTorrent.UTorrentProxy.GetTorrents(UTorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrentProxy.cs:line 71
at NzbDrone.Core.Download.Clients.UTorrent.UTorrent.GetItems() in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\uTorrent\UTorrent.cs:line 72
at NzbDrone.Core.Download.TrackedDownloads.DownloadMonitoringService.ProcessClientDownloads(IDownloadClient downloadClient) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\TrackedDownloads\DownloadMonitoringService.cs:line 68

Your logs are full errors about being unable to connect to uTorrent, but nothing else.

Please use hastebinnor a similar service to post logs, much more readable and the thread doesn’t become a pain to scroll though.

Trace logs of the disk rescan hanging are what we need to see, but please fix that error first.

ok now this time it has hung on Eureka. It [refreshseries]scanning disk for Eureka it has been on this for about 35 minutes then I closed Sonarr and restarted with log trace. It again froze with Eureka but normally is just random it is rare to see it twice in a row. http://pastebin.com/bkhCzDq9 is the trace log. Started at 10:15am ended about 10:27:am roughly.

Thanks, I believe this issue is already fix in develop, basically a scheduled task would run into a DB lock (non-critical), then it would try to log the error and end up running into another DB lock, again non-critical and this cycle would continue until there were too many locks to deal with and Sonarr hangs.

Good to know it is an issue in development this site has helped me through most of my minor problems by reading the forum. Until a fix or update I just will try to avoid a full scan for awhile. Thank you!

A full scan is going to run every 12 hours, nothing you can do to avoid that. We are looking for confirmation that we have fixed the issue though, so if you’re able to test the [develop] (https://github.com/Sonarr/Sonarr/wiki/Release-Branches) branch out, that would be great, you can always re-install the latest master release and restore the database backup from before the update if you run into issues.

Sure will install it right after work and let you know what happens!

Installed the develop build and it still does the same thing. I notice in my process viewer that when it hangs it goes to 30-40% of my cpu after I terminate the program it sometimes completes the scan or hangs again a few times. Nothing too serious just annoying. The trace logs are nearly identical so didnt bother to post it.

Are you seeing the SQLite error (5): database is locked messages as well?

Yes seems to throw the error even sooner now but could just be my tired eyes. http://pastebin.com/ueThMh0c

Here is my about information

Version
2.0.0.3121
Mono Version
3.10.0 (tarball Mon Jan 26 02:53:37 UTC 2015)
AppData directory
/var/db/sonarr
Startup directory
/usr/pbi/sonarr-amd64/share/sonarr/NzbDrone

Running on FreeNAS-9.2.1.6-RELEASE-x64 (ddd1e39)

I restarted sonarr and it locked up again on another show. Log below:

TaskExtensions Task Error: database is locked database is locked 12:20pm
TaskExtensions Task Error: database is locked database is locked 12:19pm
TaskExtensions Task Error: database is locked database is locked 12:18pm
EventAggregator MetadataFileService failed while processing [MetadataFilesUpdated]: database is locked database is locked 12:16pm
RefreshEpisodeService Starting episode info refresh for: [289885][Gunslinger Stratos: The Animation] 12:16pm

You do get a few, but nothing that indicates that the DB locking is causing the hanging (only one at the end).

@cooler0918 Please pastebin trace log files showing the hanging.

http://pastebin.com/xZd2xBf1

Upgraded to:

Version
2.0.0.3133
Mono Version
3.10.0 (tarball Mon Jan 26 02:53:37 UTC 2015)
AppData directory
/var/db/sonarr
Startup directory
/usr/pbi/sonarr-amd64/share/sonarr/NzbDrone

The log is after upgrade.

How do I install libgdiplus? The sonarr install was off a pbi.

I restarted Jail and service, cleared logs and launch a disk refresh. Half way it blew up hard. Total app crash. Logs below:

https://app.box.com/s/5ivava263yti4gq2fnwphuqpedl1cm02

Which OS are you running Sonarr on? Ubuntu and Debian have issues with some recent kernels: Native mono crashes [kernel fix released], but other OSes may also be affected.

The jail is running an instance of FeeBSD

Doh. Are you able to capture the output from the mono command that launches Sonarr? Looking to see if you see a similar output to the errors in the thread I linked, because it sounds very similar.

Spent the last 2 weeks on the dev build and it still has the same issue so uninstalled completely and went back to the normal release. It seems to only freeze on NCIS now guess I just will have to live with it for awhile. Not a problem just wanted you informed.