{"record":{"id":"fe6cbbae9421cd39","repo":"reflex-dev/reflex","slug":"could-not-upload-the-build-to-storage-http-ex-re","errorCode":null,"errorMessage":"could not upload the build to storage: HTTP {ex.response.status_code}","messagePattern":"could not upload the build to storage: HTTP (.+?)","errorType":"exception","errorClass":"ArchiveUploadError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":2245,"sourceCode":"\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(\n        \"the upload did not finish before its window closed; this usually means \"\n        \"the connection is too slow for the size of the build\"\n    )\n\n\ndef create_deployment(\n    zip_dir: Path,\n    client: AuthenticatedClient,\n    app_name: str | None,","sourceCodeStart":2227,"sourceCodeEnd":2263,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L2227-L2263","documentation":"Raised when the actual PUT of the build archives to presigned storage fails with an HTTP status error other than 403 (FORBIDDEN). 403 is treated as an expired upload window and retried; any other status (e.g. 400, 500) aborts with this error.","triggerScenarios":"_put_reserved_archives receives a non-403 error status during create_deployment, e.g. malformed presigned request or storage backend failure.","commonSituations":"Storage service incident; archive contents/sizes changed between reservation and upload; very old CLI producing requests the storage no longer accepts.","solutions":["Update reflex-hosting-cli to the latest version","Check the Reflex hosting status page for storage incidents","Clean and rebuild the deployment bundle (`.web`) so sizes match the reservation, then retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    upload_archives(...)\nexcept ArchiveUploadError as ex:\n    if 'could not upload the build to storage' in str(ex):\n        rebuild_bundle_and_retry_once()","preventionTips":["Keep the CLI version current","Don't mutate .web between reservation and upload","Treat storage errors as retriable once"],"tags":["deployment","upload","storage","http-status-error"],"backgroundTag":"presigned-upload-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}