{"record":{"id":"b8d1d87049f59449","repo":"git-ecosystem/git-credential-manager","slug":"gpg-executable-does-not-exist-with-path-gpgpath","errorCode":null,"errorMessage":"GPG executable does not exist with path '{gpgPath}'","messagePattern":"GPG executable does not exist with path '(.+?)'","errorType":"exception","errorClass":"Trace2Exception","httpStatus":null,"severity":"error","filePath":"src/Core/CredentialStore.cs","lineNumber":365,"sourceCode":"        }\n\n        private string GetGpgPath()\n        {\n            string gpgPath;\n\n            // Use the GCM_GPG_PATH environment variable if set\n            if (_context.Environment.Variables.TryGetValue(Constants.EnvironmentVariables.GpgExecutablePath,\n                out gpgPath))\n            {\n                if (_context.FileSystem.FileExists(gpgPath))\n                {\n                    _context.Trace.WriteLine($\"Using Git executable from GCM_GPG_PATH: {gpgPath}\");\n                    return gpgPath;\n                }\n\n                var format = \"GPG executable does not exist with path '{0}'\";\n                var message = string.Format(format, gpgPath);\n                throw new Trace2Exception(_context.Trace2, message, format);\n            }\n\n            // If no explicit GPG path is specified, mimic the way `pass`\n            // determines GPG dependency (use gpg2 if available, otherwise gpg)\n            if (_context.Environment.TryLocateExecutable(\"gpg2\", out string gpg2Path))\n            {\n                _context.Trace.WriteLine($\"Using PATH-located GPG (gpg2) executable: {gpg2Path}\");\n                return gpg2Path;\n            }\n\n            gpgPath = _context.Environment.LocateExecutable(\"gpg\");\n            _context.Trace.WriteLine($\"Using PATH-located GPG (gpg) executable: {gpgPath}\");\n            return gpgPath;\n        }\n    }\n}\n","sourceCodeStart":347,"sourceCodeEnd":382,"githubUrl":"https://github.com/git-ecosystem/git-credential-manager/blob/e8ce762cd04b4100ae637b5fbf39ef9d0a96561e/src/Core/CredentialStore.cs#L347-L382","documentation":"GetGpgPath throws this Trace2Exception when an explicit GPG executable path (from GCM_GPG_PATH or the gpg setting) points to a file that does not exist or is not executable. GCM verifies the configured path and fails fast rather than letting `pass`/GPG fail later with an obscure error.","triggerScenarios":"GCM_GPG_PATH env var or credential.storeGpg/gpg config points to a non-existent or non-executable file; EnsureBackingStore -> ValidateGpgPass -> GetGpgPath resolves the setting and File.Exists/execution check fails.","commonSituations":"GPG installed via Homebrew/package manager at a path different from the configured one (e.g. /opt/homebrew/bin/gpg vs /usr/local/bin/gpg after macOS migration); typo in GCM_GPG_PATH; GPG removed during an upgrade.","solutions":["Correct GCM_GPG_PATH (env) or the gpg setting to the actual executable path (verify with `which gpg` / `where gpg`).","Clear GCM_GPG_PATH and let GCM auto-locate gpg2/gpg on PATH.","Install GnuPG if it is missing, or ensure the configured file has execute permission (chmod +x)."],"exampleFix":"// before\nexport GCM_GPG_PATH=/usr/local/bin/gpg\n// after\nexport GCM_GPG_PATH=$(which gpg)   # e.g. /opt/homebrew/bin/gpg","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nif (gpgPath && !fs.existsSync(gpgPath)) {\n  console.warn(`GCM_GPG_PATH does not exist: ${gpgPath}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set GCM_GPG_PATH via $(which gpg) rather than hardcoding paths","Re-check the GPG path after OS upgrades (e.g. /usr/local/bin -> /opt/homebrew/bin)","Omit the setting and let GCM locate gpg2/gpg automatically"],"tags":["git-credential-manager","gpg","path","configuration"],"backgroundTag":"file-not-found","analyzedSha":"e8ce762cd04b4100ae637b5fbf39ef9d0a96561e","analyzedAt":"2026-09-11T17:15:08.753Z","contentChangedAt":"2026-09-11T17:15:08.753Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}