{"record":{"id":"7d88bc9ec37ad83b","repo":"gitbutlerapp/gitbutler","slug":"final-installation-verification-failed","errorCode":null,"errorMessage":"Final installation verification failed","messagePattern":"Final installation verification failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-installer/src/install_linux.rs","lineNumber":109,"sourceCode":"    info(&format!(\n        \"Installing{} to {}...\",\n        channel\n            .map(|c| format!(\" channel {}\", c.display_name()))\n            .unwrap_or_default(),\n        install_bin_path.to_string_lossy(),\n    ));\n\n    // NOTE: Must copy rather than rename. Rename assumes source and dest are on the same mount\n    // point, but /tmp on Linux systems is very often an in-memory file system (tmpfs) and thus on\n    // a different mount point than persistent files\n    fs::copy(but_path, &install_bin_path)?;\n\n    let mut perms = fs::metadata(&install_bin_path)?.permissions();\n    perms.set_mode(0o755);\n    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!(","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-installer/src/install_linux.rs#L91-L127","documentation":"The Linux installer copies the new but binary into place (fs::copy because /tmp is often tmpfs on a different mount, so rename would fail cross-device), sets mode 0o755, then validates the result by executing it. This warn fires when validation fails; with a backup present it renames the backup over the new binary and re-validates, bailing either 'restored' or 'restoration also failed'.","triggerScenarios":"validate_installed_binary(&install_bin_path) returns false at crates/but-installer/src/install_linux.rs:109 — the copied binary is truncated or corrupt (disk filled during the copy), built for the wrong architecture or libc, or cannot execute (permissions, noexec mount).","commonSituations":"Disk filling mid-copy; an arm64 binary on x86_64 or vice versa; home directory mounted noexec; glibc older than the binary requires.","solutions":["Check disk space and re-run the installer — truncated copies are the most common cause","Verify the downloaded binary's architecture matches uname -m","Confirm the install path is not mounted noexec (mount | grep home)","If the bail says the backup was restored, retry later; if 'but' is broken with no backup, reinstall from the official installer"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Validate the artifact before touching the installed path\nfn binary_runs(path: &std::path::Path) -> bool {\n    std::process::Command::new(path).arg(\"--version\").output().is_ok()\n}\n// run on the staged or downloaded binary first","typeGuard":null,"tryCatchPattern":"if !validate_installed_binary(&install_bin_path) {\n    if let Some(but_backup) = but_backup {\n        fs::rename(&but_backup, &install_bin_path)?;\n        if !validate_installed_binary(&install_bin_path) {\n            bail!(\"restore failed — 'but' may not work\");\n        }\n        bail!(\"Installation failed but your previous installation was restored\");\n    }\n    bail!(\"Installation failed and no backup available to restore\");\n}","preventionTips":["Verify checksums of downloaded binaries before installing","Check free disk space before fs::copy","Match architecture and libc to the target machine","Keep the backup until the new binary passes validation"],"tags":["rust","linux","installer","verification","binary","filesystem"],"backgroundTag":"post-install-verification-failed","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}