{"record":{"id":"53a7cc2516699f6c","repo":"PaddlePaddle/PaddleOCR","slug":"ocr-result-item-is-missing-result-ocrresults","errorCode":null,"errorMessage":"OCR result item is missing result.ocrResults.","messagePattern":"OCR result item is missing result\\.ocrResults\\.","errorType":"exception","errorClass":"ResultParseError","httpStatus":null,"severity":"error","filePath":"api_sdk/typescript/src/client.ts","lineNumber":280,"sourceCode":"    if (req.fileUrl) {\n      return this.http.submitUrl(model, req.fileUrl, payload, {\n        pageRanges: req.pageRanges,\n        batchId: req.batchId,\n        signal,\n      });\n    }\n    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 };","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/api_sdk/typescript/src/client.ts#L262-L298","documentation":"Raised as RequestTimeoutError from submit_file in paddleocr/_api_client/_http.py:153 when the multipart POST uploading a local file exceeds the configured HTTP timeout. File uploads are the slowest request type; large documents on slow uplinks routinely exceed small timeouts. The upload was aborted; the server may or may not have created the job.","triggerScenarios":"client.submit_file(...) with a large file (tens/hundreds of MB) or slow upload bandwidth where total POST time exceeds the client timeout.","commonSituations":"Uploading high-resolution scans or big PDFs on constrained networks; default timeout tuned for API calls, not transfers; running from regions far from the API endpoint.","solutions":["Increase the client timeout substantially for uploads (e.g. 300s)","Compress/downsample the document before upload (smaller PDFs, reduced DPI)","Prefer submit_url with a publicly accessible file URL for very large files","Retry; if worried about duplicate jobs, verify via batch/job listing after a timeout"],"exampleFix":"# before\nclient = Client(api_key=..., timeout=30)\n# after\nclient = Client(api_key=..., timeout=300)","handlingStrategy":"retry","validationCode":"import os\n\nsize_mb = os.path.getsize(file_path) / 1e6\nif size_mb > 50:\n    print(\"Large upload: consider a higher client timeout or submit_url\")","typeGuard":null,"tryCatchPattern":"from paddleocr._api_client.errors import RequestTimeoutError\nfor attempt in range(3):\n    try:\n        job_id = client.submit_file(model, file_path, {})\n        break\n    except RequestTimeoutError:\n        if attempt == 2:\n            raise","preventionTips":["Size the timeout to the upload: budget ~filesize/bandwidth plus margin","Compress documents before upload","Use submit_url for very large files hosted remotely"],"tags":["network","timeout","upload","retryable"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}