{"record":{"id":"1e0f2392677e8ad4","repo":"PaddlePaddle/PaddleOCR","slug":"document-parsing-result-item-is-missing-result-lay","errorCode":null,"errorMessage":"Document parsing result item is missing result.layoutParsingResults.","messagePattern":"Document parsing result item is missing result\\.layoutParsingResults\\.","errorType":"exception","errorClass":"ResultParseError","httpStatus":null,"severity":"warning","filePath":"api_sdk/typescript/src/client.ts","lineNumber":305,"sourceCode":"          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.\");\n      }\n      if (isRecord(lineObj.result.dataInfo)) {\n        Object.assign(dataInfo, lineObj.result.dataInfo);\n      }\n      return lineObj.result.layoutParsingResults.map((item) => {\n        if (!isRecord(item) || !isRecord(item.markdown) || typeof item.markdown.text !== \"string\") {\n          throw new ResultParseError(\"Document parsing result page is missing markdown.text.\");\n        }\n        return {\n          markdownText: item.markdown.text,\n          markdownImages: isRecord(item.markdown.images) ? stringMap(item.markdown.images) : {},\n          outputImages: isRecord(item.outputImages) ? stringMap(item.outputImages) : {},\n          prunedResult: item.prunedResult,\n          inputImageUrl: typeof item.inputImage === \"string\" ? item.inputImage : undefined,\n          exports: isRecord(item.exports) ? item.exports : {},\n          markdown: item.markdown,\n          raw: item,\n        };","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/api_sdk/typescript/src/client.ts#L287-L323","documentation":"Raised as RequestTimeoutError from get_job_status in paddleocr/_api_client/_http.py:166 when the GET to fetch a single job's status exceeds the configured HTTP timeout. Status calls are normally fast, so a timeout here points to server overload or network degradation rather than payload size. The poll caller (sync/async poller) will surface this unless it retries internally.","triggerScenarios":"Polling client.get_job_status(job_id) while the API is slow to respond — server under heavy load, status endpoint latency spikes, or a very low client timeout.","commonSituations":"Tight polling loops during peak hours; timeout lowered for fast calls then reused globally; network congestion; shared rate-limited egress (NAT exhaustion).","solutions":["Raise the client timeout (status calls still need headroom, e.g. 60s)","Reduce polling frequency to lower pressure and avoid compounding latency","Retry the status call — single missed polls are cheap and usually succeed","Check the service status page for degraded latency"],"exampleFix":"# resilient polling\nfrom paddleocr._api_client.errors import RequestTimeoutError\nfor _ in range(5):\n    try:\n        status = client.get_job_status(job_id)\n        break\n    except RequestTimeoutError:\n        continue","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from paddleocr._api_client.errors import RequestTimeoutError\nfor _ in range(3):\n    try:\n        status = client.get_job_status(job_id)\n        break\n    except RequestTimeoutError:\n        continue  # status reads are idempotent","preventionTips":["Wrap status polls in a retry loop with backoff","Leave timeout headroom even for 'fast' endpoints","Space out poll intervals to avoid compounding server load"],"tags":["network","timeout","polling","retryable"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}