{"record":{"id":"f4264ef292fab140","repo":"gitbutlerapp/gitbutler","slug":"could-not-find-application-for","errorCode":null,"errorMessage":"Could not find application for '{}'","messagePattern":"Could not find application for '(.+?)'","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-api/src/open/program.rs","lineNumber":608,"sourceCode":"    fn resolve_cli_wrapper_abspath(&self) -> anyhow::Result<PathBuf> {\n        let app_dir_path = self.find_app_directory()?;\n        let cli_wrapper_path = self.cli_wrapper_path.as_deref().ok_or_else(|| {\n            anyhow::anyhow!(\"No CLI wrapper configured for {}\", self.bundle_identifier)\n        })?;\n        Ok(app_dir_path.join(cli_wrapper_path))\n    }\n\n    #[cfg(target_os = \"macos\")]\n    fn find_app_directory(&self) -> anyhow::Result<PathBuf> {\n        use objc2_app_kit::NSWorkspace;\n        use objc2_foundation::NSString;\n\n        let workspace = NSWorkspace::sharedWorkspace();\n        let bundle_identifier = NSString::from_str(&self.bundle_identifier);\n        let app_url = workspace\n            .URLForApplicationWithBundleIdentifier(&bundle_identifier)\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Could not find application for '{}'\",\n                    self.bundle_identifier\n                )\n            })?;\n\n        app_url.to_file_path().ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Could not resolve application path for '{}'\",\n                self.bundle_identifier\n            )\n        })\n    }\n}\n\n#[cfg(target_os = \"macos\")]\nfn open_in_macos_application(\n    app: &MacosApplication,\n    cli_arg_supplier: &CliArgumentSupplier,","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-api/src/open/program.rs#L590-L626","documentation":"MacosApplication::find_app_directory asks macOS Launch Services (NSWorkspace::URLForApplicationWithBundleIdentifier) for the app registered under bundle_identifier and got back None. That means no installed application on this machine currently claims that bundle id, so GitButler cannot locate the .app directory needed to resolve the CLI wrapper or launch the app.","triggerScenarios":"Resolving an application directory for a bundle identifier that Launch Services does not know: the target app was never installed on this Mac, was uninstalled, or the bundle_identifier string in the configuration does not match the app's real CFBundleIdentifier.","commonSituations":"Developer or user machine without the target app installed; a stale or typo'd bundle identifier after an app rebrand or config edit; an app installed from a DMG that Launch Services has not indexed; a corrupted Launch Services database after a macOS migration or restore.","solutions":["Install the application that owns the bundle identifier on this Mac","Verify the installed app's real bundle id with `mdls -name kMDItemCFBundleIdentifier /Applications/MyApp.app` and fix the configured bundle_identifier to match exactly","If the app is installed but still not found, re-register it (launch it once, or run `lsregister -f /Applications/MyApp.app`) so Launch Services refreshes"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Rust: ask Launch Services before entering the flow (macOS only)\n#[cfg(target_os = \"macos\")]\nfn app_installed(bundle_id: &str) -> bool {\n    use objc2_app_kit::NSWorkspace;\n    use objc2_foundation::NSString;\n    NSWorkspace::sharedWorkspace()\n        .URLForApplicationWithBundleIdentifier(&NSString::from_str(bundle_id))\n        .is_some()\n}","typeGuard":null,"tryCatchPattern":"match open_in_macos_application(&app, &args, spec) {\n    Err(err) if err.to_string().contains(\"Could not find application\") => {\n        // fall back to `open -b <bundle-id>` or prompt the user to install the app\n    }\n    result => result,\n}","preventionTips":["Validate configured bundle identifiers against installed apps at configuration time (mdls / NSWorkspace)","Re-check after app updates and rebrands, when bundle ids commonly change","Cache the resolution but revalidate when it starts failing"],"tags":["macos","launch-services","bundle-identifier","not-installed"],"backgroundTag":"application-not-found","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}