{"record":{"id":"9629d3e97f9f2d2b","repo":"fish2018/pansou","slug":"anubis-w-9629d3","errorCode":null,"errorMessage":"读取 Anubis 验证题目失败: %w","messagePattern":"读取 Anubis 验证题目失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/miosou/miosou.go","lineNumber":167,"sourceCode":"\t\tlastErr = err\n\t}\n\treturn fmt.Errorf(\"[%s] 人机验证未通过: %w\", p.Name(), lastErr)\n}\n\nfunc (p *MiosouPlugin) completeAnubisChallenge(ctx context.Context) error {\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, baseURL+\"/\", nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"创建 Anubis 验证请求失败: %w\", err)\n\t}\n\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()","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/miosou/miosou.go#L149-L185","documentation":"After the challenge page is fetched, the body is read with io.ReadAll(io.LimitReader(resp.Body, 1<<20)) (1 MiB cap). This error wraps a read failure of that response body (miosou.go:167), e.g. the connection dropping mid-response or a read deadline firing.","triggerScenarios":"io.ReadAll fails while streaming the challenge HTML: connection reset, unexpected EOF, TLS read error, or server closing the connection before the body completes.","commonSituations":"Flaky mobile/unstable networks, the Anubis server closing connections under load, an aggressive proxy cutting long responses, or LB idle timeouts.","solutions":["Simply retry — ensureGate already retries completeAnubisChallenge up to 3 times.","Check for intermediate proxies/firewalls that terminate keep-alive connections.","Increase client read/idle timeouts if they are tighter than server response time.","If persistent, check whether the server is rate-limiting or closing connections (server-side logs/status page)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := p.ensureGate(); err != nil {\n    if strings.Contains(err.Error(), \"读取 Anubis 验证题目失败\") {\n        // transient body read failure: retry with backoff\n    }\n    return err\n}","preventionTips":["Retry transient read errors with exponential backoff","Avoid flaky proxies that drop keep-alive connections","Set sane client timeouts","Reuse a single well-configured http.Client with connection pooling"],"tags":["network","http","io","anubis"],"backgroundTag":"file-read-failed","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"}