gitbutlerapp/gitbutler · error

Installation failed and no backup available to restore

Error message

Installation failed and no backup available to restore

What it means

First-ever Linux install: the new but binary fails post-install validation and there is no previous installation to restore, so the installer bails. Nothing existed before; the freshly copied binary is left at ~/.local/bin/but but does not run. The root cause is the same class as the rollback variants: the host cannot execute the downloaded artifact.

Source

Thrown at crates/but-installer/src/install_linux.rs:124

    fs::set_permissions(&install_bin_path, perms)?;

    if !validate_installed_binary(&install_bin_path) {
        warn("Final installation verification failed");

        if let Some(but_backup) = but_backup {
            warn("Attempting to restore backup");
            fs::rename(&but_backup, &install_bin_path)?;

            if validate_installed_binary(&install_bin_path) {
                info("Backup restored successfully, exiting ...");
                bail!("Installation failed but your previous installation was restored");
            } else {
                bail!(
                    "Installation failed and backup restoration also failed - 'but' command may not work"
                );
            }
        } else {
            bail!("Installation failed and no backup available to restore");
        }
    } else if let Some(but_backup) = but_backup {
        info(&format!(
            "Removing backup at {}",
            but_backup.to_string_lossy()
        ));
        fs::remove_file(&but_backup)?;
    }

    Ok(())
}

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Run ~/.local/bin/but --version and read the loader error; 'No such file or directory' on an existing file means a missing ELF interpreter (glibc too new for the host)
  2. Verify architecture match: uname -m vs the artifact you requested
  3. Free space (df -h ~ /tmp) and reinstall
  4. Use a distro-compatible build or build but from source
Defensive patterns

Strategy: validation

Validate before calling

// Before first install: architecture must match and the bin dir must be exec-able
let arch_matches = match std::env::consts::ARCH {
    "x86_64" => artifact_is_x86_64,
    "aarch64" => artifact_is_aarch64,
    _ => false,
};
anyhow::ensure!(arch_matches, "artifact architecture does not match host");
anyhow::ensure!(!noexec_mount(&home.join(".local/bin")), "bin dir is noexec");

Try / catch

if let Err(e) = but_installer::run_installation_with_version(request, false) {
    if e.to_string().contains("no backup available to restore") {
        eprintln!("first install failed; check: ~/.local/bin/but --version, uname -m, df -h");
    }
    return Err(e);
}

Prevention

When it happens

Trigger: Fresh machine where the downloaded binary cannot execute: host glibc older than the binary's baseline, wrong architecture (aarch64 tarball on x86_64 or vice versa), noexec ~/.local/bin, or a truncated copy due to full disk.

Common situations: First install on an old LTS distro; ARM cloud instance vs x86 artifact mixups; hardened mounts; small home partitions.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/bdb7a9de2692059c. Report an issue: GitHub.