PaddlePaddle/PaddleOCR · error · ResponseFormatError

Done job response must contain object 'resultUrl'.

Error message

Done job response must contain object 'resultUrl'.

What it means

Error "Done job response must contain object 'resultUrl'." thrown in PaddlePaddle/PaddleOCR.

Source

Thrown at paddleocr/_api_client/_core.py:186

    data = payload.get("data")
    if not isinstance(data, dict):
        raise ResponseFormatError("Response JSON must contain object field 'data'.")
    return data


def extract_job_id(data: dict) -> str:
    job_id = data.get("jobId")
    if not isinstance(job_id, str) or not job_id:
        raise ResponseFormatError(
            "Response data must contain non-empty string 'jobId'."
        )
    return job_id


def validate_result_json_url(data: dict) -> str:
    result_url = data.get("resultUrl")
    if not isinstance(result_url, dict):
        raise ResponseFormatError("Done job response must contain object 'resultUrl'.")
    json_url = result_url.get("jsonUrl")
    if not isinstance(json_url, str) or not json_url:
        raise ResponseFormatError(
            "Done job response resultUrl must contain non-empty string 'jsonUrl'."
        )
    return json_url


def parse_batch_status(batch_id: str, data: dict) -> BatchStatus:
    result = data.get("extractResult")
    if not isinstance(result, list):
        raise ResponseFormatError(
            "Batch response data must contain list 'extractResult'."
        )
    jobs = []
    for item in result:
        if not isinstance(item, dict):
            raise ResponseFormatError("Batch extractResult items must be objects.")

View on GitHub (pinned to 2661c7c0ef)

Solutions

  1. Only request result URLs after the job reaches the 'done' state; poll the job status first.
  2. Verify the job actually completed successfully rather than failing, since failed jobs have no resultUrl.
  3. Inspect the status response data to confirm the server included resultUrl.

Example fix

status = client.get_status(job_id)
if status.state != "done":
    ...  # keep polling; resultUrl only exists for done jobs

When it happens

Trigger: Raised by validate_result_json_url() when a done-job response data lacks an object 'resultUrl'.

Common situations: A completed job status response did not include the 'resultUrl' object. Occurs when polling a job whose results expired or were never produced. Re-submit the job and fetch results promptly.


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