{"record":{"id":"bdb7a9de2692059c","repo":"gitbutlerapp/gitbutler","slug":"installation-failed-and-no-backup-available-to-res","errorCode":null,"errorMessage":"Installation failed and no backup available to restore","messagePattern":"Installation failed and no backup available to restore","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-installer/src/install_linux.rs","lineNumber":124,"sourceCode":"    fs::set_permissions(&install_bin_path, perms)?;\n\n    if !validate_installed_binary(&install_bin_path) {\n        warn(\"Final installation verification failed\");\n\n        if let Some(but_backup) = but_backup {\n            warn(\"Attempting to restore backup\");\n            fs::rename(&but_backup, &install_bin_path)?;\n\n            if validate_installed_binary(&install_bin_path) {\n                info(\"Backup restored successfully, exiting ...\");\n                bail!(\"Installation failed but your previous installation was restored\");\n            } else {\n                bail!(\n                    \"Installation failed and backup restoration also failed - 'but' command may not work\"\n                );\n            }\n        } else {\n            bail!(\"Installation failed and no backup available to restore\");\n        }\n    } else if let Some(but_backup) = but_backup {\n        info(&format!(\n            \"Removing backup at {}\",\n            but_backup.to_string_lossy()\n        ));\n        fs::remove_file(&but_backup)?;\n    }\n\n    Ok(())\n}\n","sourceCodeStart":106,"sourceCodeEnd":136,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-installer/src/install_linux.rs#L106-L136","documentation":"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.","triggerScenarios":"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.","commonSituations":"First install on an old LTS distro; ARM cloud instance vs x86 artifact mixups; hardened mounts; small home partitions.","solutions":["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)","Verify architecture match: uname -m vs the artifact you requested","Free space (df -h ~ /tmp) and reinstall","Use a distro-compatible build or build but from source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before first install: architecture must match and the bin dir must be exec-able\nlet arch_matches = match std::env::consts::ARCH {\n    \"x86_64\" => artifact_is_x86_64,\n    \"aarch64\" => artifact_is_aarch64,\n    _ => false,\n};\nanyhow::ensure!(arch_matches, \"artifact architecture does not match host\");\nanyhow::ensure!(!noexec_mount(&home.join(\".local/bin\")), \"bin dir is noexec\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = but_installer::run_installation_with_version(request, false) {\n    if e.to_string().contains(\"no backup available to restore\") {\n        eprintln!(\"first install failed; check: ~/.local/bin/but --version, uname -m, df -h\");\n    }\n    return Err(e);\n}","preventionTips":["Confirm uname -m matches the artifact platform before installing","Keep ~/.local/bin on an exec-mounted filesystem","Ensure adequate disk space and a supported glibc on first-install hosts"],"tags":["rust","linux","first-install","binary-validation","glibc","but-installer"],"backgroundTag":"installation-rollback","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}