Sonarr cannot connect to localhost, qBittorrent plugin

Hello, everyone.

I’m new here so I have a few issues.
I have been setting up Sonarr to work with my qBittorrent client. However, when I tried to set this up, all has quickly come to a halt, when I tried to test the connection.
I have entered a name, the Host is set to localhost and the Port is the preset one. However, as I test this connection, it only shows a “Unable to connect” error.

As this is my first time trying out Sonarr, I might have made a very simple mistake, but I would be very happy, if anyone could help me out, even a bit, with solving this issue.

-Genki

What do the log files show? They will have more details, enabling trace logging should also show the response from qbittorrent.

I have just retried what I did, to cause the error.
I will now post, what the logs with the relevant timestamps. Mind you, some parts of the text are in german, which I am not quite sure, why that is, as I set sonarr’s language option to english. I will try to paraphrase them in italics. If they are intended this way, then the original wording is in bold directly after that.

16-1-10 13:15:23.4|Error|RestSharpExtensions|Error communicating with server

System.Net.WebException: The connection to the remoteserver could not be established. Die Verbindung mit dem Remoteserver kann nicht hergestellt werden. —> System.Net.Sockets.SocketException: The connection could not be established, as the target computer denied to establish a connection Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 127.0.0.1:9091
bei System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
bei System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
End of the intenal exception stack (maybe stack?) monitoring Ende der internen Ausnahmestapelüberwachung
bei System.Net.HttpWebRequest.GetResponse()
bei RestSharp.Http.GetRawResponse(HttpWebRequest request)
bei RestSharp.Http.GetResponse(HttpWebRequest request)

16-1-10 13:15:23.4|Error|QBittorrent|The connection to the remoteserver could not be established. Die Verbindung mit dem Remoteserver kann nicht hergestellt werden.

System.Net.WebException: The connection to the remoteserver could not be established. Die Verbindung mit dem Remoteserver kann nicht hergestellt werden.

—> System.Net.Sockets.SocketException: The connection could not be established, as the target computer denied to establish a connection Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 127.0.0.1:9091
bei System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
bei System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
End of the intenal exception stack (maybe stack?) monitoring Ende der internen Ausnahmestapelüberwachung
bei NzbDrone.Core.Rest.RestSharpExtensions.ValidateResponse(IRestResponse response, IRestClient restClient) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Rest\RestSharpExtensions.cs:Zeile 0.
bei NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxy.GetVersion(QBittorrentSettings settings) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\qBittorrent\QBittorrentProxy.cs:Zeile 49.
bei NzbDrone.Core.Download.Clients.QBittorrent.QBittorrent.TestConnection() in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\Clients\qBittorrent\QBittorrent.cs:Zeile 201.

16-1-10 13:15:23.4|Trace|NzbDroneErrorPipeline|Handling Exception
16-1-10 13:15:23.4|Warn|NzbDroneErrorPipeline|Invalid request Validation failed:
– Unable to connect

If you need more informations, I can provide them and upload the log file itself, if you want, though as I don’t know what information is stored in it, I’d rather not. If it is necessary, please tell me.

The error is in German because your system language is set to German, the rest is English because those are message that we’re logging.

Which OS is Sonarr running on?
Which version of qBittorrent?
Is qBittorrent’s web API running on port 9091?

It looks like the API is not running on port 9091 and the connection is rejected by the OS as there isn’t anything listening on that port.

1 Like

I am running Sonarr on Windows7, my qBittorrent version is v3.3.1.
By web API, do you mean the remote control mentioned on the qBittorrent options tab “Web UI”? It is not running on port 9091. After I have turned on the mentioned remote control and entered the same port in both Sonarr and qBittorrent, it seems to work now.
Thank you very much for all your help.
If I could make a small suggestion, it might be helpful for beginners to add a tooltip in a similar style as the ssl encryption one, that mentions which port to use in this instance. However, it isn’t of high importance.

Have a nice day!

1 Like

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