{"record":{"id":"f6a08b98506a42a8","repo":"fish2018/pansou","slug":"anubis-w-f6a08b","errorCode":null,"errorMessage":"获取 Anubis 验证题目失败: %w","messagePattern":"获取 Anubis 验证题目失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/miosou/miosou.go","lineNumber":162,"sourceCode":"\t\tcancel()\n\t\tif err == nil {\n\t\t\tp.gateReady = true\n\t\t\treturn nil\n\t\t}\n\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()","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/miosou/miosou.go#L144-L180","documentation":"completeAnubisChallenge sends a GET to the Anubis-protected site root to fetch a proof-of-work challenge page. This error wraps the http.Client.Do failure for that initial request (miosou.go:162). ensureGate retries up to 3 times before surfacing it as 人机验证未通过.","triggerScenarios":"p.client.Do on GET baseURL+/ fails: DNS failure, connection refused/reset, TLS error, request context (gateTimeout) expired, or proxy unreachable.","commonSituations":"No internet/VPN, corporate proxy or firewall blocking the host, the miosou site being down or Anubis blocking non-browser clients, or gateTimeout being too short on slow networks.","solutions":["Check basic connectivity to the site (curl -v the baseURL) and DNS/proxy settings.","Verify the HTTP client's proxy/timeout configuration (http.Transport, http.ProxyFromEnvironment).","Rely on ensureGate's 3 retries; increase gateTimeout if the network is slow.","If Anubis blocks the client, verify setPageHeaders sends a browser-like User-Agent."],"exampleFix":"// before\nresp, err := p.client.Do(req)\nif err != nil {\n    return fmt.Errorf(\"获取 Anubis 验证题目失败: %w\", err)\n}\n// after\nresp, err := p.client.Do(req)\nif err != nil {\n    if errors.Is(err, context.DeadlineExceeded) {\n        return fmt.Errorf(\"获取 Anubis 验证题目超时: %w\", err)\n    }\n    return fmt.Errorf(\"获取 Anubis 验证题目失败: %w\", err)\n}","handlingStrategy":"retry","validationCode":"// check reachability before calling\nresp, err := http.Head(baseURL + \"/\")\nif err != nil {\n    return fmt.Errorf(\"site unreachable: %w\", err)\n}\nresp.Body.Close()","typeGuard":null,"tryCatchPattern":"err := p.ensureGate()\nif err != nil {\n    var netErr net.Error\n    if errors.As(err, &netErr) && netErr.Timeout() {\n        // back off and retry later\n    }\n    return err\n}","preventionTips":["Verify DNS/proxy settings before first use","Set explicit http.Transport timeouts and proxy config","Ensure a browser-like User-Agent is sent","Monitor the target site's availability"],"tags":["network","http","anubis","proof-of-work"],"backgroundTag":"http-request-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"}