{"record":{"id":"875971902b1f317b","repo":"fish2018/pansou","slug":"w-875971","errorCode":null,"errorMessage":"读取验证响应失败: %w","messagePattern":"读取验证响应失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/qiwei/qiwei.go","lineNumber":400,"sourceCode":"\tquery.Set(\"value\", encodedValue)\n\tverifyURL += \"?\" + query.Encode()\n\n\tctx, cancel := context.WithTimeout(context.Background(), detailTimeout)\n\tdefer cancel()\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, verifyURL, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"创建验证请求失败: %w\", err)\n\t}\n\tp.setHeaders(req, pageURL)\n\treq.Header.Set(\"X-Requested-With\", \"XMLHttpRequest\")\n\tresp, err := p.doRequestWithRetry(req, client)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"提交验证失败: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tresponseBody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"读取验证响应失败: %w\", err)\n\t}\n\tif isVerifyPage(string(responseBody)) {\n\t\treturn fmt.Errorf(\"站点未接受验证参数\")\n\t}\n\treturn nil\n}\n\nfunc md5StringToHex(value string) string {\n\tvar builder strings.Builder\n\tfor _, r := range value {\n\t\tbuilder.WriteString(fmt.Sprintf(\"%d\", r+1))\n\t}\n\tsum := md5.Sum([]byte(builder.String()))\n\treturn hex.EncodeToString(sum[:])\n}\n\nfunc (p *QiweiPlugin) parseDetail(detailURL, body, fallbackTitle, fallbackPic string) (detailInfo, error) {\n\tdoc, err := goquery.NewDocumentFromReader(strings.NewReader(body))","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/qiwei/qiwei.go#L382-L418","documentation":"The verification response body could not be read: io.ReadAll(resp.Body) failed after a successful HTTP exchange, so solveVerification wraps the error as 读取验证响应失败. This indicates the connection dropped mid-body or the server sent a malformed/truncated stream.","triggerScenarios":"io.ReadAll(resp.Body) errors in solveVerification — server closed the connection prematurely, chunked encoding interrupted, or a proxy reset the stream during the challenge response download.","commonSituations":"Unstable network or flaky CDN; aggressive server-side connection limits killing keep-alive connections; middleboxes/proxies truncating responses; response is huge and the timeout/context expires mid-read.","solutions":["Retry the whole verification flow (getDetailInfo already retries alternate candidate URLs)","Increase the request timeout so the read isn't cut off by ctx deadline","Verify no proxy/middlebox truncates responses; test with curl","Check the wrapped error — 'unexpected EOF' vs 'context deadline exceeded' points to different fixes"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"info, err := plugin.GetDetailInfo(ctx, url)\nif err != nil && strings.Contains(err.Error(), \"读取验证响应失败\") {\n    time.Sleep(time.Second)\n    info, err = plugin.GetDetailInfo(ctx, url) // transient read failures usually succeed on retry\n}","preventionTips":["Retry truncated reads — they are usually transient","Use longer timeouts so body reads are not cut off by the context","Check proxy/middlebox configuration if truncation recurs on the same host"],"tags":["network","io","verification"],"backgroundTag":"file-read-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"}