{"record":{"id":"fef44077e7c2f2ce","repo":"fish2018/pansou","slug":"s-w-fef440","errorCode":null,"errorMessage":"[%s] 搜索请求失败: %w","messagePattern":"\\[(.+?)\\] 搜索请求失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/lingjisp/lingjisp.go","lineNumber":194,"sourceCode":"\t\t}(item)\n\t}\n\n\twg.Wait()\n\treturn plugin.FilterResultsByKeyword(results, keyword), nil\n}\n\nfunc (p *LingjiPlugin) fetchSearchItems(client *http.Client, keyword string) ([]lingjiVideoItem, error) {\n\tparams := url.Values{}\n\tparams.Set(\"app_id\", lingjiAppID)\n\tparams.Set(\"identity\", lingjiIdentity)\n\tparams.Set(\"sb\", keyword)\n\tparams.Set(\"page\", \"1\")\n\tparams.Set(\"limit\", \"20\")\n\n\tapiURL := lingjiAPIBase + \"getVideoList?\" + params.Encode()\n\tbody, err := doLingjiGET(client, apiURL, lingjiSearchTimeout)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 搜索请求失败: %w\", p.Name(), err)\n\t}\n\n\tvar resp lingjiSearchResponse\n\tif err := json.Unmarshal(body, &resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 解析搜索响应失败: %w\", p.Name(), err)\n\t}\n\tif !resp.Success || resp.Code != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"[%s] 搜索接口返回异常: success=%v code=%d\", p.Name(), resp.Success, resp.Code)\n\t}\n\n\titems := resp.Data.Data\n\tif len(items) == 0 {\n\t\titems = resp.Data.List\n\t}\n\treturn dedupeLingjiItems(items), nil\n}\n\nfunc (p *LingjiPlugin) fetchDetail(client *http.Client, doubID int) (lingjiVideoItem, error) {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/lingjisp/lingjisp.go#L176-L212","documentation":"lingjisp's fetchSearchItems failed to GET the getVideoList API endpoint after retries, wrapping the transport error from doLingjiGET. doLingjiGET already applies retries with exponential backoff, so this error means all attempts failed (DNS failure, timeout, connection refused, non-2xx/HTTP error propagation).","triggerScenarios":"doLingjiGET(client, lingjiAPIBase+\"getVideoList?...\", lingjiSearchTimeout) returned an error on every retry attempt — network unreachable, DNS failure, context deadline exceeded, or an HTTP status error was constructed inside doLingjiGET.","commonSituations":"API host blocked or offline; DNS resolution fails for the lingji API domain; client machine has no internet or a proxy misconfigured; lingjiSearchTimeout too short on slow networks; API domain rotated (these aggregator APIs change domains often).","solutions":["Verify the API base (lingjiAPIBase) domain is still alive with curl","Check network/proxy configuration on the host","Increase lingjiSearchTimeout and confirm lingjiMaxRetries is >1","Update the API base URL to the current working domain","Inspect the wrapped error to distinguish timeout vs connection refused vs HTTP status"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Reachability pre-check before search\nctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)\ndefer cancel()\nreq, _ := http.NewRequestWithContext(ctx, http.MethodGet, lingjiAPIBase, nil)\nif _, err := http.DefaultClient.Do(req); err != nil {\n    return fmt.Errorf(\"灵集API不可达: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"items, err := p.Search(ctx, keyword)\nif err != nil {\n    if errors.Is(err, context.DeadlineExceeded) || isNetErr(err) {\n        time.Sleep(backoff)\n        items, err = p.Search(ctx, keyword) // doLingjiGET already retries internally\n    }\n    if err != nil {\n        return degradeGracefully(keyword)\n    }\n}","preventionTips":["Set lingjiMaxRetries >= 3 with exponential backoff","Use generous but bounded timeouts (lingjiSearchTimeout)","Update the API base URL when the aggregator rotates domains","Monitor DNS/network health on the host"],"tags":["network","http","api","timeout"],"backgroundTag":"api-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"}