System.ObjectDisposedException: Cannot access a disposed object

Sonarr version (exact version): 2.0.0.4146
Mono version (if Sonarr is not running on Windows): Stable 4.2.3.4/832de4b
OS: Debian 8 (3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux)

I am getting an error using deluge. Sonaar had previously been working fine however Sonaar stopped adding new files.

Doing a bit of investigation I noticed that it was connecting to the indexers but was not able to connect to deluge anymore. When i test the connection to deluge the from the webui it gives me a “System.ObjectDisposedException: Cannot access a disposed object” error.

I upgraded sonaar to the latest version and restarted however i still get the error. Nothing else has changed on the box in the last 2 weeks. It was working fine last week but stopped sometime after last Thursday (05/05).

Below is what happens when I run it in debug mode, the error comes up straight away. Is anyone able to help?

torrents@zeus:~/.config/NzbDrone/logs$ mono --debug /opt/NzbDrone/NzbDrone.exe
[Info] Bootstrap: Starting Sonarr - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.4146
[Info] MigrationLogger: *** Migrating data source=/home/torrents/.config/NzbDrone/nzbdrone.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
[Info] MigrationLogger: *** Migrating data source=/home/torrents/.config/NzbDrone/logs.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
[Info] Router: Application mode: Interactive
[Info] OwinHostController: Listening on the following URLs:
[Info] OwinHostController: http://*:8989/
[Info] NancyBootstrapper: Starting NzbDrone API
[Error] DownloadClientCheck: Unable to communicate with Deluge_Localhost.

[v2.0.0.4146] System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure —> System.Exception: at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in :0
at System.Net.WebConnection.ReadDone (IAsyncResult result) [0x00000] in :0
at System.Net.Sockets.SocketAsyncResult.m__1 (System.Object state) [0x00000] in :0
at System.Runtime.Remoting.Messaging.AsyncResult.Invoke (System.Runtime.Remoting.Messaging.AsyncResult ) [0x00000] in :0
at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in :0
at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in :0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in :0
at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) <0x416e9420 + 0x0017f> in :0
— End of inner exception stack trace —
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) <0x416ecbe0 + 0x001ab> in :0
at System.Net.HttpWebRequest.GetResponse () <0x416eb590 + 0x0005a> in :0
at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x000e7] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:47

[Error] TaskExtensions: Task Error

[v2.0.0.4146] System.ObjectDisposedException: Cannot access a disposed object.
Object name: ‘System.Net.Sockets.NetworkStream’.
at System.Net.WebConnection.BeginWrite (System.Net.HttpWebRequest request, System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) <0x416e2a60 + 0x000a7> in :0
at System.Net.WebConnectionStream.BeginWrite (System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) <0x416e8000 + 0x00b1b> in :0

[Warn] DownloadMonitoringService: Unable to retrieve queue and history items from Deluge_Localhost

[v2.0.0.4146] System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure —> System.Exception: at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in :0
at System.Net.WebConnection.ReadDone (IAsyncResult result) [0x00000] in :0
at System.Net.Sockets.SocketAsyncResult.m__1 (System.Object state) [0x00000] in :0
at System.Runtime.Remoting.Messaging.AsyncResult.Invoke (System.Runtime.Remoting.Messaging.AsyncResult ) [0x00000] in :0
at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in :0
at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in :0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in :0
at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) <0x416e9420 + 0x0017f> in :0
— End of inner exception stack trace —
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) <0x416ecbe0 + 0x001ab> in :0
at System.Net.HttpWebRequest.GetResponse () <0x416eb590 + 0x0005a> in :0
at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x000e7] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:47

Solved with a complete reinstall of the nzbdrone and mono.

Removed all the config files from ~/.config/NzbDrone and then used “apt-get purge nzbdrone” and “apt-get purge mono” then “apt-get autoremove” to clear the system. Reinstalled everything then it reconnected.

It was a bit of a sledge hammer approach but it fixed it. Will report back if the issue comes back.

1 Like

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