reflex-dev/reflex · error · ArchiveUploadError

could not upload the build to storage: HTTP {ex.response.sta

Error message

could not upload the build to storage: HTTP {ex.response.status_code}

What it means

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.

Source

Thrown at packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py:2245

    for attempt in range(UPLOAD_ATTEMPTS):
        try:
            reservation = reserve_archive_upload(app_id, sizes, client)
        except httpx.HTTPStatusError as ex:
            raise ArchiveUploadError(
                _response_detail(ex.response, f"HTTP {ex.response.status_code}")
            ) from ex
        except httpx.HTTPError as ex:
            raise ArchiveUploadError(
                f"could not reach the deployment service: {ex}"
            ) from ex
        if reservation is None:
            return None
        try:
            _put_reserved_archives(zip_dir, reservation, sizes)
        except httpx.HTTPStatusError as ex:
            if ex.response.status_code != HTTPStatus.FORBIDDEN:
                raise ArchiveUploadError(
                    f"could not upload the build to storage: HTTP {ex.response.status_code}"
                ) from ex
            if attempt < UPLOAD_ATTEMPTS - 1:
                logger.warning("the upload window expired; reserving another one")
        except httpx.HTTPError as ex:
            raise ArchiveUploadError(f"could not upload the build: {ex}") from ex
        else:
            return reservation["deployment_id"]
    raise ArchiveUploadError(
        "the upload did not finish before its window closed; this usually means "
        "the connection is too slow for the size of the build"
    )


def create_deployment(
    zip_dir: Path,
    client: AuthenticatedClient,
    app_name: str | None,

View on GitHub (pinned to 45b8ed5ab7)

Solutions

  1. Update reflex-hosting-cli to the latest version
  2. Check the Reflex hosting status page for storage incidents
  3. Clean and rebuild the deployment bundle (`.web`) so sizes match the reservation, then retry
Defensive patterns

Strategy: retry

Try / catch

try:
    upload_archives(...)
except ArchiveUploadError as ex:
    if 'could not upload the build to storage' in str(ex):
        rebuild_bundle_and_retry_once()

Prevention

When it happens

Trigger: _put_reserved_archives receives a non-403 error status during create_deployment, e.g. malformed presigned request or storage backend failure.

Common situations: Storage service incident; archive contents/sizes changed between reservation and upload; very old CLI producing requests the storage no longer accepts.

Related errors


AI-assisted analysis of reflex-dev/reflex@45b8ed5ab7 (2026-08-28). Data as JSON: /api/errors/fe6cbbae9421cd39. Report an issue: GitHub.