cube-js/cube · error

release archive does not contain a cube binary

Error message

release archive does not contain a cube binary

What it means

After downloading the release archive, `cube update` extracts the entry named 'cube' (or 'cube.exe'). If the archive contains no such file, the CLI bails — this indicates a packaging problem in the release artifact or an unexpected archive layout.

Source

Thrown at rust/cube-cli/src/commands/update.rs:94

/// Extract the `cube` binary from the release tar.gz archive.
fn extract_binary(archive: &[u8]) -> Result<Vec<u8>> {
    let gz = flate2::read::GzDecoder::new(archive);
    let mut tar = tar::Archive::new(gz);
    for entry in tar.entries()? {
        let mut entry = entry?;
        let path = entry.path()?;
        let name = path
            .file_name()
            .map(|n| n.to_string_lossy().to_string())
            .unwrap_or_default();
        if name == "cube" || name == "cube.exe" {
            let mut data = Vec::new();
            std::io::Read::read_to_end(&mut entry, &mut data)?;
            return Ok(data);
        }
    }
    bail!("release archive does not contain a cube binary");
}

/// Swap the running executable for the new binary.
///
/// The running file is first renamed aside (allowed on every platform,
/// including Windows, where an in-use file can't be overwritten but can be
/// renamed), then the new binary is written to the original path. The `.old`
/// leftover is cleaned up on the next run (see `cleanup_stale_binary`).
fn replace_current_exe(new_binary: &[u8]) -> Result<()> {
    let exe = std::env::current_exe().context("could not locate the running executable")?;
    let old = exe.with_extension("old");
    let _ = std::fs::remove_file(&old);
    std::fs::rename(&exe, &old)
        .with_context(|| format!("could not move {} aside", exe.display()))?;

    if let Err(e) = write_executable(&exe, new_binary) {
        // Restore the original on failure so the install isn't left broken.
        let _ = std::fs::rename(&old, &exe);

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Re-run `cube update` to re-download a fresh archive
  2. Check the release assets and, if possible, verify the archive contents manually (tar/unzip -l)
  3. Report the broken release and install a known-good version manually
Defensive patterns

Strategy: retry

Try / catch

try {
  run("cube update");
} catch (e) {
  if (String(e).includes("does not contain a cube binary")) {
    console.error("Release archive broken; pin a known-good version");
  } else throw e;
}

Prevention

When it happens

Trigger: Running `cube update` against a release whose archive was packaged incorrectly (binary renamed, missing, or nested under a directory the extractor doesn't traverse).

Common situations: Proxy or mirror serving a substitute/truncated archive; a broken or experimental release; corrupted download saved with the archive extension.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/090a542de2ef1eef. Report an issue: GitHub.