{"record":{"id":"52289b76643aef63","repo":"Tencent/WeKnora","slug":"http-request-w-52289b","errorCode":null,"errorMessage":"HTTP request: %w","messagePattern":"HTTP request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_converter.go","lineNumber":169,"sourceCode":"\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"marshal payload: %w\", err)\n\t}\n\n\thttpReq, err := http.NewRequestWithContext(\n\t\tctx, http.MethodPost, c.endpoint+\"/layout-parsing\", bytes.NewReader(body),\n\t)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"create request: %w\", err)\n\t}\n\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := utils.NewSSRFSafeHTTPClient(utils.SSRFSafeHTTPClientConfig{\n\t\tTimeout:      paddleOCRVLTimeout,\n\t\tMaxRedirects: 5,\n\t})\n\tresp, err := client.Do(httpReq)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"HTTP request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"read response body: %w\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", nil, fmt.Errorf(\"PaddleOCR-VL API status %d: %s\", resp.StatusCode, string(respBody))\n\t}\n\n\tvar result paddleOCRVLResponse\n\tif err := json.Unmarshal(respBody, &result); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"decode response: %w\", err)\n\t}\n\tif result.ErrorCode != 0 {\n\t\treturn \"\", nil, fmt.Errorf(\"PaddleOCR-VL error %d: %s\", result.ErrorCode, result.ErrorMsg)","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_converter.go#L151-L187","documentation":"Transport error in PaddleOCRVLReader.callLayoutParsing: the SSRF-safe HTTP client's Do() for the layout-parsing POST failed (service down, timeout, connection refused). The %w wraps the network cause; distinct from the status-code and decode errors handled after it in the same function.","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_converter.go:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check service reachability and load (large base64 bodies take time)","Retry; adjust paddleOCRVLTimeout for big documents","Verify SSRF-safe client configuration"],"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"}