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 macOS install: the final 'but --version' validation of the installed symlink failed and there is no previous app to restore. The new app is in place but its CLI does not run. Same execution-failure class as the rollback variants, with nothing to fall back to.

Source

Thrown at crates/but-installer/src/install_macos.rs:278

        warn("Final installation verification failed - attempting to restore backup");
        if install_app_backup.exists() {
            fs::remove_dir_all(&install_app)?;
            fs::rename(&install_app_backup, &install_app)?;

            let restored_target = install_app.join("Contents/MacOS/gitbutler-tauri");
            let _ = fs::remove_file(&but_symlink);
            unix_fs::symlink(&restored_target, &but_symlink)?;

            if validate_installed_binary(&but_symlink) {
                success("Backup was restored successfully");
                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");
        }
    }

    success(&format!(
        "{} installed successfully",
        app_basename.to_string_lossy()
    ));
    // Remove backup on success
    let _ = fs::remove_dir_all(&install_app_backup);

    success("GitButler CLI (but) installed successfully");

    Ok(())
}

fn copy_dir_all(src: &Path, dst: &Path) -> io::Result<()> {
    fs::create_dir_all(dst)?;
    for entry in fs::read_dir(src)? {

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Run the binary directly to see the block reason: /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri --version
  2. Clear the quarantine attribute: xattr -dr com.apple.quarantine /Applications/GitButler.app, or allow the app in Privacy & Security
  3. Install Rosetta if needed, then re-run the installer
  4. Retry the install to replace a possibly corrupted first download

Example fix

# before: freshly installed binary blocked by quarantine
xattr -dr com.apple.quarantine /Applications/GitButler.app
# after
~/.local/bin/but --version   # runs
Defensive patterns

Strategy: validation

Validate before calling

// Before first install on macOS: can this host run the artifact at all?
let rosetta_ok = std::env::consts::ARCH == "aarch64"
    && std::path::Path::new("/Library/Apple/usr/libexec/oah/libRosettaRuntime").exists();
anyhow::ensure!(
    std::env::consts::ARCH == "x86_64" || rosetta_ok,
    "x86_64 artifact on arm64 requires Rosetta; install it first"
);

Try / catch

if let Err(e) = but_installer::run_installation_with_version(request, false) {
    let msg = e.to_string();
    if msg.contains("no backup available to restore") {
        let _ = std::process::Command::new("xattr")
            .args(["-dr", "com.apple.quarantine"])
            .arg("/Applications/GitButler.app").status();
        return but_installer::run_installation_with_version(request, false); // one retry
    }
    return Err(e);
}

Prevention

When it happens

Trigger: Fresh install where the binary is blocked by Gatekeeper quarantine, corrupted, or the wrong architecture - and no prior version exists to restore.

Common situations: First install on a managed/locked-down Mac; Apple Silicon without Rosetta receiving an x86_64 build; truncated download.

Related errors


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