reflex-dev/reflex · error · ArchiveUploadError

could not upload the build: {ex}

Error message

could not upload the build: {ex}

What it means

Raised when uploading the build to storage fails with a transport-level httpx.HTTPError (connection dropped, timeout, TLS failure) rather than an HTTP status. The archive bytes could not be delivered to the reserved storage URL.

Source

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

                _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,
    project_id: str | None,
    regions: list | None,
    hostname: str | None,
    vmtype: str | None,
    secrets: dict | None,
    packages: list | None,

View on GitHub (pinned to 45b8ed5ab7)

Solutions

  1. Retry the deploy on a stable, faster connection
  2. Reduce build size (prune unnecessary assets in .web/static)
  3. If behind a proxy, ensure it permits large PUT requests with long timeouts
  4. Retry — transient resets are common on big uploads
Defensive patterns

Strategy: retry

Try / catch

try:
    upload_archives(...)
except ArchiveUploadError as ex:
    if str(ex).startswith('could not upload the build:'):
        retry_with_backoff(max_attempts=3)

Prevention

When it happens

Trigger: _put_reserved_archives hits a network error: connection reset during upload, timeout on a large build, DNS/TLS failure to the storage host.

Common situations: Slow or unstable connection uploading a large build; proxy killing long uploads; mobile/hotspot networks; storage endpoint blocked by firewall.

Related errors


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