PaddlePaddle/PaddleOCR · error · NetworkError
Connection failed: {e}
Error message
Connection failed: {e} What it means
Error "Connection failed: {e}" thrown in PaddlePaddle/PaddleOCR.
Source
Thrown at paddleocr/_api_client/_http.py:122
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),
}
if page_ranges is not None:View on GitHub (pinned to 2661c7c0ef)
Solutions
- Verify the API base URL is reachable: check DNS, firewall, and proxy settings.
- Confirm the service is up and the host/port are correct; try curl from the same machine.
- If behind a corporate proxy, configure HTTP(S)_PROXY environment variables or session proxies.
Example fix
curl -v https://<api-host>/ # verify reachability export HTTPS_PROXY=http://proxy:8080 # if a proxy is required
When it happens
Trigger: Raised when the HTTP request fails at the connection level (requests.ConnectionError), before any response is received.
Common situations: The connection to the API server failed (DNS, TLS, refused, or reset). Verify the base URL, network access, and any proxy configuration.
AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14).
Data as JSON: /api/errors/10876e484d23a385.
Report an issue: GitHub.