zeroclaw-labs/zeroclaw · error · anyhow::Error

download returned

Error message

download returned {}

What it means

Fires in download_release when the asset download request returns a non-success HTTP status. This is the response guard after the 'download request failed' context: the release binary artifact could not be fetched from the given URL. Common causes are removed/replaced release assets (404), rate limits, or transient CDN errors. Verify the release exists and retry.

Solutions

  1. Verify network access to the download host and retry the update.
  2. Check for a proxy or firewall blocking the download and configure it appropriately.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/commands/update.rs:446 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/3e5eba39695c86c3. Report an issue: GitHub.

Appendix: source

Thrown at src/commands/update.rs:446

/// binary, which is the only artifact the caller needs by name — everything
/// else in the archive is installed later by walking `staging` generically.
async fn download_release(
    url: &str,
    sha256sums_url: Option<&str>,
    staging: &Path,
) -> Result<PathBuf> {
    let client = reqwest::Client::builder()
        .user_agent(format!("zeroclaw/{}", env!("CARGO_PKG_VERSION")))
        .timeout(std::time::Duration::from_mins(5))
        .build()?;

    let resp = client
        .get(url)
        .send()
        .await
        .context("download request failed")?;
    if !resp.status().is_success() {
        bail!("download returned {}", resp.status());
    }

    let bytes = resp.bytes().await.context("failed to read download body")?;

    if let Some(sums_url) = sha256sums_url {
        verify_download_checksum(&bytes, url, sums_url, &client).await?;
    } else {
        ::zeroclaw_log::record!(
            WARN,
            ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Note)
                .with_outcome(::zeroclaw_log::EventOutcome::Unknown),
            "No SHA256SUMS asset found; skipping update download checksum verification"
        );
    }

    tokio::fs::create_dir_all(staging)
        .await
        .context("failed to create staging directory")?;

View on GitHub (pinned to 88bb9c8533)