{"record":{"id":"5ef074194556f9d6","repo":"git-ecosystem/git-credential-manager","slug":"cannot-use-the-storenames-secretservice-creden","errorCode":null,"errorMessage":"Cannot use the '{StoreNames.SecretService}' credential backing store without a graphical interface present.\nSee {Constants.HelpUrls.GcmCredentialStores} for more information.","messagePattern":"Cannot use the '(.+?)' credential backing store without a graphical interface present\\.\nSee (.+?) for more information\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Core/CredentialStore.cs","lineNumber":268,"sourceCode":"            }\n        }\n\n        private void ValidateSecretService()\n        {\n            if (!PlatformUtils.IsLinux())\n            {\n                var message = $\"Can only use the '{StoreNames.SecretService}' credential store on Linux.\";\n                _context.Trace2.WriteError(message);\n                throw new Exception(message + Environment.NewLine +\n                                    $\"See {Constants.HelpUrls.GcmCredentialStores} for more information.\"\n                );\n            }\n\n            if (!_context.SessionManager.IsDesktopSession)\n            {\n                var message = $\"Cannot use the '{StoreNames.SecretService}' credential backing store without a graphical interface present.\";\n                _context.Trace2.WriteError(message);\n                throw new Exception(message + Environment.NewLine +\n                                    $\"See {Constants.HelpUrls.GcmCredentialStores} for more information.\"\n                );\n            }\n        }\n\n        private void ValidateGpgPass(out string storeRoot, out string execPath)\n        {\n            if (!PlatformUtils.IsPosix())\n            {\n                var message = $\"Can only use the '{StoreNames.Gpg}' credential store on POSIX systems.\";\n                _context.Trace2.WriteError(message);\n                throw new Exception(message + Environment.NewLine +\n                                    $\"See {Constants.HelpUrls.GcmCredentialStores} for more information.\"\n                );\n            }\n\n            execPath = GetGpgPath();\n","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/git-ecosystem/git-credential-manager/blob/e8ce762cd04b4100ae637b5fbf39ef9d0a96561e/src/Core/CredentialStore.cs#L250-L286","documentation":"Within ValidateSecretService, GCM additionally requires an active desktop (graphical) session because the Secret Service is provided by a desktop keyring daemon over D-Bus. Headless Linux hosts (SSH sessions, containers, CI runners) have no such session, so this Exception is thrown even on Linux.","triggerScenarios":"Configuring store=secretservice and running git from an SSH shell, systemd service, Docker container, or CI job where _context.SessionManager.IsDesktopSession is false.","commonSituations":"CI pipelines that inherit developer .gitconfig; Docker builds pushing to private registries via git; servers administered over SSH after migrating from a desktop machine.","solutions":["Switch the credential store on headless hosts to 'gpg' (pass) or 'cache' which do not require a desktop session.","Use a credential helper backed by a file or environment-based token (e.g. GCM_PROVIDER=none + PAT in a store file).","If a desktop session is genuinely intended, run inside a logged-in graphical session so the keyring/D-Bus session bus is available."],"exampleFix":"// before (CI runner env)\nexport GCM_CREDENTIAL_STORE=secretservice\n// after\nexport GCM_CREDENTIAL_STORE=gpg\nexport GCM_CREDENTIAL_STORE_GPG_PASSWD_FILE=~/pass.gpg","handlingStrategy":"fallback","validationCode":"// headless detection before configuring\nif (!process.env.DISPLAY && !process.env.WAYLAND_DISPLAY && storeType === 'secretservice') {\n  console.warn('No desktop session; secretservice store will fail. Use gpg or cache.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  // git operation with secretservice store\n} catch (ex) {\n  if (String(ex).includes('graphical interface')) {\n    // switch to GCM_CREDENTIAL_STORE=gpg or cache and retry\n  }\n}","preventionTips":["On servers/CI use gpg or file-based stores, not secretservice","Detect headless environments (no DISPLAY/WAYLAND_DISPLAY) before choosing the store","Keep desktop-specific config out of CI images"],"tags":["git-credential-manager","linux","headless","dbus","keyring"],"backgroundTag":"unsupported-platform","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"}