{"record":{"id":"e60620eac26f1239","repo":"fish2018/pansou","slug":"s-d-e60620","errorCode":null,"errorMessage":"[%s] 请求返回状态码: %d","messagePattern":"\\[(.+?)\\] 请求返回状态码: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/wuji/wuji.go","lineNumber":197,"sourceCode":"\t// 创建请求\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", searchURL, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 创建请求失败: %w\", p.Name(), err)\n\t}\n\t\n\t// 设置请求头\n\tp.setRequestHeaders(req)\n\t\n\t// 发送HTTP请求\n\tresp, err := p.doRequestWithRetry(req, client)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 搜索请求失败: %w\", p.Name(), err)\n\t}\n\tdefer resp.Body.Close()\n\t\n\t// 检查状态码\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"[%s] 请求返回状态码: %d\", p.Name(), resp.StatusCode)\n\t}\n\t\n\t// 读取响应体内容\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 读取响应失败: %w\", p.Name(), err)\n\t}\n\t\n\t// 解析HTML\n\tdoc, err := goquery.NewDocumentFromReader(strings.NewReader(string(body)))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] HTML解析失败: %w\", p.Name(), err)\n\t}\n\t\n\t// 提取搜索结果\n\treturn p.extractSearchResults(doc), nil\n}\n","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/wuji/wuji.go#L179-L215","documentation":"searchPage returns this error when the HTTP response from xcili.net has a StatusCode other than 200. Unlike error 756 there is no wrapped cause — only the numeric status is reported. The plugin treats any non-200 (403 anti-bot, 429 rate limit, 5xx, redirects to error pages) as a failed search.","triggerScenarios":"p.doRequestWithRetry succeeded at transport level but resp.StatusCode != 200: the site returned 403 (Cloudflare/WAF block), 429 (too many requests from MaxConcurrency=10 parallel page fetches), 5xx, or an unexpected redirect target.","commonSituations":"Server IP rate-limited or blacklisted by the site's WAF; concurrency of up to 10 simultaneous page requests tripping 429; site under Cloudflare challenge; site temporarily down with 502/503.","solutions":["Note the status code in the message: 403/503 → anti-bot/Cloudflare, 429 → rate limited, 5xx → site problem","Reduce MaxConcurrency and MaxPages to lower request pressure","Add delays/backoff between page fetches; honor Retry-After on 429","Use a more complete browser-like header set (Accept, Accept-Language, cookies) to pass WAF checks","Retry later if it's a transient 5xx"],"exampleFix":"// before\nif resp.StatusCode != 200 {\n    return nil, fmt.Errorf(\"[%s] 请求返回状态码: %d\", p.Name(), resp.StatusCode)\n}\n// after\nif resp.StatusCode == 429 || resp.StatusCode == 503 {\n    time.Sleep(2 * time.Second)\n    // retry once before failing\n} else if resp.StatusCode != 200 {\n    return nil, fmt.Errorf(\"[%s] 请求返回状态码: %d\", p.Name(), resp.StatusCode)\n}","handlingStrategy":"retry","validationCode":"// pre-check upstream health before searching\nresp, err := http.Head(\"https://xcili.net\")\nif err != nil || (resp != nil && resp.StatusCode != 200) {\n    return fmt.Errorf(\"wuji upstream unhealthy (status %v)\", resp)\n}","typeGuard":null,"tryCatchPattern":"results, err := p.Search(keyword, ext)\nif err != nil {\n    var statusErr *fmt.Errorf\n    if strings.Contains(err.Error(), \"请求返回状态码: 429\") {\n        time.Sleep(backoff)\n        // retry after rate-limit backoff\n    }\n}","preventionTips":["Lower MaxConcurrency/MaxPages to avoid tripping 429 rate limits","Add jittered delays between concurrent page fetches","Send full browser-like headers to pass WAF/Cloudflare checks","Monitor status codes logged by the plugin and back off on repeated 403/429"],"tags":["http","status-code","rate-limit","anti-bot","go"],"backgroundTag":"http-non-200-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"}