reflex-dev/reflex · error · ArchiveUploadError

_response_detail(ex.response, f"HTTP {ex.response.status_cod

Error message

_response_detail(ex.response, f"HTTP {ex.response.status_code}")

What it means

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.

Source

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

        app_id: The app the build belongs to.
        sizes: Each archive's byte count, keyed as in ``ARCHIVES``.
        client: The authenticated client.

    Returns:
        The deployment id the archives now live under, or None if this control
        plane has no reserve endpoint and they have to be relayed instead.

    Raises:
        ArchiveUploadError: The archives could not be put where they belong.

    """
    import httpx

    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:

View on GitHub (pinned to 45b8ed5ab7)

Solutions

  1. Read the response detail embedded in the message to identify the status code (401/403 -> re-login; 4xx otherwise -> fix request)
  2. Update reflex-hosting-cli to the latest version and retry
  3. Verify the app_id exists and your account has access via `reflex app list`
  4. Retry later if the service returns 5xx
Defensive patterns

Strategy: try-catch

Try / catch

try:
    upload_archives(zip_dir, app_id, client)
except ArchiveUploadError as ex:
    detail = str(ex)  # contains status code + server detail
    if 'HTTP 401' in detail or 'HTTP 403' in detail:
        relogin_and_retry()
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: Expired token mid-deploy; app_id not registered with hosting; server-side incident; version skew between an old CLI and current API contract.

Related errors


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