{"record":{"id":"19b7e001a4f0aa47","repo":"gitbutlerapp/gitbutler","slug":"failed-to-get-app-bundle-name","errorCode":null,"errorMessage":"Failed to get app bundle name","messagePattern":"Failed to get app bundle name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-installer/src/install_macos.rs","lineNumber":73,"sourceCode":"    success(\"Download completed successfully\");\n\n    verify_signature(&tarball_path, &platform_info.signature, temp_dir.path())?;\n\n    info(\"Extracting archive...\");\n    let app_dir = extract_tarball(&tarball_path, temp_dir.path())?;\n    success(\"Archive extracted successfully\");\n\n    verify_app_structure(&app_dir)?;\n\n    install_app(&app_dir, &config.home_dir, channel)?;\n\n    Ok(())\n}\n\npub(crate) fn install_app(app_dir: &Path, home_dir: &Path, channel: Option<Channel>) -> Result<()> {\n    let app_basename = app_dir\n        .file_name()\n        .ok_or_else(|| anyhow!(\"Failed to get app bundle name\"))?;\n\n    let install_app = home_dir.join(\"Applications\").join(app_basename);\n    let install_app_backup = home_dir\n        .join(\"Applications\")\n        .join(format!(\"{}.backup\", app_basename.to_string_lossy()));\n    let install_app_new = home_dir\n        .join(\"Applications\")\n        .join(format!(\"{}.new\", app_basename.to_string_lossy()));\n\n    info(&format!(\n        \"Installing{} to {}...\",\n        channel\n            .map(|c| format!(\" channel {}\", c.display_name()))\n            .unwrap_or_default(),\n        install_app.display()\n    ));\n\n    // Clean up any leftover temp files from previous failed installations","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-installer/src/install_macos.rs#L55-L91","documentation":"install_app on macOS needs the .app bundle's file name to build the destination path under ~/Applications and its backup paths. If the Path app_dir has no final component, file_name() returns None and the error \"Failed to get app bundle name\" is thrown. This indicates the extracted .app directory path is malformed.","triggerScenarios":"download_and_install_app passes an app_dir returned by the archive scan whose Path terminates in \"..\" or is a root path, so file_name() yields None.","commonSituations":"A malformed tarball whose .app entry resolves to a degenerate path (e.g. entries like \".app\" or paths built with trailing separators collapsing to \"..\"), or tampered/corrupted archives.","solutions":["Re-download the release; the archive is likely corrupted or oddly packaged","Check the tarball contents (tar -tzf) to see the actual .app path shape","Verify disk space and integrity during extraction, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if app_dir.file_name().is_none() {\n    return Err(format!(\"degenerate app_dir path: {}\", app_dir.display()));\n}","typeGuard":null,"tryCatchPattern":"// treat this as a corrupted-archive signal and re-download\nmatch install_app(&app_dir, &home_dir, channel) {\n    Err(e) if e.to_string().contains(\"Failed to get app bundle name\") => eprintln!(\"archive malformed; re-download\"),\n    other => other?,\n}","preventionTips":["Re-download archives rather than trusting partially extracted content","Verify archive checksums before extraction","Inspect tarball paths for odd entries before installing"],"tags":["installer","path-resolution","macos"],"backgroundTag":"invalid-argument-format","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}