Sonarr can't connect to qBittorrent on QNAP NAS

Sonarr version: 3.0.10.1567
Mono version: 6.12.0.200
OS: QTS 5.1.2.2533
Description of issue: I am trying to configure Sonarr to work with qBittorrent on a QNAP TS-464 NAS. I’m new to Sonarr, but did get it setup on my PC prior to this attempt at moving it to the NAS. I’m also new to Container Station/Docker.

I have both qBittorrent and Sonarr running as apps in Container Station and am able to access the web UI for both. For both apps I am using the linuxserver.io Docker-Compose yml scripts. When I try to add qBittorrent as a Download Client in Sonarr I can’t get the connection to work. The Test fails stating “Unable to connect to qBittorrent”.

I am entering the IP of the NAS and the port for the web UI. This is the address that I use to open the web UI for qBittorrent.

I’ve also tried the container IP (172.29.28.2) and the port 6881.

At one point I tried replacing the “*” in the Web UI settings for IP address with the device’s IP address, but that bricked the qBittorrent web UI and I couldn’t get back into it. I had to delete the container/app and recreate it.

Here’s the qBittorrent yml if it helps:
version: “2.1”
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1001
- PGID=100
- TZ=America/Indiana/Indianapolis
- WEBUI_PORT=9049
volumes:
- /share/Container:/config
- /share/Produced/Temp:/downloads
ports:
- 9049:9049
- 6881:6881
- 6881:6881/udp
restart: unless-stopped

I’m not sure how to get the 2 containers to talk to each other. Can anyone help me understand what I’m doing wrong?

Debug logs:
[v3.0.10.1567] NzbDrone.Core.Download.Clients.DownloadClientException: Failed to connect to qBittorrent, check your settings. —> System.Net.WebException: The operation has timed out.: ‘http://192.168.86.35:9049/api/v2/app/webapiVersion’ —> System.Net.WebException: The operation has timed out.
at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in :0
at System.Net.HttpWebRequest.GetResponse () [0x00016] in :0
at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x00123] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:81
— End of inner exception stack trace —
at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookies) [0x001c0] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:107
at NzbDrone.Common.Http.HttpClient.ExecuteRequest (NzbDrone.Common.Http.HttpRequest request, System.Net.CookieContainer cookieContainer) [0x00086] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Http\HttpClient.cs:126
at NzbDrone.Common.Http.HttpClient.Execute (NzbDrone.Common.Http.HttpRequest request) [0x00008] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Http\HttpClient.cs:59
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxyV2.IsApiSupported (NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentSettings settings) [0x00019] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxyV2.cs:36
— End of inner exception stack trace —
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxyV2.IsApiSupported (NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentSettings settings) [0x00081] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxyV2.cs:63
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.FetchProxy (NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentSettings settings) [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:87
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector+<>c__DisplayClass7_0.b__0 () [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:82
at NzbDrone.Common.Cache.Cached1[T].Get (System.String key, System.Func1[TResult] function, System.Nullable`1[T] lifeTime) [0x000b1] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Cache\Cached.cs:104
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.GetProxyCache (NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentSettings settings, System.Boolean force) [0x00049] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:82
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.GetProxy (NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentSettings settings, System.Boolean force) [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:65
at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrent.TestConnection () [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrent.cs:387

2023-10-17 09:00:36.8|Warn|SonarrErrorPipeline|Invalid request Validation failed:
– Host: Unable to connect to qBittorrent
2023-10-17 09:00:36.8|Debug|Api|[POST] /api/v3/downloadclient/test: 400.BadRequest (100026 ms)
2023-10-17 09:01:16.6|Debug|Api|[GET] /api/v3/command: 200.OK (1 ms)
2023-10-17 09:01:16.6|Debug|Api|[GET] /api/v3/command: 200.OK (1 ms)
2023-10-17 09:01:59.0|Debug|Api|[GET] /api/v3/config/host: 200.OK (5 ms)
2023-10-17 09:02:04.8|Debug|Api|[PUT] /api/v3/config/host: 202.Accepted (19 ms)
2023-10-17 09:02:05.3|Debug|Api|[GET] /api/v3/health: 200.OK (0 ms)
2023-10-17 09:02:05.3|Debug|Api|[GET] /api/v3/health: 200.OK (0 ms)
2023-10-17 09:02:07.7|Debug|Api|[GET] /api/v3/downloadclient: 200.OK (1 ms)
2023-10-17 09:02:07.7|Debug|Api|[GET] /api/v3/config/downloadclient: 200.OK (0 ms)
2023-10-17 09:02:07.7|Debug|Api|[GET] /api/v3/remotepathmapping: 200.OK (1 ms)
2023-10-17 09:02:39.8|Debug|Api|[GET] /api/v3/health: 200.OK (0 ms)
2023-10-17 09:02:39.8|Debug|Api|[GET] /api/v3/diskspace: 200.OK (40 ms)
2023-10-17 09:02:39.8|Debug|Api|[GET] /api/v3/system/status: 200.OK (1 ms)
2023-10-17 09:02:40.8|Debug|Api|[GET] /api/v3/log/file: 200.OK (1 ms)

I think I have solved this. I’ve learned a little more about Docker networks and realized that each container was being created in its own network. I added the line: “network_mode: bridge” to each Docker-Compose to prevent the creation of custom networks. Both containers are now running in the default bridge network and are able to communicate. This might not be the most secure, but it works for now.

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