{"record":{"id":"c508792903d6d887","repo":"Tencent/WeKnora","slug":"paddleocr-vl-cloud-fetch-results-w","errorCode":null,"errorMessage":"PaddleOCR-VL Cloud fetch results: %w","messagePattern":"PaddleOCR-VL Cloud fetch results: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go","lineNumber":78,"sourceCode":"\t\treturn &types.ReadResult{Error: \"no file content provided\"}, nil\n\t}\n\n\tlogger.Infof(context.Background(), \"[PaddleOCR-VL Cloud] Parsing file=%s size=%d model=%s\",\n\t\treq.FileName, len(content), c.model)\n\n\tjobID, err := c.submitJob(ctx, req, content)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"PaddleOCR-VL Cloud submit: %w\", err)\n\t}\n\n\tjsonlURL, err := c.pollJob(ctx, jobID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"PaddleOCR-VL Cloud poll: %w\", err)\n\t}\n\n\tmdContent, imagesURL, err := c.fetchResults(jsonlURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"PaddleOCR-VL Cloud fetch results: %w\", err)\n\t}\n\n\tmdContent = normalizeHTMLTables(mdContent)\n\n\timageRefs := c.downloadImages(mdContent, imagesURL)\n\tmdContent, imageRefs = ensureOriginalImageRef(req, mdContent, imageRefs)\n\n\tlogger.Infof(context.Background(), \"[PaddleOCR-VL Cloud] Parsed successfully, markdown=%d chars, images=%d\",\n\t\tlen(mdContent), len(imageRefs))\n\n\treturn &types.ReadResult{\n\t\tMarkdownContent: mdContent,\n\t\tImageRefs:       imageRefs,\n\t}, nil\n}\n\nfunc (c *PaddleOCRVLCloudReader) optionalPayload() map[string]interface{} {\n\t// Shared with the self-hosted engine so both produce identical output.","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go#L60-L96","documentation":"Once polling yields a result JSONL URL, Read calls fetchResults to download and parse the JSONL (markdown and image references). Failures downloading that URL or decoding its contents are wrapped as 'PaddleOCR-VL Cloud fetch results'. The job completed but the final artifacts could not be retrieved or interpreted.","triggerScenarios":"Read -> fetchResults fails: the JSONL URL returns non-200, the result download times out, the JSONL body is empty/malformed and cannot be parsed, or required result fields are missing.","commonSituations":"Result URLs expiring quickly (signed URL TTL) because polling finished long after completion; transient object-storage errors; the cloud API changed its JSONL schema after a version bump; empty results for a document PaddleOCR could not actually extract.","solutions":["Inspect the wrapped cause: HTTP status vs. JSONL parse failure","If the result URL expired, re-run with a shorter poll gap or fetch results immediately after completion","Validate the JSONL schema against the current PaddleOCR-VL API docs (check for API version changes)","Retry the fetch — result downloads from object storage are often transient failures","If results are genuinely empty, verify the input document actually contains extractable content"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if jsonlURL == \"\" {\n    return errors.New(\"job completed but no result URL returned\")\n}\nu, err := url.Parse(jsonlURL)\nif err != nil || u.Scheme == \"\" { return fmt.Errorf(\"invalid result URL: %q\", jsonlURL) }","typeGuard":"func isFetchResultsFailure(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"PaddleOCR-VL Cloud fetch results\")\n}","tryCatchPattern":"out, err := reader.Read(ctx, req)\nif isFetchResultsFailure(err) {\n    out, err = retryWithBackoff(3, reader.Read, ctx, req) // result downloads are often transient\n}\nif err != nil { return err }","preventionTips":["Fetch results promptly after job completion to beat signed-URL expiry","Retry result downloads — object storage hiccups are common","Pin/verify the JSONL schema against the current API version","Handle empty-result JSONL explicitly (document had no extractable content)"],"tags":["http","cloud-api","paddleocr","docparser","json"],"backgroundTag":"result-fetch-failed","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}