{"record":{"id":"4ff37ba7f087beba","repo":"PaddlePaddle/PaddleOCR","slug":"model-model-is-not-an-ocr-model","errorCode":null,"errorMessage":"Model ${model} is not an OCR model.","messagePattern":"Model (.+?) is not an OCR model\\.","errorType":"exception","errorClass":"InvalidRequestError","httpStatus":null,"severity":"warning","filePath":"api_sdk/typescript/src/client.ts","lineNumber":346,"sourceCode":"\n  private resolveJob(job: Job | string, expectedTask: Job[\"task\"]): Job {\n    if (typeof job === \"string\") {\n      return {\n        jobId: job,\n        model: expectedTask === \"ocr\" ? Model.PPOCRv6 : Model.PaddleOCRVL16,\n        task: expectedTask,\n      };\n    }\n    if (job.task !== expectedTask) {\n      throw new InvalidRequestError(`Job ${job.jobId} is a ${job.task} job, not a ${expectedTask} job.`);\n    }\n    this.validateModelForTask(job.model, expectedTask);\n    return job;\n  }\n\n  private validateModelForTask(model: string, task: Job[\"task\"]): void {\n    if (task === \"ocr\" && !isOCRModel(model)) {\n      throw new InvalidRequestError(`Model ${model} is not an OCR model.`);\n    }\n    if (task === \"document_parsing\" && !isDocumentParsingModel(model)) {\n      throw new InvalidRequestError(`Model ${model} is not a document parsing model.`);\n    }\n  }\n}\n\nfunction stringMap(value: Record<string, unknown>): Record<string, string> {\n  const result: Record<string, string> = {};\n  for (const [key, val] of Object.entries(value)) {\n    if (typeof val === \"string\") {\n      result[key] = val;\n    }\n  }\n  return result;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/api_sdk/typescript/src/client.ts#L328-L364","documentation":"Raised as NetworkError from get_batch_status in paddleocr/_api_client/_http.py:181 when the batch status GET fails at the connection layer. Identical failure family to single-job NetworkError but on the batch endpoint; batch execution is unaffected server-side. Safe to retry since it is a read.","triggerScenarios":"get_batch_status(batch_id) during connection drops, DNS failures, proxy resets, or TLS issues.","commonSituations":"Long-lived batch polling sessions over unstable networks; environment-level egress problems; proxy idle-connection teardown between polls.","solutions":["Retry with backoff — idempotent read","Persist the batchId so polling survives restarts","Verify connectivity if errors cluster","Stagger concurrent batch polls to reduce connection churn"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from paddleocr._api_client.errors import NetworkError\ntry:\n    batch = client.get_batch_status(batch_id)\nexcept NetworkError:\n    time.sleep(5)\n    batch = client.get_batch_status(batch_id)","preventionTips":["Retry batch reads with backoff; they are idempotent","Persist batchId across restarts","Monitor egress health when running many concurrent pollers"],"tags":["network","connection","batch","retryable"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}