{"record":{"id":"20eb1a699793352d","repo":"AlistGo/alist","slug":"failed-to-login-into-qbittorrent-webui-with-url","errorCode":null,"errorMessage":"failed to login into qBittorrent webui with url: {url}","messagePattern":"failed to login into qBittorrent webui with url: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/qbittorrent/client.go","lineNumber":93,"sourceCode":"func (c *client) login() error {\n\t// prepare HTTP request\n\tv := url.Values{}\n\tv.Set(\"username\", c.url.User.Username())\n\tpasswd, _ := c.url.User.Password()\n\tv.Set(\"password\", passwd)\n\tresp, err := c.post(\"/api/v2/auth/login\", v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check result\n\tbody := make([]byte, 2)\n\t_, err = resp.Body.Read(body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif string(body) != \"Ok\" {\n\t\treturn errors.New(\"failed to login into qBittorrent webui with url: \" + c.url.String())\n\t}\n\treturn nil\n}\n\nfunc (c *client) post(path string, data url.Values) (*http.Response, error) {\n\tu := c.url.JoinPath(path)\n\tu.User = nil // remove userinfo for requests\n\n\treq, err := http.NewRequest(\"POST\", u.String(), bytes.NewReader([]byte(data.Encode())))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif data != nil {\n\t\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\t}\n\n\tresp, err := c.client.Do(req)\n\tif err != nil {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/pkg/qbittorrent/client.go#L75-L111","documentation":"The qBittorrent client's login POST to /api/v2/auth/login returned a 2-byte body that is not \"Ok\". qBittorrent answers 'Ok.' on success and 'Fails.' on bad credentials; anything other than the leading \"Ok\" triggers this error, which includes the configured WebUI url.","triggerScenarios":"client.login() with wrong username/password (body \"Fails.\"), or a URL that points at a non-qBittorrent HTTP service whose response body differs.","commonSituations":"Password changed in qBittorrent but not in alist settings; URL points to qBittorrent's torrent port instead of the WebUI port; special characters in the password not URL-encoded properly.","solutions":["Re-enter the exact WebUI username/password in the alist qBittorrent settings","Confirm the URL targets the WebUI port (default 8080), not the listening torrent port","Open the same URL in a browser and log in manually to confirm credentials work, then retry"],"exampleFix":"# before\nurl: http://192.168.1.10:8080\nusername: admin\npassword: old-password\n\n# after\nurl: http://192.168.1.10:8080\nusername: admin\npassword: new-password","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := c.login()\nif err != nil && strings.Contains(err.Error(), \"failed to login into qBittorrent webui\") {\n\terr = c.login() // one retry in case of transient WebUI restart\n\tif err != nil { return fmt.Errorf(\"qBittorrent credentials rejected: %w\", err) }\n}","preventionTips":["Sync the alist qBittorrent settings whenever the WebUI password changes","Point at the WebUI port, not the BitTorrent listening port"],"tags":["qbittorrent","auth","login","credentials"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}