{"record":{"id":"c5257b53e335f69c","repo":"AlistGo/alist","slug":"login-err-w-data-s","errorCode":null,"errorMessage":"login err: %w, data: %s","messagePattern":"login err: %w, data: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/lanzou/util.go","lineNumber":181,"sourceCode":"\t\t\t\"setSig\":       \"\",\n\t\t\t\"setScene\":     \"\",\n\t\t\t\"setTocen\":     \"\",\n\t\t\t\"formhash\":     \"\",\n\t\t})\n\t\tif d.UserAgent != \"\" {\n\t\t\treq.SetHeader(\"User-Agent\", d.UserAgent)\n\t\t}\n\t\tif acwScV2 != \"\" {\n\t\t\treq.SetCookie(&http.Cookie{Name: \"acw_sc__v2\", Value: acwScV2})\n\t\t}\n\t\tresp, err = req.Post(loginURL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif findAcwScV2Reg.Match(resp.Body()) {\n\t\t\tvs, e := CalcAcwScV2(resp.String())\n\t\t\tif e != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"login err: %w, data: %s\", e, resp.Body())\n\t\t\t}\n\t\t\tacwScV2 = vs\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\tif utils.Json.Get(resp.Body(), \"zt\").ToInt() != 1 {\n\t\treturn nil, fmt.Errorf(\"login err: %s\", resp.Body())\n\t}\n\td.Cookie = CookieToString(resp.Cookies())\n\treturn resp.Cookies(), nil\n}\n\n/*\n通过cookie获取数据\n*/\n\n// 获取文件和文件夹,获取到的文件大小、更改时间不可信","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/lanzou/util.go#L163-L199","documentation":"During LanZou account login (mlogin.php), the response matched the acw_sc__v2 challenge pattern but CalcAcwScV2 failed to extract/derive the cookie value, so login aborts with both the parse error and the raw body. The account-mode driver cannot obtain session cookies until the challenge is solved.","triggerScenarios":"Login POST returns a WAF challenge page whose arg1 payload does not match the extraction regex (format change/escaped HTML), making FindStringSubmatch fail inside CalcAcwScV2.","commonSituations":"WAF frontend updated with a new challenge variant; login attempts too frequent triggering a stricter challenge; CDN/regional differences serving incompatible challenge pages; body contains the marker string only incidentally (e.g. inside the debug log text).","solutions":["Inspect the logged body (use debug level) to identify the new challenge format","Wait several minutes and retry login — stricter challenges are often temporary after burst attempts","Update OpenList to get the current CalcAcwScV2 implementation; if maintaining a fork, widen the arg1 regex and verify the XOR key"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"func isChallengeParseFailure(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"login err:\") && strings.Contains(err.Error(), \"acw\")\n}","tryCatchPattern":"cookies, err := d.Login()\nif err != nil && isChallengeParseFailure(err) {\n    // back off: stricter WAF challenge after burst attempts\n    time.Sleep(10 * time.Minute)\n    cookies, err = d.Login()\n}","preventionTips":["Avoid tight login retry loops — they escalate the challenge strictness","Persist cookies (d.Cookie) so logins are rare rather than per-request","Keep the CalcAcwScV2 solver current via driver updates"],"tags":["lanzou","authentication","anti-bot","waf","openlist"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}