{"record":{"id":"7fdf8fed6d5609e2","repo":"fish2018/pansou","slug":"s-w-7fdf8f","errorCode":null,"errorMessage":"[%s] 人机验证未通过: %w","messagePattern":"\\[(.+?)\\] 人机验证未通过: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/miosou/miosou.go","lineNumber":151,"sourceCode":"func (p *MiosouPlugin) ensureGate() error {\n\tp.gateMu.Lock()\n\tdefer p.gateMu.Unlock()\n\tif p.gateReady {\n\t\treturn nil\n\t}\n\n\tvar lastErr error\n\tfor attempt := 0; attempt < 3; attempt++ {\n\t\tctx, cancel := context.WithTimeout(context.Background(), gateTimeout)\n\t\terr := p.completeAnubisChallenge(ctx)\n\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)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/miosou/miosou.go#L133-L169","documentation":"This error is returned by MiosouPlugin.ensureGate after 3 attempts of completeAnubisChallenge all fail; the last attempt's error is wrapped. ensureGate is invoked by searchImpl before searching (and again when a gate response is detected), so this error means the Anubis proof-of-work anti-bot challenge could not be solved or submitted.","triggerScenarios":"ensureGate loops 3 times calling completeAnubisChallenge(ctx) with gateTimeout context; every attempt returns an error (challenge request failed, page fetch failed, challenge not found with non-200, PoW solve failed, or pass submission rejected), producing \"人机验证未通过: <lastErr>\".","commonSituations":"Anubis difficulty raised so PoW cannot finish within gateTimeout; site updated the challenge page markup so parseAnubisChallenge returns found=false with non-200; pass-endpoint response rejected; the host is on a blocklist so every challenge is invalidated.","solutions":["Read the wrapped lastErr to see which stage failed (request, parse, solve, or submit)","Increase gateTimeout if solveAnubisChallenge runs out of time due to high difficulty","Update parseAnubisChallenge and the pass request against the site's current Anubis version","Test from a different IP/network — flagged IPs get endless challenges"],"exampleFix":"// before\nctx, cancel := context.WithTimeout(context.Background(), gateTimeout)\nerr := p.completeAnubisChallenge(ctx)\n// after (only if timeouts are the wrapped cause)\ngateTimeout = 60 * time.Second // raised from previous value\nctx, cancel := context.WithTimeout(context.Background(), gateTimeout)","handlingStrategy":"retry","validationCode":"// Go: check challenge fetchability before full ensureGate\nresp, err := http.Get(baseURL + \"/\")\nif err != nil || resp.StatusCode != http.StatusOK {\n    // cannot even reach challenge page; skip and retry later\n}","typeGuard":"func isGateFailure(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"人机验证未通过\")\n}","tryCatchPattern":"if err := p.ensureGate(); err != nil {\n    var to net.Error\n    if errors.As(err, &to) && to.Timeout() {\n        gateTimeout *= 2 // difficulty may have increased; give PoW more time\n    }\n    return nil, fmt.Errorf(\"gate setup failed, will retry later: %w\", err)\n}","preventionTips":["Size gateTimeout to worst-case PoW difficulty","Unit-test parseAnubisChallenge against a saved challenge page after site updates","Log which challenge stage failed (fetch/parse/solve/submit)","Avoid flagged IPs that get endless challenges"],"tags":["anti-bot","anubis","proof-of-work","upstream"],"backgroundTag":"captcha-challenge-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"}