{"record":{"id":"40e11874f9a1a2af","repo":"gitbutlerapp/gitbutler","slug":"could-not-find-please-make-sure-it-is-in-you","errorCode":null,"errorMessage":"Could not find '{}'. Please make sure it is in your `PATH` or configure the full path using `gpg.program` in the Git configuration","messagePattern":"Could not find '(.+?)'\\. Please make sure it is in your `PATH` or configure the full path using `gpg\\.program` in the Git configuration","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-core/src/commit/mod.rs","lineNumber":418,"sourceCode":"        let gpg_program = match config.trusted_path(\"gpg.program\")? {\n            Some(program) if !program.as_os_str().is_empty() => program,\n            _ => Path::new(\"gpg\").into(),\n        };\n\n        let mut cmd = into_command(\n            prepare_with_shell_on_windows(&gpg_program)\n                .args([\"--status-fd=2\", \"-bsau\"])\n                .arg(gix::path::from_bstring(signing_key))\n                .arg(\"-\"),\n        );\n        cmd.stdout(Stdio::piped())\n            .stderr(Stdio::piped())\n            .stdin(Stdio::piped());\n\n        let mut child = match cmd.spawn() {\n            Ok(child) => child,\n            Err(err) if err.kind() == std::io::ErrorKind::NotFound => {\n                bail!(\n                    \"Could not find '{}'. Please make sure it is in your `PATH` or configure the full path using `gpg.program` in the Git configuration\",\n                    gpg_program.display()\n                )\n            }\n            Err(err) => {\n                return Err(err).context(format!(\"Could not execute GPG program using {cmd:?}\"));\n            }\n        };\n        child.stdin.take().expect(\"configured\").write_all(buffer)?;\n\n        let output = child.wait_with_output()?;\n        if output.status.success() {\n            Ok(BString::new(output.stdout))\n        } else {\n            let stderr = BString::new(output.stderr);\n            let stdout = BString::new(output.stdout);\n            bail!(\"Failed to sign GPG: {stdout} {stderr}\");\n        }","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-core/src/commit/mod.rs#L400-L436","documentation":"The GPG signing path spawns the program from gpg.program (default 'gpg') and maps std::io::ErrorKind::NotFound from spawn to this friendly message: the executable could not be located at all. Other spawn failures get a different, generic context, so this error is specifically 'binary not on PATH / configured path wrong'.","triggerScenarios":"Committing with signing enabled on a machine where gpg is not installed, where the app's environment lacks the directory containing gpg (GUI apps on macOS/Windows get a minimal PATH), or where gpg.program is set to a nonexistent or moved binary.","commonSituations":"Desktop app launched from Finder/Start Menu whose PATH omits /usr/local/bin or /opt/homebrew/bin; gpgsuite/Gpg4win uninstalled but git config still points at the old path; minimal containers/CI images without gnupg.","solutions":["Install GPG (gnupg / Gpg4win / gpgsuite) and restart the app so the new PATH is picked up","Set the absolute path in git config: git config --global gpg.program /opt/homebrew/bin/gpg (or /usr/bin/gpg, C:\\Program Files\\GnuPG\\bin\\gpg.exe)","Verify from the same environment the app runs in: 'command -v gpg' inside that shell","If signing is not actually wanted, unset it: git config --unset gpg.program / user.signingkey / commit.gpgsign"],"exampleFix":"# before: 'gpg' not on the app's PATH\ngit config --global gpg.program gpg\n\n# after: pin the absolute path\ngit config --global gpg.program \"$(command -v gpg)\"\ngit commit -S -m 'signed'","handlingStrategy":"validation","validationCode":"// resolve the configured program before committing\nlet program = git_config.trusted_path(\"gpg.program\")?.unwrap_or_else(|| \"gpg\".into());\nanyhow::ensure!(\n    which::which(&program).is_ok(),\n    \"gpg program '{}' not found — install GnuPG or set gpg.program to its absolute path\",\n    program.display()\n);","typeGuard":null,"tryCatchPattern":"match sign_buffer(&repo, &buffer).await {\n    Err(e) if e.to_string().contains(\"make sure it is in your `PATH`\") =>\n        Err(e.context(\"install GnuPG or: git config --global gpg.program /full/path/to/gpg\")),\n    r => r?,\n}","preventionTips":["Set gpg.program to an absolute path on machines where GUI-launched apps have a minimal PATH","Install gnupg/Gpg4win as part of the workstation setup for signed-commit workflows","Probe for the signer at app startup and warn before the user types a commit message"],"tags":["git","commit-signing","gpg","path","environment"],"backgroundTag":"executable-not-found","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}