PaddlePaddle/PaddleOCR · error · RequestTimeoutError

Request timed out: {e}

Error message

Request timed out: {e}

What it means

Error "Request timed out: {e}" thrown in PaddlePaddle/PaddleOCR.

Source

Thrown at paddleocr/_api_client/_http.py:120

        batch_id: Optional[str] = None,
    ) -> str:
        body = {
            "fileUrl": file_url,
            "model": model,
            "optionalPayload": optional_payload,
        }
        if page_ranges is not None:
            body["pageRanges"] = page_ranges
        if batch_id is not None:
            body["batchId"] = batch_id
        try:
            resp = self._session.post(
                self._jobs_url,
                json=body,
                timeout=self._timeout,
            )
        except requests.Timeout as e:
            raise RequestTimeoutError(f"Request timed out: {e}") from e
        except requests.ConnectionError as e:
            raise NetworkError(f"Connection failed: {e}") from e
        _raise_for_response(resp)
        return _job_id_from_response(resp)

    def submit_file(
        self,
        model: str,
        file_path: str,
        optional_payload: dict,
        page_ranges: Optional[str] = None,
        batch_id: Optional[str] = None,
    ) -> str:
        if not os.path.exists(file_path):
            raise FileNotFoundError(file_path)
        data = {
            "model": model,
            "optionalPayload": json.dumps(optional_payload),

View on GitHub (pinned to 2661c7c0ef)

Solutions

  1. Increase the client timeout if the server is slow (pass a larger timeout when constructing the client).
  2. Check network connectivity and latency between your host and the PaddleOCR API endpoint.
  3. Retry with exponential backoff; reduce request size (smaller files or fewer pages) if uploads are slow.

Example fix

client = PaddleOCRClient(token=..., timeout=60.0)  # raise the timeout
# or split large submissions into smaller jobs

When it happens

Trigger: Raised when the underlying HTTP request exceeds the configured client timeout (requests.Timeout).

Common situations: The request exceeded the configured timeout. Occurs on slow networks or overloaded servers. Increase the timeout, check connectivity, and retry with backoff.

Understand the failure class


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