{"record":{"id":"10876e484d23a385","repo":"PaddlePaddle/PaddleOCR","slug":"connection-failed-e","errorCode":null,"errorMessage":"Connection failed: {e}","messagePattern":"Connection failed: (.+?)","errorType":"exception","errorClass":"NetworkError","httpStatus":null,"severity":"error","filePath":"paddleocr/_api_client/_http.py","lineNumber":122,"sourceCode":"        body = {\n            \"fileUrl\": file_url,\n            \"model\": model,\n            \"optionalPayload\": optional_payload,\n        }\n        if page_ranges is not None:\n            body[\"pageRanges\"] = page_ranges\n        if batch_id is not None:\n            body[\"batchId\"] = batch_id\n        try:\n            resp = self._session.post(\n                self._jobs_url,\n                json=body,\n                timeout=self._timeout,\n            )\n        except requests.Timeout as e:\n            raise RequestTimeoutError(f\"Request timed out: {e}\") from e\n        except requests.ConnectionError as e:\n            raise NetworkError(f\"Connection failed: {e}\") from e\n        _raise_for_response(resp)\n        return _job_id_from_response(resp)\n\n    def submit_file(\n        self,\n        model: str,\n        file_path: str,\n        optional_payload: dict,\n        page_ranges: Optional[str] = None,\n        batch_id: Optional[str] = None,\n    ) -> str:\n        if not os.path.exists(file_path):\n            raise FileNotFoundError(file_path)\n        data = {\n            \"model\": model,\n            \"optionalPayload\": json.dumps(optional_payload),\n        }\n        if page_ranges is not None:","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_api_client/_http.py#L104-L140","documentation":"Error \"Connection failed: {e}\" thrown in PaddlePaddle/PaddleOCR.","triggerScenarios":"Raised when the HTTP request fails at the connection level (requests.ConnectionError), before any response is received.","commonSituations":"The connection to the API server failed (DNS, TLS, refused, or reset). Verify the base URL, network access, and any proxy configuration.","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."],"exampleFix":"curl -v https://<api-host>/  # verify reachability\nexport HTTPS_PROXY=http://proxy:8080  # if a proxy is required","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}