{"record":{"id":"246fe24985df304f","repo":"reflex-dev/reflex","slug":"could-not-reach-the-deployment-service-ex","errorCode":null,"errorMessage":"could not reach the deployment service: {ex}","messagePattern":"could not reach the deployment service: (.+?)","errorType":"exception","errorClass":"ArchiveUploadError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":2236,"sourceCode":"    Returns:\n        The deployment id the archives now live under, or None if this control\n        plane has no reserve endpoint and they have to be relayed instead.\n\n    Raises:\n        ArchiveUploadError: The archives could not be put where they belong.\n\n    \"\"\"\n    import httpx\n\n    for attempt in range(UPLOAD_ATTEMPTS):\n        try:\n            reservation = reserve_archive_upload(app_id, sizes, client)\n        except httpx.HTTPStatusError as ex:\n            raise ArchiveUploadError(\n                _response_detail(ex.response, f\"HTTP {ex.response.status_code}\")\n            ) from ex\n        except httpx.HTTPError as ex:\n            raise ArchiveUploadError(\n                f\"could not reach the deployment service: {ex}\"\n            ) from ex\n        if reservation is None:\n            return None\n        try:\n            _put_reserved_archives(zip_dir, reservation, sizes)\n        except httpx.HTTPStatusError as ex:\n            if ex.response.status_code != HTTPStatus.FORBIDDEN:\n                raise ArchiveUploadError(\n                    f\"could not upload the build to storage: HTTP {ex.response.status_code}\"\n                ) from ex\n            if attempt < UPLOAD_ATTEMPTS - 1:\n                logger.warning(\"the upload window expired; reserving another one\")\n        except httpx.HTTPError as ex:\n            raise ArchiveUploadError(f\"could not upload the build: {ex}\") from ex\n        else:\n            return reservation[\"deployment_id\"]\n    raise ArchiveUploadError(","sourceCodeStart":2218,"sourceCodeEnd":2254,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L2218-L2254","documentation":"Thrown by upload_archives when reserving the upload fails at the transport level (any httpx.HTTPError that is not a status error): DNS failure, connection refused, timeout, TLS error. The CLI cannot reach the hosting deployment service at all, so no reservation could be made.","triggerScenarios":"reserve_archive_upload raises httpx.ConnectError/ConnectTimeout/ReadTimeout during create_deployment; network down, proxy blocking, firewall, or the hosting service endpoint unreachable.","commonSituations":"Corporate proxy/VPN intercepting requests; no internet connectivity; custom HOSTING_SERVICE URL misconfigured; transient network outage.","solutions":["Check network connectivity to the Reflex hosting service endpoint","Configure proxy environment variables (HTTP_PROXY/HTTPS_PROXY) if behind a corporate proxy","Retry the deploy once connectivity is restored"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import socket\nsocket.gethostbyname(urlparse(constants.Hosting.HOSTING_SERVICE).hostname)  # fails fast if DNS is broken","typeGuard":null,"tryCatchPattern":"try:\n    upload_archives(...)\nexcept ArchiveUploadError as ex:\n    if 'could not reach the deployment service' in str(ex):\n        wait_and_retry_with_backoff()","preventionTips":["Verify connectivity to the hosting endpoint before deploying","Set HTTP_PROXY/HTTPS_PROXY in proxied environments","Wrap deploys in retry with exponential backoff for transport failures"],"tags":["network","deployment","upload","connection-error","hosting"],"backgroundTag":"service-unreachable","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}