{"record":{"id":"478a3da7062c56d2","repo":"Tencent/WeKnora","slug":"read-jsonl-body-w","errorCode":null,"errorMessage":"read jsonl body: %w","messagePattern":"read jsonl body: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go","lineNumber":279,"sourceCode":"\t} `json:\"result\"`\n}\n\nfunc (c *PaddleOCRVLCloudReader) fetchResults(jsonlURL string) (string, map[string]string, error) {\n\tif err := utils.ValidateURLForSSRF(jsonlURL); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"jsonl URL blocked by SSRF check: %v\", err)\n\t}\n\tclient := utils.NewSSRFSafeHTTPClient(utils.SSRFSafeHTTPClientConfig{Timeout: 120 * time.Second, MaxRedirects: 5})\n\tresp, err := client.Get(jsonlURL)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"download jsonl: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", nil, fmt.Errorf(\"download jsonl status %d\", resp.StatusCode)\n\t}\n\tdata, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"read jsonl body: %w\", err)\n\t}\n\n\ttexts := make([]string, 0)\n\timages := make(map[string]string)\n\tfor _, line := range strings.Split(strings.TrimSpace(string(data)), \"\\n\") {\n\t\tline = strings.TrimSpace(line)\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tvar parsed paddleOCRVLCloudResultLine\n\t\tif err := json.Unmarshal([]byte(line), &parsed); err != nil {\n\t\t\tlogger.Errorf(context.Background(), \"[PaddleOCR-VL Cloud] skip malformed jsonl line: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tfor _, p := range parsed.Result.LayoutParsingResults {\n\t\t\tif t := strings.TrimSpace(p.Markdown.Text); t != \"\" {\n\t\t\t\ttexts = append(texts, p.Markdown.Text)\n\t\t\t}","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go#L261-L297","documentation":"I/O error in PaddleOCRVLCloudReader.fetchResults: reading the response body of the JSONL download failed mid-stream. The %w wraps the io error; it fires after a 200 response was received, when the body itself cannot be fully read (connection reset, truncation).","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the download; usually transient","Check network stability for large result files","Consider resumable/chunked download if it recurs"],"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"}