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
- Run the binary directly to see the block reason: /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri --version
- Clear the quarantine attribute: xattr -dr com.apple.quarantine /Applications/GitButler.app, or allow the app in Privacy & Security
- Install Rosetta if needed, then re-run the installer
- 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
- Pre-clear quarantine policy/allowlists for GitButler before scripted first installs
- Install Rosetta on Apple Silicon before deploying x86_64 artifacts
- Retry a failed first install once after clearing quarantine
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
- New installation verification failed - 'but' binary cannot r
- Installation failed but your previous installation was resto
- Installation failed and backup restoration also failed - 'bu
- Installation failed and no backup available to restore
- Failed to move new installation into place: {e}
AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20).
Data as JSON: /api/errors/4802e2ee3359f330.
Report an issue: GitHub.