{"record":{"id":"a6973a07df52cc9c","repo":"Tencent/WeKnora","slug":"create-request-w-a6973a","errorCode":null,"errorMessage":"create request: %w","messagePattern":"create request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_converter.go","lineNumber":159,"sourceCode":"\nfunc (c *PaddleOCRVLReader) callLayoutParsing(\n\tctx context.Context, req *types.ReadRequest, content []byte,\n) (string, map[string]string, error) {\n\tpayload := paddleOCRVLRecognitionParams(c.useSeal, c.useChart)\n\tpayload[\"file\"] = base64.StdEncoding.EncodeToString(content)\n\tpayload[\"fileType\"] = fileTypeCode(req)\n\tpayload[\"visualize\"] = false\n\n\tbody, err := json.Marshal(payload)\n\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","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_converter.go#L141-L177","documentation":"HTTP client error in PaddleOCRVLReader.callLayoutParsing: http.NewRequestWithContext could not build the POST to the local/self-hosted PaddleOCR-VL /layout-parsing endpoint. The %w retains the net/http cause; raised after payload marshaling, before the request is executed.","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_converter.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the configured PaddleOCR-VL endpoint parses as a URL","Check for invalid characters introduced by config","Log the composed URL to diagnose"],"exampleFix":null,"handlingStrategy":"try-catch","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"}