gitbutlerapp/gitbutler · warning

Attempting to restore backup

Error message

Attempting to restore backup

What it means

A progress log inside the Linux installer's failure recovery: the freshly installed but binary failed verification and a backup of the previous version exists, so the installer renames the backup back over the install path and re-validates it. The next log line or bail! states the outcome — 'Backup restored successfully' or a combined failure. Acting on this message means acting on the outcome that follows it.

Source

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

            .map(|c| format!(" channel {}", c.display_name()))
            .unwrap_or_default(),
        install_bin_path.to_string_lossy(),
    ));

    // NOTE: Must copy rather than rename. Rename assumes source and dest are on the same mount
    // point, but /tmp on Linux systems is very often an in-memory file system (tmpfs) and thus on
    // a different mount point than persistent files
    fs::copy(but_path, &install_bin_path)?;

    let mut perms = fs::metadata(&install_bin_path)?.permissions();
    perms.set_mode(0o755);
    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()
        ));

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Read the next line: 'Backup restored successfully, exiting ...' means the old version is back and you can retry later
  2. 'backup restoration also failed' means reinstall but via the official installer script
  3. Fix the root cause first — disk space or wrong architecture — before updating again
  4. Verify with `but --version` afterwards, whichever branch ran
Defensive patterns

Strategy: fallback

Validate before calling

// Take a backup only if the backup is itself a working binary
if but_backup
    .as_deref()
    .map(validate_installed_binary)
    .unwrap_or(false)
{
    // a safe restore target exists
}

Try / catch

if let Err(e) = fs::rename(&but_backup, &install_bin_path) {
    bail!("restore failed: {e}");
}
if !validate_installed_binary(&install_bin_path) {
    bail!("restored backup does not run");
}

Prevention

When it happens

Trigger: Following the verification failure of entry 856 with but_backup present: fs::rename(&but_backup, &install_bin_path) executes at crates/but-installer/src/install_linux.rs:112 during install or update.

Common situations: Interrupted or partial updates (network drop mid-download, disk full during copy); architecture-mismatched binaries leaving the new install dead.

Related errors


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