PaddlePaddle/PaddleOCR · error · FileNotFoundError

File not found: ${path}

Error message

File not found: ${path}

What it means

Thrown by parse_batch_status in paddleocr/_api_client/_core.py:198 when a batch status response's data object does not contain a list 'extractResult'. The batch endpoint must return one entry per job under data.extractResult; a missing or non-list value prevents building the BatchStatus. It is a ResponseFormatError, i.e. the server broke the documented batch schema.

Source

Thrown at api_sdk/typescript/src/client.ts:191

      }];
    });
  }

  private collectMappedResourcePlans(resources: Record<string, string>): ResourceSavePlan[] {
    return Object.keys(resources)
      .sort()
      .map((key) => ({
        resourceUrl: resources[key],
        filename: safeMapKeyFilename(key),
      }));
  }

  private async requireExistingDirectory(destination: string): Promise<void> {
    let destinationStat;
    try {
      destinationStat = await stat(destination);
    } catch {
      throw new FileNotFoundError(destination);
    }
    if (!destinationStat.isDirectory()) {
      throw new InvalidRequestError(`Destination must be an existing directory: ${destination}`);
    }
  }

  private async requireWritableTarget(target: string, options: SaveResourceOptions): Promise<void> {
    try {
      await stat(target);
    } catch {
      return;
    }
    if (!options.overwrite) {
      throw new InvalidRequestError(`Destination already exists: ${target}`);
    }
  }

  private requireUniqueTargets(targets: string[], options: SaveResourceOptions): void {

View on GitHub (pinned to 2661c7c0ef)

Solutions

  1. Confirm the identifier passed is a batchId (returned when submitting with a batch), not a jobId
  2. Inspect the raw batch response body to see the actual data shape
  3. Verify the batch was created successfully (the submit that included batch_id returned a jobId)
  4. Upgrade the paddleocr SDK if the batch response schema changed
Defensive patterns

Strategy: validation

Type guard

def has_extract_result(data: dict) -> bool:
    return isinstance(data.get("extractResult"), list)

Try / catch

from paddleocr._api_client.errors import ResponseFormatError
try:
    batch = client.get_batch_status(batch_id)
except ResponseFormatError as e:
    if "extractResult" in str(e):
        raise ValueError(f"Not a valid batch id or malformed batch response: {batch_id}") from e

Prevention

When it happens

Trigger: Calling client.get_batch_status(batch_id) (directly or via wait/poll helpers) where the 2xx response's data lacks extractResult or has it as an object/string/null.

Common situations: Passing a jobId instead of a batchId to the batch endpoint; querying a batch that was never created server-side; API version drift renaming the field; empty-batch edge case handled differently by the server.

Related errors


AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14). Data as JSON: /api/errors/aabc5e71e288efb7. Report an issue: GitHub.