Issue connecting to qBittorrent

It was working for about a month after initial setup and now I can’t get Sonarr to connect to qBitTorrent.

Getting this exception from the Sonarr logs:

NzbDrone.Core.Download.Clients.DownloadClientException: Failed to connect to qBitTorrent, please check your settings. ---> 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:21705
   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.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse(HttpRequest request, CookieContainer cookies) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 53
   at NzbDrone.Common.Http.Dispatchers.FallbackHttpDispatcher.GetResponse(HttpRequest request, CookieContainer cookies) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\Dispatchers\FallbackHttpDispatcher.cs:line 60
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Common\Http\HttpClient.cs:line 70
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxy.AuthenticateClient(HttpRequestBuilder requestBuilder, QBittorrentSettings settings, Boolean reauthenticate) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxy.cs:line 214
   --- End of inner exception stack trace ---
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxy.AuthenticateClient(HttpRequestBuilder requestBuilder, QBittorrentSettings settings, Boolean reauthenticate) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxy.cs:line 228
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxy.ProcessRequest[TResult](HttpRequestBuilder requestBuilder, QBittorrentSettings settings) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxy.cs:line 156
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxy.GetConfig(QBittorrentSettings settings) in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxy.cs:line 53
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrent.GetItems() in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrent.cs:line 83: Failed to connect to qBitTorrent, please check your settings.

When I browse to: 127.0.0.1:21705 I get the qBittorrent Web UI and use the same login/pw in Sonarr. I have checked the Windows firewall but since it is on the same machine it shouldn’t make a difference.

OS: Windows 10
Sonarr version: 2.0.0.4689
qBittorrent: 3.3.12 (64-bit)

Can you access the qbit WebUI in IE11?
Can you check whether there are any proxy settings in IE11 enabled?

I am able to access qbit’s webUI in IE11 (see screenshot below).

I have never used IE11 so I am assuming it is the default settings. Looking through I didn’t see anything out of the ordinary.

The only thing would be a proxy connection:

The fact that it works in IE11 likely rules that out.

Can you post a screenshot of the qBittorrent settings in Sonarr?

Just checked and I have the same settings as you. Still able to log in.

Thanks for confirming. Do you have Use SSL enabled in Sonarr’s Qbittorrent settings?

Beyond a firewall or the wrong port being used, I’m not sure what else it could be.

Uninstalled and reinstalled and now it works.

Guess we will never know what happened.

Thanks for your help @markus101!

1 Like

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