{"record":{"id":"b24637dac65f6ee8","repo":"fish2018/pansou","slug":"s-w-b24637","errorCode":null,"errorMessage":"[%s] 搜索请求失败: %w","messagePattern":"\\[(.+?)\\] 搜索请求失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/daishudj/daishudj.go","lineNumber":137,"sourceCode":"\nfunc (p *DaishuPlugin) searchImpl(client *http.Client, keyword string, ext map[string]interface{}) ([]model.SearchResult, error) {\n\tif p.client != nil {\n\t\tclient = p.client\n\t}\n\n\tsearchURL := fmt.Sprintf(\"https://www.daishuduanju.com/?s=%s\", url.QueryEscape(keyword))\n\tctx, cancel := context.WithTimeout(context.Background(), searchTimeout)\n\tdefer cancel()\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, searchURL, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 创建搜索请求失败: %w\", p.Name(), err)\n\t}\n\tsetCommonHeaders(req, \"https://www.daishuduanju.com/\")\n\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\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"[%s] 搜索返回状态码: %d\", p.Name(), resp.StatusCode)\n\t}\n\n\tdoc, err := goquery.NewDocumentFromReader(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 解析搜索页面失败: %w\", p.Name(), err)\n\t}\n\n\tvar (\n\t\tresults []model.SearchResult\n\t\twg      sync.WaitGroup\n\t\tmu      sync.Mutex\n\t\tsem     = make(chan struct{}, maxConcurrency)\n\t)","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/daishudj/daishudj.go#L119-L155","documentation":"searchImpl wraps a doRequestWithRetry failure as \"[%s] 搜索请求失败\". It means the search request to daishuduanju.com failed at the transport layer or exhausted all retries — the response was never obtained.","triggerScenarios":"Calling the plugin search when the GET https://www.daishuduanju.com/?s=<keyword> fails in every attempt: timeout (searchTimeout context expired), DNS failure, TLS error, or connection refused/reset.","commonSituations":"Site is down or blocked in the user's region/ISP, anti-bot TLS fingerprinting resets connections, searchTimeout is too short for a slow network, or DNS poisoning of the domain.","solutions":["Check the wrapped cause for context.DeadlineExceeded; if so, increase searchTimeout.","Verify the site is reachable from your network (curl -I https://www.daishuduanju.com).","Retry later if the site is temporarily down or rate-limiting your IP.","Increase maxRetries/backoff in doRequestWithRetry for flaky connections."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := plugin.Search(ctx, keyword)\nif err != nil {\n    if errors.Is(err, context.DeadlineExceeded) {\n        // searchTimeout too short — retry with a larger timeout\n    }\n    return nil, fmt.Errorf(\"search unavailable: %w\", err)\n}","preventionTips":["Set searchTimeout comfortably above expected network latency.","Verify the site is reachable from your region/network.","Use backoff between retries; avoid hammering a downed site."],"tags":["network","http","go","retry"],"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"}