{"record":{"id":"96c628c93a12a9dd","repo":"reflex-dev/reflex","slug":"response-detail-ex-response-f-http-ex-response","errorCode":null,"errorMessage":"_response_detail(ex.response, f\"HTTP {ex.response.status_code}\")","messagePattern":"_response_detail\\(ex\\.response, f\"HTTP (.+?)\"\\)","errorType":"exception","errorClass":"ArchiveUploadError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":2232,"sourceCode":"        app_id: The app the build belongs to.\n        sizes: Each archive's byte count, keyed as in ``ARCHIVES``.\n        client: The authenticated client.\n\n    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:","sourceCodeStart":2214,"sourceCodeEnd":2250,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L2214-L2250","documentation":"Thrown by upload_archives when reserving an upload slot fails with an HTTP error status. The server's response detail (via _response_detail) plus the status code is wrapped in ArchiveUploadError. This is the first step of deploying: asking the hosting service for storage reservations for the build archives.","triggerScenarios":"reserve_archive_upload(app_id, sizes, client) returns a 4xx/5xx (e.g. 401/403 auth issue, 400 bad sizes, 500 server error) during create_deployment.","commonSituations":"Expired token mid-deploy; app_id not registered with hosting; server-side incident; version skew between an old CLI and current API contract.","solutions":["Read the response detail embedded in the message to identify the status code (401/403 -> re-login; 4xx otherwise -> fix request)","Update reflex-hosting-cli to the latest version and retry","Verify the app_id exists and your account has access via `reflex app list`","Retry later if the service returns 5xx"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    upload_archives(zip_dir, app_id, client)\nexcept ArchiveUploadError as ex:\n    detail = str(ex)  # contains status code + server detail\n    if 'HTTP 401' in detail or 'HTTP 403' in detail:\n        relogin_and_retry()\n    else:\n        raise","preventionTips":["Keep reflex-hosting-cli updated","Verify app_id is registered before deploying","Catch ArchiveUploadError around create_deployment and inspect the embedded status"],"tags":["deployment","upload","hosting","http-status-error"],"backgroundTag":"api-request-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}