PaddlePaddle/PaddleOCR · error · ResponseFormatError

Response data must contain non-empty string 'jobId'.

Error message

Response data must contain non-empty string 'jobId'.

What it means

Error "Response data must contain non-empty string 'jobId'." thrown in PaddlePaddle/PaddleOCR.

Source

Thrown at paddleocr/_api_client/_core.py:177

    raise APIError(status_code, msg)


def unwrap_api_response(payload: dict, status_code: int) -> dict:
    if not isinstance(payload, dict):
        raise ResponseFormatError("Response body must be a JSON object.")
    code = payload.get("code", 0)
    if code not in (0, None):
        raise APIError(status_code, extract_api_message_from_payload(payload) or "")
    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:

View on GitHub (pinned to 2661c7c0ef)

Solutions

  1. Ensure the job submission request succeeded; the submit response must contain data.jobId as a non-empty string.
  2. Check that the API base URL and model name are correct so the server actually creates a job.
  3. Inspect the raw response JSON to confirm the server contract; report the mismatch if the server omits jobId.

Example fix

job_id = data.get("jobId")
if not isinstance(job_id, str) or not job_id:
    print(data)  # see what the server returned instead

When it happens

Trigger: Raised by extract_job_id() when the API submit response data lacks a non-empty string 'jobId'.

Common situations: A job submission response lacked a valid 'jobId'. Occurs when the server accepts the request but returns an incomplete payload. Retry the submission; if persistent, check API version compatibility.


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