{"record":{"id":"64716c176f02f1e0","repo":"Radarr/Radarr","slug":"failed-to-connect-to-qbittorrent-check-your-setti-64716c","errorCode":null,"errorMessage":"Failed to connect to qBittorrent, check your settings.","messagePattern":"Failed to connect to qBittorrent, check your settings\\.","errorType":"exception","errorClass":"DownloadClientException","httpStatus":null,"severity":"error","filePath":"src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs","lineNumber":55,"sourceCode":"                // Version request will return 404 if it doesn't exist.\n                if (response.StatusCode == HttpStatusCode.NotFound)\n                {\n                    return false;\n                }\n\n                if (response.StatusCode == HttpStatusCode.Forbidden)\n                {\n                    return true;\n                }\n\n                if (response.StatusCode == HttpStatusCode.Unauthorized)\n                {\n                    throw new DownloadClientException(\"Failed to connect to qBittorrent. Check your settings and qBittorrent configuration.\", new HttpException(response));\n                }\n\n                if (response.HasHttpError)\n                {\n                    throw new DownloadClientException(\"Failed to connect to qBittorrent, check your settings.\", new HttpException(response));\n                }\n\n                return true;\n            }\n            catch (WebException ex)\n            {\n                if (ex.Status == WebExceptionStatus.TrustFailure)\n                {\n                    throw new DownloadClientUnavailableException(\"Unable to connect to qBittorrent, certificate validation failed.\", ex);\n                }\n\n                throw new DownloadClientException(\"Failed to connect to qBittorrent, check your settings.\", ex);\n            }\n        }\n\n        public Version GetApiVersion(QBittorrentSettings settings)\n        {\n            var request = BuildRequest(settings).Resource(\"/api/v2/app/webapiVersion\");","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/Radarr/Radarr/blob/ca451608dc60c6cec754aba8d96bfa30e9468ed5/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs#L37-L73","documentation":"Thrown by the qBittorrent v2 API support probe (IsApiSupported) when the response has an HTTP error status (HasHttpError) that is not 404, 403, or 401 (the special-cased statuses). It is the generic HTTP-error fallback for the v2 support check, wrapping the response in an HttpException.","triggerScenarios":"In QBittorrentProxyV2.IsApiSupported, response.HasHttpError is true and the status is none of NotFound, Forbidden, or Unauthorized.","commonSituations":"qBittorrent Web UI returned a 5xx on the API endpoint (overloaded/crashing); a reverse proxy gateway error (502/504); the request hit an unexpected redirect or status from a misconfigured setup.","solutions":["Confirm the qBittorrent Web UI is healthy by opening it in a browser.","Check qBittorrent logs for 5xx errors on the API path.","Verify the reverse proxy (if any) forwards the v2 API path correctly.","Re-test the connection after qBittorrent has fully started."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    var supported = proxyV2.IsApiSupported(settings);\n}\ncatch (DownloadClientException ex)\n{\n    logger.Warn(ex, \"qBittorrent v2 API probe returned an unexpected HTTP error.\");\n}","preventionTips":["Confirm the qBittorrent Web UI is healthy (open it in a browser).","Check qBittorrent logs for 5xx on the API path.","Re-test after qBittorrent has fully started."],"tags":["qbittorrent","http","api-support","download-client","csharp"],"backgroundTag":null,"analyzedSha":"ca451608dc60c6cec754aba8d96bfa30e9468ed5","analyzedAt":"2026-08-13T17:21:54.115Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}