{"record":{"id":"12f8210f02305411","repo":"fish2018/pansou","slug":"s-d-w-12f821","errorCode":null,"errorMessage":"[%s] 重试 %d 次后仍然失败: %w","messagePattern":"\\[(.+?)\\] 重试 (.+?) 次后仍然失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/feikuai/feikuai.go","lineNumber":544,"sourceCode":"\t\t\ttime.Sleep(backoff)\n\t\t}\n\n\t\t// 克隆请求避免并发问题\n\t\treqClone := req.Clone(req.Context())\n\n\t\tresp, err := client.Do(reqClone)\n\t\tif err == nil {\n\t\t\tif resp.StatusCode == 200 {\n\t\t\t\treturn resp, nil\n\t\t\t}\n\t\t\tresp.Body.Close()\n\t\t\tlastErr = fmt.Errorf(\"HTTP状态码: %d\", resp.StatusCode)\n\t\t} else {\n\t\t\tlastErr = err\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"[%s] 重试 %d 次后仍然失败: %w\", p.Name(), maxRetries, lastErr)\n}\n","sourceCodeStart":526,"sourceCodeEnd":546,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/feikuai/feikuai.go#L526-L546","documentation":"doRequestWithRetry exhausted all its retry attempts without receiving a 200 response. The final underlying cause (transport error or the last non-200 status, e.g. 'HTTP状态码: %d') is wrapped by %w. The plugin's search cannot complete without a successful HTTP response.","triggerScenarios":"doRequestWithRetry: after maxRetries attempts, every client.Do call either returned a transport error or a non-200 status code.","commonSituations":"Target site down or geo-blocked, DNS failure, local network/proxy outage, persistent 403/429 from anti-bot protection, TLS handshake failures.","solutions":["Read the wrapped cause to distinguish transport failure (network) from HTTP status failure (server/bot protection).","Test connectivity to the target host from the same machine (curl -v).","Update cookies, User-Agent, or use a proxy if the site is blocking the client.","Wait and retry — for 5xx/429 the upstream often recovers; consider longer backoff."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight reachability check\nif _, err := http.Head(targetURL); err != nil {\n    log.Printf(\"target unreachable, aborting early: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"results, err := searchImpl(keyword)\nif err != nil {\n    if strings.Contains(err.Error(), \"重试\") {\n        log.Printf(\"exhausted retries, serving cached results: %v\", err)\n        return cachedResults(), nil\n    }\n    return err\n}","preventionTips":["Configure adequate retry count and exponential backoff","Monitor upstream availability and fail over to cached results","Check DNS/proxy settings when errors persist","Space out scheduled searches to avoid hammering a struggling upstream"],"tags":["http","retry-exhausted","network","go"],"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"}