{"record":{"id":"6dc507de48ac59c5","repo":"PaddlePaddle/PaddleOCR","slug":"ocr-result-page-is-missing-prunedresult","errorCode":null,"errorMessage":"OCR result page is missing prunedResult.","messagePattern":"OCR result page is missing prunedResult\\.","errorType":"exception","errorClass":"ResultParseError","httpStatus":null,"severity":"error","filePath":"api_sdk/typescript/src/client.ts","lineNumber":287,"sourceCode":"    return this.http.submitFile(model, req.filePath!, payload, {\n      pageRanges: req.pageRanges,\n      batchId: req.batchId,\n      signal,\n    });\n  }\n\n  private parseOCRResult(jobId: string, jsonlData: unknown[]): OCRResult {\n    const dataInfo: Record<string, unknown> = {};\n    const pages = jsonlData.flatMap((lineObj) => {\n      if (!isRecord(lineObj) || !isRecord(lineObj.result) || !Array.isArray(lineObj.result.ocrResults)) {\n        throw new ResultParseError(\"OCR result item is missing result.ocrResults.\");\n      }\n      if (isRecord(lineObj.result.dataInfo)) {\n        Object.assign(dataInfo, lineObj.result.dataInfo);\n      }\n      return lineObj.result.ocrResults.map((item) => {\n        if (!isRecord(item) || !(\"prunedResult\" in item)) {\n          throw new ResultParseError(\"OCR result page is missing prunedResult.\");\n        }\n        return {\n          prunedResult: item.prunedResult,\n          ocrImageUrl: typeof item.ocrImage === \"string\" ? item.ocrImage : undefined,\n          docPreprocessingImageUrl: typeof item.docPreprocessingImage === \"string\" ? item.docPreprocessingImage : undefined,\n          inputImageUrl: typeof item.inputImage === \"string\" ? item.inputImage : undefined,\n          raw: item,\n        };\n      });\n    });\n    return { jobId, pages, dataInfo };\n  }\n\n  private parseDocParsingResult(jobId: string, jsonlData: unknown[]): DocParsingResult {\n    const dataInfo: Record<string, unknown> = {};\n    const pages = jsonlData.flatMap((lineObj) => {\n      if (!isRecord(lineObj) || !isRecord(lineObj.result) || !Array.isArray(lineObj.result.layoutParsingResults)) {\n        throw new ResultParseError(\"Document parsing result item is missing result.layoutParsingResults.\");","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/api_sdk/typescript/src/client.ts#L269-L305","documentation":"Raised as NetworkError from submit_file in paddleocr/_api_client/_http.py:155 when the multipart upload POST fails at connection level: reset during transfer, DNS failure, TLS error, or refused connection. Mid-upload resets are common with flaky networks and aggressive proxies. The upload did not complete; job state server-side is indeterminate.","triggerScenarios":"client.submit_file(...) over an unstable connection, through a proxy that kills long uploads, or with a firewall resetting large POSTs.","commonSituations":"Mobile/tethered networks; proxy body-size limits; VPN drops; cloud function egress restrictions; keepalive idle resets on slow uploads.","solutions":["Retry the upload — connection resets are frequently transient","Check proxy/body-size limits if uploads consistently die partway (nginx client_max_body_size equivalents)","Shrink the file (compression, lower DPI) to shorten the transfer","Move the file to object storage and use submit_url instead","If persistent, test raw connectivity with curl -T file <endpoint>"],"exampleFix":"# retry helper\nfrom paddleocr._api_client.errors import NetworkError\nfor attempt in range(3):\n    try:\n        job_id = client.submit_file(model, path, {})\n        break\n    except NetworkError:\n        if attempt == 2:\n            raise","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from paddleocr._api_client.errors import NetworkError\nfor attempt in range(3):\n    try:\n        job_id = client.submit_file(model, file_path, {})\n        break\n    except NetworkError:\n        time.sleep(2 ** attempt)\nelse:\n    raise RuntimeError(\"Upload failed after retries\")","preventionTips":["Retry uploads with exponential backoff; mid-transfer resets are usually transient","Check proxy body-size limits if failures are consistent at a size threshold","Host large files externally and use submit_url"],"tags":["network","connection","upload","retryable"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}