{"record":{"id":"ddbe1dc05dd27927","repo":"fish2018/pansou","slug":"anubis-d","errorCode":null,"errorMessage":"Anubis 验证页返回状态码 %d","messagePattern":"Anubis 验证页返回状态码 (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/miosou/miosou.go","lineNumber":177,"sourceCode":"\tsetPageHeaders(req)\n\tresp, err := p.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"获取 Anubis 验证题目失败: %w\", err)\n\t}\n\tbody, readErr := io.ReadAll(io.LimitReader(resp.Body, 1<<20))\n\tresp.Body.Close()\n\tif readErr != nil {\n\t\treturn fmt.Errorf(\"读取 Anubis 验证题目失败: %w\", readErr)\n\t}\n\tchallenge, found, err := parseAnubisChallenge(body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\tif resp.StatusCode == http.StatusOK && !isAnubisGateResponse(resp) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"Anubis 验证页返回状态码 %d\", resp.StatusCode)\n\t}\n\n\tstartedAt := time.Now()\n\thash, nonce, err := solveAnubisChallenge(ctx, challenge.Challenge.RandomData, challenge.Rules.Difficulty)\n\tif err != nil {\n\t\treturn err\n\t}\n\telapsed := time.Since(startedAt).Milliseconds()\n\tif elapsed < 1 {\n\t\telapsed = 1\n\t}\n\tquery := url.Values{\n\t\t\"id\":          []string{challenge.Challenge.ID},\n\t\t\"response\":    []string{hash},\n\t\t\"nonce\":       []string{strconv.FormatUint(nonce, 10)},\n\t\t\"redir\":       []string{baseURL + \"/\"},\n\t\t\"elapsedTime\": []string{strconv.FormatInt(elapsed, 10)},\n\t}","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/miosou/miosou.go#L159-L195","documentation":"When the fetched page contains no parseable Anubis challenge, the code only tolerates a genuine non-gate HTTP 200 (miosou.go:177). Any other status — or a 200 that still looks like an Anubis gate (401 or /.within.website/ path) — yields this error naming the status code.","triggerScenarios":"GET baseURL+/ returns a non-200 status (401/403/429/5xx) or a 200 whose response isAnubisGateResponse (unauthorized or /.within.website/ URL) while the challenge JSON cannot be extracted from the body.","commonSituations":"Anubis rate-limiting or IP-banning the client, the site returning a maintenance/5xx page, Anubis upgrading its page format so the regex no longer matches, or a CDN serving an error page.","solutions":["Retry later — 429/ban states usually clear; ensureGate's 3 retries may not be enough for rate limits.","Check whether Anubis was upgraded and update anubisChallengePattern to match the new page markup.","Verify the User-Agent/headers in setPageHeaders are not triggering bot rejection (403).","Inspect the actual response body/status with curl to identify whether it's a block, a redirect, or a server error.","If a proxy/CDN intercepts the request, bypass or configure it properly."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"resp, err := http.Get(baseURL + \"/\")\nif err == nil {\n    if resp.StatusCode != http.StatusOK {\n        // expect gate issues; probe body for Anubis markers before proceeding\n    }\n    resp.Body.Close()\n}","typeGuard":null,"tryCatchPattern":"if err := p.ensureGate(); err != nil {\n    if strings.Contains(err.Error(), \"验证页返回状态码\") {\n        // non-200 or still gated: back off (rate limit) or report server-side issue\n    }\n    return err\n}","preventionTips":["Back off on 429 instead of hammering retries","Keep anubisChallengePattern updated with upstream Anubis changes","Send realistic browser headers","Log the offending status code and body for diagnosis"],"tags":["http","anubis","status-code","anti-bot"],"backgroundTag":"http-error-response","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}