{"record":{"id":"09cc22d3c8ef829e","repo":"Tencent/WeKnora","slug":"http-read-failed-w","errorCode":null,"errorMessage":"http read failed: %w","messagePattern":"http read failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/http_parser.go","lineNumber":233,"sourceCode":"\t}\n\tif len(req.FileContent) > 0 {\n\t\tbody.FileContent = base64.StdEncoding.EncodeToString(req.FileContent)\n\t}\n\n\tjsonBody, err := json.Marshal(body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http marshal read request: %w\", err)\n\t}\n\thttpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, base+PathRead, bytes.NewReader(jsonBody))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http new request: %w\", err)\n\t}\n\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\thttpReq.ContentLength = int64(len(jsonBody))\n\n\tresp, err := p.client.Do(httpReq)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http read failed: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\tbodyBytes, _ := io.ReadAll(resp.Body)\n\t\treturn nil, fmt.Errorf(\"http read status %d: %s\", resp.StatusCode, string(bodyBytes))\n\t}\n\tvar out httpReadResponse\n\tif err := json.NewDecoder(resp.Body).Decode(&out); err != nil {\n\t\treturn nil, fmt.Errorf(\"http decode read response: %w\", err)\n\t}\n\treturn fromHTTPReadResponse(&out), nil\n}\n","sourceCodeStart":215,"sourceCodeEnd":246,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/http_parser.go#L215-L246","documentation":"Transport error in HTTPDocumentReader.Read: the HTTP client's Do() for the document-parse POST failed at the network level (refused, timeout, reset). The %w preserves the underlying error; raised after request construction succeeded and before response status is examined.","triggerScenarios":"Thrown at internal/infrastructure/docparser/http_parser.go:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the docreader HTTP service is up at the configured address","Check network/TLS/timeout settings","Retry once the service is reachable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}