[BUG] Unhelpful error when system keyring entry is deleted — "secret not found in keyring"
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 396
- Forks
- 83
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 3
Description
Describe the bug
After deleting my local system keyring (due to unrelated issues with GNOME Keyring), every doppler command fails with:
Token not found in system keyring
Doppler Error: secret not found in keyring
This happens because ~/.doppler/.doppler.yaml still contains a token: reference (e.g., token: secret-<keyring-secret-reference-id>)
pointing to a keyring entry that no longer exists. The CLI attempts to look it up, fails, and gives an error that doesn't explain the cause or
how to fix it.
This error blocks all CLI operations — including doppler login, doppler configure, and even passing a token inline with --token or
DOPPLER_TOKEN=. There is no way to recover without manually discovering and editing the YAML config file.
To Reproduce
- Authenticate normally with
doppler login(token is stored in system keyring, reference saved in~/.doppler/.doppler.yaml) - Delete or reset the system keyring (e.g., remove GNOME Keyring data, switch desktop environments, or reinstall keyring service)
- Run any doppler command:
$ doppler --debug secrets --project my-project --config prd
Debug output:
Debug: Using config dir /home/user/.doppler
Debug: Using config file /home/user/.doppler/.doppler.yaml
Debug: Reading config file
Debug: Retrieving token from system keyring
Token not found in system keyring
Doppler Error: secret not found in keyring
Even explicitly providing a token fails:
$ DOPPLER_TOKEN="dp.st.prd.xxx" doppler secrets
Token not found in system keyring
Doppler Error: secret not found in keyring
$ doppler secrets --token "dp.st.prd.xxx"
Token not found in system keyring
Doppler Error: secret not found in keyring
- The only fix is to manually delete the stale token reference from
~/.doppler/.doppler.yamlor remove the file entirely, then re-rundoppler login.
Expected behavior
When the CLI detects that a keyring entry is missing, it should:
-
Provide a clear, actionable error message, e.g.:
Error: Saved auth token not found in system keyring (it may have been deleted). Run `doppler login` to re-authenticate, or remove ~/.doppler/.doppler.yaml to reset. -
Not block
--tokenorDOPPLER_TOKENusage. If a token is explicitly provided via flag or environment variable, the CLI should use it
directly rather than unconditionally attempting to read the stale keyring reference first. -
Ideally, offer to clear the stale reference automatically, e.g.:
Saved auth token not found in system keyring. Clear stale config and re-login? [Y/n]
Desktop
- OS: Debian GNU/Linux 13 (trixie), kernel 6.12.74+deb13+1-amd64
- Desktop: GNOME (GNOME Keyring)
CLI Version
doppler v3.75.3
Additional context
The root cause is that ~/.doppler/.doppler.yaml stores an indirect reference to the keyring:
scoped:
/:
token: secret-<keyring-secret-reference-id>
api-host: https://api.doppler.com
dashboard-host: https://dashboard.doppler.com
When the corresponding keyring entry is gone, the CLI enters a state where it cannot do anything — not even accept an explicitly-provided token.
This is likely because the keyring lookup is unconditional during config loading, before any command-specific token handling runs.
This may be related to the underlying zalando/go-keyring library. Previous keyring issues have been addressed in #475, #476, and #169.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing CLI config loading and token retrieval for ~/.doppler/.doppler.yaml, especially the system keyring lookup described in the debug output. Reproduce the stale token reference, then verify that an explicit --token or DOPPLER_TOKEN bypasses it and that the missing-entry error explains how to recover with doppler login or config removal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authentication, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100