git-ecosystem/git-credential-manager · error · Exception
Can only use the ' ' credential store on Linux. See for…
Error message
Can only use the '{StoreNames.SecretService}' credential store on Linux.
See {Constants.HelpUrls.GcmCredentialStores} for more information. What it means
ValidateSecretService throws this Exception when the credential store is set to '{secretService}' (the freedesktop.org Secret Service / libsecret API) on a non-Linux platform. The Secret Service D-Bus API only exists on Linux, so GCM rejects the configuration up front in EnsureBackingStore.
Solutions
- Change credential.store / GCM_CREDENTIAL_STORE to a store valid for the current OS (e.g. 'gpg', 'cache', or the default).
- Remove the setting entirely to let GCM choose the platform default.
- On WSL, either use the Windows store via GCM for Windows or configure gpg/pass inside the WSL distro.
Example fix
// before (macOS ~/.gitconfig) [credential] store = secretservice // after [credential] store = macOSkeychain
Defensive patterns
Strategy: validation
Validate before calling
if (storeType === 'secretservice' && process.platform !== 'linux') {
console.warn('secretservice store is Linux-only; falling back to default');
} Type guard
const isSecretServiceUsable = (store: string, platform: string) => store === 'secretservice' ? platform === 'linux' : true;
Prevention
- Check the target OS before copying Linux credential configs to other machines
- Prefer omitting credential.store and using GCM auto-detection
- Document per-OS store choices in team setup guides
When it happens
Trigger: Setting credential.store / GCM_CREDENTIAL_STORE to StoreNames.SecretService on macOS or Windows; EnsureBackingStore calls ValidateSecretService and PlatformUtils.IsLinux() is false.
Common situations: Linux-tuned CI configs reused on macOS dev machines; WSL users assuming Secret Service works under Windows; docs recommending 'secretservice' without OS caveats.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- Can only use the ' ' credential store on macOS. See for…
- Can only use the ' ' credential store on Windows. See for…
- Can only use the ' ' credential store on Windows. See for…
- Cannot use the ' ' credential backing store without a…
- Can only use the ' ' credential store on POSIX systems. See…
AI-assisted analysis of git-ecosystem/git-credential-manager@e8ce762cd0 (2026-09-11).
Data as JSON: /api/errors/2412fe0206934f2f.
Report an issue: GitHub.
Appendix: source
Thrown at src/Core/CredentialStore.cs:259
private void ValidateMacOSKeychain()
{
if (!PlatformUtils.IsMacOS())
{
var message = $"Can only use the '{StoreNames.MacOSKeychain}' credential store on macOS.";
_context.Trace2.WriteError(message);
throw new Exception(message + Environment.NewLine +
$"See {Constants.HelpUrls.GcmCredentialStores} for more information."
);
}
}
private void ValidateSecretService()
{
if (!PlatformUtils.IsLinux())
{
var message = $"Can only use the '{StoreNames.SecretService}' credential store on Linux.";
_context.Trace2.WriteError(message);
throw new Exception(message + Environment.NewLine +
$"See {Constants.HelpUrls.GcmCredentialStores} for more information."
);
}
if (!_context.SessionManager.IsDesktopSession)
{
var message = $"Cannot use the '{StoreNames.SecretService}' credential backing store without a graphical interface present.";
_context.Trace2.WriteError(message);
throw new Exception(message + Environment.NewLine +
$"See {Constants.HelpUrls.GcmCredentialStores} for more information."
);
}
}
private void ValidateGpgPass(out string storeRoot, out string execPath)
{
if (!PlatformUtils.IsPosix())
{View on GitHub (pinned to e8ce762cd0)