Sonarr not talking to Transmission correctly

Sonarr version (exact version): 2.0.0.5054
Mono version (if Sonarr is not running on Windows): 4.8.1
OS: Ubuntu 17.10
((Debug logs)): https://pastebin.com/QU9Jej9q
Description of issue: I have Sonarr and Transmission setup on the same server and I repeatedly get errors saying that “Unable to retrieve queue and history items from myTransmission: Cannot access a disposed object.
Object name: ‘System.Net.Sockets.NetworkStream’.” and downloaded files in Transmission are not removed by Sonarr as they should be. I recently upgraded from Ubuntu 16.10 to 17.10 and did not have these issues before upgrading. I am not sure where to start looking as Transmission appears to be working fine. I have tried rebooting and restarting services, but nothing helps. Any suggestions?

Please post the error with mono running with the --debug switch, that way we get line numbers with the failures.

@markus101, what is the recommended way to shutdown and start mono with the ‘–debug’ switch?

You need to run mono --debug /path/to/NzbDrone.exe, if you run it via systemd or something else you’ll have to adapt it as necessary.

@markus101, I modified my systemd setup to run mono in debug mode as requested. I will monitor this until the error appears and post it as soon as it does. Thanks!

1 Like

@markus101, sorry for the long delay in responding to this issue. I am in the midst of a family emergency, however I did capture an example of the issue. Here it is:

17-12-9 06:28:21.0|Debug|ImportDecisionMaker|File rejected for the following reasons: [Permanent] File quality does not match quality of the grabbed release, [Permanent] Not an upgrade for existing episode file(s)
17-12-9 06:29:50.3|Warn|DownloadMonitoringService|Unable to retrieve queue and history items from myTransmission

[v2.0.0.5054] System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
  at System.Net.WebConnectionStream.EndWrite (System.IAsyncResult r) [0x000af] in <5641e4edad4f4464ba58c620a7b8ea48>:0 
  at System.Net.WebConnectionStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x00059] in <5641e4edad4f4464ba58c620a7b8ea48>:0 
  at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x000d2] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:59 
  at NzbDrone.Common.Http.Dispatchers.FallbackHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x000b5] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\Dispatchers\FallbackHttpDispatcher.cs:53 
  at NzbDrone.Common.Http.HttpClient.ExecuteRequest (NzbDrone.Common.Http.HttpRequest request) [0x0007e] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\HttpClient.cs:119 
  at NzbDrone.Common.Http.HttpClient.Execute (NzbDrone.Common.Http.HttpRequest request) [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\HttpClient.cs:55 
  at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.ProcessRequest (System.String action, System.Object arguments, NzbDrone.Core.Download.Clients.Transmission.TransmissionSettings settings) [0x00072] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:262 
  at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.GetTorrentStatus (System.Collections.Generic.IEnumerable`1[T] hashStrings, NzbDrone.Core.Download.Clients.Transmission.TransmissionSettings settings) [0x0007a] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:179 
  at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.GetTorrentStatus (NzbDrone.Core.Download.Clients.Transmission.TransmissionSettings settings) [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:153 
  at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.GetTorrents (NzbDrone.Core.Download.Clients.Transmission.TransmissionSettings settings) [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:43 
  at NzbDrone.Core.Download.Clients.Transmission.TransmissionBase.GetItems () [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionBase.cs:36 
  at NzbDrone.Core.Download.TrackedDownloads.DownloadMonitoringService.ProcessClientDownloads (NzbDrone.Core.Download.IDownloadClient downloadClient) [0x0000c] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\TrackedDownloads\DownloadMonitoringService.cs:89 

No need to be sorry, family comes first.

I’m a bit confused with myself and not sure why I asked for additional information as this appears to be a known issue with mono introduced in mono 4.6 or 4.8 (possibly earlier, I forget offhand) and not fixed as of 5.4 (that I’ve seen).

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