You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
laptop(amd): SDDM login never unlocks GNOME Keyring - enable pam_gnome_keyring so the keyring-held gh token survives reboots #5477
On the amd laptop, the GNOME Keyring is never unlocked by the graphical login, so any program that keeps secrets in the keyring (gh does, for its OAuth token) hangs indefinitely when it runs outside the desktop session — SSH and agent contexts included. Observed live on 2026-11-04: after gh migrated its token into the keyring, gh auth status from SSH stalled for minutes and orphaned gh auth git-credential get processes piled up.
Root cause (measured, not inferred)
The display manager is SDDM. /etc/pam.d/sddm contains no pam_gnome_keyring lines (only /etc/pam.d/login has them), so the login password is never handed to the keyring.
gnome-keyring-daemon is started by the desktop session (gnome-keyring-daemon --start --foreground --components=secrets), not by PAM with --login.
After a full desktop login, both keyring collections still reported Locked=true over the Secret Service API. Property reads answer in about 5 ms; any operation that touches a locked collection routes to the SystemPrompter on the graphical display, which a non-desktop caller can never answer — that is the hang.
Two collections exist and both are labeled Login: the collection named login (the historical PAM keyring) and the collection named Login (target of the default alias until 2026-11-04, file default in ~/.local/share/keyrings dated 2024-10-13).
Imperative fix already live (2026-11-04)
Restarted the daemon as gnome-keyring-daemon --unlock with the account password piped from 1Password (value never printed or logged): the login collection unlocked headlessly, proving both the password and the mechanism.
Deleted the two stale, invalid gh entries the bad migration left in the login collection.
Repointed the default collection alias to the login collection (persists in ~/.local/share/keyrings/default, which now reads login).
Stored the current gh token (scopes: admin:org, codespace, gist, repo, workflow) in the keyring; ~/.config/gh/hosts.yml now holds no token.
Verified from fresh plain SSH execs: gh auth status reports the dezren39 account as (keyring) in about 0.5 s, gh api user returns dezren39, the scope header matches, and a git push --dry-run to this repo succeeds.
What this issue owns: the durable fix
The unlocked daemon above is a one-off imperative process. After the next reboot the daemon returns locked and non-desktop keyring reads stall again until someone re-runs the manual unlock (account password into gnome-keyring-daemon --unlock while replacing the session daemon — a ten-second operation, proven). Make unlock declarative in the amd host configuration:
With PAM unlock, the sddm login hands the password to the keyring at authentication time, the login collection stays unlocked for the whole session, and every context that reaches the user bus (SSH, agents, user services) can read the gh token without stalling.
Out of scope here: the duplicate Login collection (locked, holds 10 application items, left untouched) — merging it into the login collection is a separate tidy.
Implemented: PR #5480, merged as eaa7fdb51e9a0fab29f0a59bf4de0b839c52874b (main's current HEAD). Leaving this issue open — it closes on the post-switch proof below.
Where it landed: one inline module in the amd host's module list in nixos/hosts/default.nix (the tree's home for amd-only settings; the shared SDDM enable in nixos/services/default.nix is untouched, and eval confirms the nixos host is unaffected).
Deviation from the fix as sketched here, with evidence: the bare line security.pam.services.sddm.enableGnomeKeyring = true; is a no-op in this tree. Verified at eval against the real amd config: with only the flag set, the generated pam.d/sddm is byte-identical to baseline. In this module set, sddm's PAM rule set is a custom delegation set — each phase holds a single login rule (order 10100, include/substack) — which replaces the default rule generation that the flag feeds, so the flag injects nothing. (The login service's own keyring rules exist precisely because its rule set is the generated one.)
The merged module therefore sets the flag (intent; effective if the rule set ever reverts to defaults) and adds the gnome_keyring rules to sddm's auth/password/session rule sets explicitly, mirroring the login service's rules — module path and order are referenced from config.security.pam.services.login.rules, not copied, so they track nixpkgs. Generated pam.d/sddm after the change:
Still remaining (the close criteria): this rides the next switch (alongside the libvirt LoadCredential change). After that switch + a reboot + a graphical SDDM login, verify: the login keyring collection reports Locked=false over the Secret Service API with no manual gnome-keyring-daemon --unlock step, and a plain-SSH gh auth status completes in ~0.5s showing the keyring-held token with the full scope set (admin:org, codespace, gist, repo, workflow). If Locked is still true after that proof, the next lever is replacing sddm's delegation rule set with a full native stack — the eval harness used here (flag/rules/text per service, baseline diff) is the way to verify that change before landing it.
2026-11-04 switch round landed generation 530 (kernel 6.18.60). The merged SDDM/PAM change is live on the running system: /etc/pam.d/sddm contains the 3 pam_gnome_keyring lines (auth / password / session), verified pre- and post-reboot.
The remaining close criterion — the login collection reporting Locked=false after a graphical SDDM login with no manual unlock — is not yet provable: post-reboot polls (09:40–09:50 CST) show Locked=true and no console session (who empty), i.e. Drew has not logged in graphically on this boot yet. That is the expected pre-login state; plain-SSH gh calls stalling pre-login is the same expected locked-keyring behavior, not a failure.
Leaving this open. The first graphical login on this boot closes the proof — a Locked=false read with no manual unlock is the only evidence still needed.
Live system: /etc/pam.d/sddm contains the 3 pam_gnome_keyring lines.
PAM unlock proof — PASS. This boot began 2026-11-04 18:17; the graphical tty2 (seat0) login followed at 18:18; the PAM keyring daemon (gnome-keyring-daemon --daemonize --login) started 2026-11-04 18:18:38 — i.e. launched by PAM at login, with no manual gnome-keyring-daemon --unlock step. Read today over the Secret Service API (user bus, busctl): the default alias resolves to the login collection and its Locked property is false. (The duplicate Login collection still reads Locked=true — explicitly out of scope here, unchanged.)
gh half — NOT currently provable, because the token moved back to the file.gh auth status from SSH completes in ~0.69s, but it reports the account against /home/user/.config/gh/hosts.yml (not (keyring)), hosts.yml again contains two non-empty oauth_token entries, and the live token's scopes are admin:org, gist, repo, workflow — codespace from the 2026-11-04 keyring-stored token is absent. So today's fast gh is explained by a file-held token, not by a keyring read.
Remaining step (scoped, in order): re-migrate the gh token into the now-reliably-unlocked login keyring (and restore the codespace scope), then re-verify from a plain SSH exec: gh auth status shows (keyring), completes in ~0.5s, with the full scope set. That closes this issue. The re-migration touches live credential storage, so it is recorded here and enqueued as its own small-fix task rather than done inside this triage; the PAM mechanism it depends on is proven above, so it should now stick across reboots.
🤖 Agent note · parked — migration attempted, blocked on a GitHub GraphQL rate-limit error
Agent: queue worker (repo-worker-code), lane code-a
Session / ID: task 10478
Found via: queue claim (small_fix remainder from task 10049 triage)
Preconditions verified fresh (laptop, this run): default keyring file reads login; collection login Locked=false (PAM unlock holding this boot); duplicate Login collection still Locked=true (out of scope, untouched). gh auth status completes in ~0.87s but reports the account against /home/user/.config/gh/hosts.yml; hosts.yml holds 2 non-empty oauth_token entries; live scopes admin:org, gist, repo, workflow (no codespace) — exactly the state task 10049 recorded.
Attempt: backed up hosts.yml to ~/.local/state/gh-migration-backup-2026-11-05/hosts.yml (0600), then piped the current token into gh auth login --with-token (value never printed or logged) with the user bus exported, so gh would re-store it in the unlocked keyring. Twice, ~20s apart: both failed at gh's validation step — error retrieving current user: GraphQL: API rate limit already exceeded for user ID 11225574 — even though gh api rate_limit shows core remaining 4820/5000 and graphql remaining 4261/5000 at the same moment. Retrying an auth write against a rate-limit error is the wrong move, so the attempt stopped there.
State after: verified unchanged — hosts.yml is byte-identical to the backup, gh auth status unchanged, nothing was written to the keyring. No partial migration exists.
Remainder (in order): (1) retry the same gh auth token | gh auth login --with-token migration once the GraphQL limit error clears (transient class; the backup stays in place until it lands); verify gh auth status shows (keyring), hosts.yml token entries = 0, ~0.5s from plain SSH. (2) Restore the codespace scope via an interactive gh auth refresh -s codespace (needs the laptop browser / Drew present), then re-verify the full scope set. Issue stays OPEN until both verify.
🤖 Agent note · parked — awaiting one live coordinated session (codespace scope)
Agent: queue worker (repo-worker-code), Muse lane any-i
Session / ID: task 10478
Found via: queue claim (time-condition revival of the earlier park)
Fresh verification (2026-11-17, this lane):~/.config/gh/hosts.yml still contains zerooauth_token entries — the keyring-migration half of this issue remains complete, unchanged since the 2026-11-16 verification (keyring-held token, scopes admin:org/gist/repo/workflow). One read limitation, stated plainly: through the laptop-agent route the daemon injects GH_TOKEN, so gh auth status reports the fleet token's view and the keyring token's own scope set cannot be re-read from here; the 2026-11-16 plain-SSH verification stands as the last clean read.
What remains (unchanged): the codespace scope. gh auth refresh -s codespace enters the GitHub device flow, which needs Drew to approve a fresh one-time code in real time — impossible in a detached shift (a prior attempt timed out at 85s with no approver present). Drew already authorized the refresh (ledger item codespace-scope-5477, answered 2026-11-07); the step is one live coordinated session: run the refresh on the laptop, relay the fresh code to Drew, approve, then verify codespace appears in gh auth status and close laptop(amd): SDDM login never unlocks GNOME Keyring - enable pam_gnome_keyring so the keyring-held gh token survives reboots #5477 with that evidence.
Park: task 10478 is re-parked on that manual condition with a long delay so it stops consuming lane passes; wake it when a live session with Drew is available.
Next: plain-SSH verification reads (hosts.yml token count, keyring auth status + scopes, Secret Service Locked state), then close or park on what they show.
Both acceptance criteria now pass on fresh reads. No token values were printed, logged, or copied anywhere in this verification — only storage location, scope names, and timings.
Non-interactive exec of the real gh binary (fleet shim bypassed, clean environment with no inherited session vars so no injected GH_TOKEN is possible, keyring reached over the user bus only):
Logged in to github.com account dezren39 (keyring), Active account: true
wall time 0.443s (~0.5s as required)
2. Codespace scope present
Same read reports token scopes: admin:org, codespace, gist, repo, workflow — the full required set including codespace.
Correction to the prior parked state: reads through 2026-11-16 (via shimmed/agent routes that inject a fleet GH_TOKEN) showed the scope set withoutcodespace. Today's direct keyring read shows codespace present, so the keyring token gained that scope at some point between 11-16 and 11-22 (not by this shift — no refresh was run here; no live device-flow session occurred). The gh auth refresh -s codespace step is therefore no longer outstanding.
The earlier scope reads that omitted codespace were looking at the injected fleet token's view, not the keyring token itself — worth knowing for future reads: always bypass the gh shim (fleet gh passthrough injects its own token) when checking the keyring token.
Method note: localhost SSH is not key-authorized from a detached session, so the "plain SSH exec" was approximated as a clean-environment non-interactive exec (env -i + only HOME/USER/XDG_RUNTIME_DIR/DBUS_SESSION_BUS_ADDRESS/PATH), which carries the same evidentiary properties: no ambient GH_TOKEN, no graphical session env, keyring via the user bus.
No repo changes were needed (remainder was laptop-live-system verification only). Closing per the task acceptance criteria.
Activity
fix(amd): enable pam_gnome_keyring for SDDM so the keyring unlocks at…
fix(amd): unlock GNOME Keyring at SDDM login - keyring rules for the …
dezren39 commentedon Nov 4, 2026
Implemented: PR #5480, merged as
eaa7fdb51e9a0fab29f0a59bf4de0b839c52874b(main's current HEAD). Leaving this issue open — it closes on the post-switch proof below.Where it landed: one inline module in the amd host's module list in
nixos/hosts/default.nix(the tree's home for amd-only settings; the shared SDDM enable innixos/services/default.nixis untouched, and eval confirms thenixoshost is unaffected).Deviation from the fix as sketched here, with evidence: the bare line
security.pam.services.sddm.enableGnomeKeyring = true;is a no-op in this tree. Verified at eval against the real amd config: with only the flag set, the generatedpam.d/sddmis byte-identical to baseline. In this module set, sddm's PAM rule set is a custom delegation set — each phase holds a singleloginrule (order 10100, include/substack) — which replaces the default rule generation that the flag feeds, so the flag injects nothing. (Theloginservice's own keyring rules exist precisely because its rule set is the generated one.)The merged module therefore sets the flag (intent; effective if the rule set ever reverts to defaults) and adds the
gnome_keyringrules to sddm's auth/password/session rule sets explicitly, mirroring theloginservice's rules — module path and order are referenced fromconfig.security.pam.services.login.rules, not copied, so they track nixpkgs. Generatedpam.d/sddmafter the change:Still remaining (the close criteria): this rides the next switch (alongside the libvirt LoadCredential change). After that switch + a reboot + a graphical SDDM login, verify: the
loginkeyring collection reports Locked=false over the Secret Service API with no manualgnome-keyring-daemon --unlockstep, and a plain-SSHgh auth statuscompletes in ~0.5s showing the keyring-held token with the full scope set (admin:org, codespace, gist, repo, workflow). If Locked is still true after that proof, the next lever is replacing sddm's delegation rule set with a full native stack — the eval harness used here (flag/rules/text per service, baseline diff) is the way to verify that change before landing it.developing-today commentedon Nov 4, 2026
Switch-round update: fix is live; Locked proof pending Drew's graphical login
2026-11-04 switch round landed generation 530 (kernel 6.18.60). The merged SDDM/PAM change is live on the running system:
/etc/pam.d/sddmcontains the 3pam_gnome_keyringlines (auth / password / session), verified pre- and post-reboot.The remaining close criterion — the
logincollection reportingLocked=falseafter a graphical SDDM login with no manual unlock — is not yet provable: post-reboot polls (09:40–09:50 CST) showLocked=trueand no console session (whoempty), i.e. Drew has not logged in graphically on this boot yet. That is the expected pre-login state; plain-SSHghcalls stalling pre-login is the same expected locked-keyring behavior, not a failure.Leaving this open. The first graphical login on this boot closes the proof — a
Locked=falseread with no manual unlock is the only evidence still needed.dezren39 commentedon Nov 5, 2026
🤖 Agent note · triaged
Verified fresh, 2026-11-05 ~06:28 CST:
eaa7fdb51e9a0fab29f0a59bf4de0b839c52874b); currentorigin/main(04f78696abfb) still carries the module —nixos/hosts/default.nix:196setssecurity.pam.services.sddm.enableGnomeKeyring = true;with the explicitgnome_keyringrules./etc/pam.d/sddmcontains the 3pam_gnome_keyringlines.gnome-keyring-daemon --daemonize --login) started 2026-11-04 18:18:38 — i.e. launched by PAM at login, with no manualgnome-keyring-daemon --unlockstep. Read today over the Secret Service API (user bus,busctl): the default alias resolves to thelogincollection and itsLockedproperty is false. (The duplicateLogincollection still readsLocked=true— explicitly out of scope here, unchanged.)gh auth statusfrom SSH completes in ~0.69s, but it reports the account against/home/user/.config/gh/hosts.yml(not(keyring)),hosts.ymlagain contains two non-emptyoauth_tokenentries, and the live token's scopes areadmin:org, gist, repo, workflow—codespacefrom the 2026-11-04 keyring-stored token is absent. So today's fast gh is explained by a file-held token, not by a keyring read.Remaining step (scoped, in order): re-migrate the gh token into the now-reliably-unlocked
loginkeyring (and restore thecodespacescope), then re-verify from a plain SSH exec:gh auth statusshows(keyring), completes in ~0.5s, with the full scope set. That closes this issue. The re-migration touches live credential storage, so it is recorded here and enqueued as its own small-fix task rather than done inside this triage; the PAM mechanism it depends on is proven above, so it should now stick across reboots.Leaving this issue open for that last step.
developing-today commentedon Nov 5, 2026
🤖 Agent note · parked — migration attempted, blocked on a GitHub GraphQL rate-limit error
login; collectionloginLocked=false (PAM unlock holding this boot); duplicateLogincollection still Locked=true (out of scope, untouched).gh auth statuscompletes in ~0.87s but reports the account against/home/user/.config/gh/hosts.yml; hosts.yml holds 2 non-emptyoauth_tokenentries; live scopesadmin:org, gist, repo, workflow(nocodespace) — exactly the state task 10049 recorded.~/.local/state/gh-migration-backup-2026-11-05/hosts.yml(0600), then piped the current token intogh auth login --with-token(value never printed or logged) with the user bus exported, so gh would re-store it in the unlocked keyring. Twice, ~20s apart: both failed at gh's validation step —error retrieving current user: GraphQL: API rate limit already exceeded for user ID 11225574— even thoughgh api rate_limitshows core remaining 4820/5000 and graphql remaining 4261/5000 at the same moment. Retrying an auth write against a rate-limit error is the wrong move, so the attempt stopped there.gh auth statusunchanged, nothing was written to the keyring. No partial migration exists.gh auth token | gh auth login --with-tokenmigration once the GraphQL limit error clears (transient class; the backup stays in place until it lands); verifygh auth statusshows(keyring), hosts.yml token entries = 0, ~0.5s from plain SSH. (2) Restore thecodespacescope via an interactivegh auth refresh -s codespace(needs the laptop browser / Drew present), then re-verify the full scope set. Issue stays OPEN until both verify.37 remaining items
dezren39 commentedon Nov 17, 2026
🤖 Agent note · parked — awaiting one live coordinated session (codespace scope)
~/.config/gh/hosts.ymlstill contains zerooauth_tokenentries — the keyring-migration half of this issue remains complete, unchanged since the 2026-11-16 verification (keyring-held token, scopes admin:org/gist/repo/workflow). One read limitation, stated plainly: through the laptop-agent route the daemon injectsGH_TOKEN, sogh auth statusreports the fleet token's view and the keyring token's own scope set cannot be re-read from here; the 2026-11-16 plain-SSH verification stands as the last clean read.codespacescope.gh auth refresh -s codespaceenters the GitHub device flow, which needs Drew to approve a fresh one-time code in real time — impossible in a detached shift (a prior attempt timed out at 85s with no approver present). Drew already authorized the refresh (ledger itemcodespace-scope-5477, answered 2026-11-07); the step is one live coordinated session: run the refresh on the laptop, relay the fresh code to Drew, approve, then verifycodespaceappears ingh auth statusand close laptop(amd): SDDM login never unlocks GNOME Keyring - enable pam_gnome_keyring so the keyring-held gh token survives reboots #5477 with that evidence.dezren39 commentedon Nov 23, 2026
🤖 Agent note · picked up — revalidating the remainder (keyring migration + codespace scope) from fresh reads
dezren39 commentedon Nov 23, 2026
Remainder VERIFIED COMPLETE — closing evidence (2026-11-22, queue worker lane oc-code-04, task 10478)
Both acceptance criteria now pass on fresh reads. No token values were printed, logged, or copied anywhere in this verification — only storage location, scope names, and timings.
1. Keyring-held token, no file fallback
~/.config/gh/hosts.ymlcontains zerooauth_tokenlines (file holds onlyuser: dezren39/ emptyusers:map).ghbinary (fleet shim bypassed, clean environment with no inherited session vars so no injectedGH_TOKENis possible, keyring reached over the user bus only):Logged in to github.com account dezren39 (keyring), Active account: true2. Codespace scope present
admin:org, codespace, gist, repo, workflow— the full required set includingcodespace.GH_TOKEN) showed the scope set withoutcodespace. Today's direct keyring read showscodespacepresent, so the keyring token gained that scope at some point between 11-16 and 11-22 (not by this shift — no refresh was run here; no live device-flow session occurred). Thegh auth refresh -s codespacestep is therefore no longer outstanding.codespacewere looking at the injected fleet token's view, not the keyring token itself — worth knowing for future reads: always bypass theghshim (fleet ghpassthrough injects its own token) when checking the keyring token.3. Keyring unlocked (PAM fix still holding)
Locked=false(b false), read over the user bus — consistent with the PR fix(amd): unlock GNOME Keyring at SDDM login - keyring rules for the sddm PAM stack #5480 SDDM PAM fix continuing to unlock at graphical login.Method note: localhost SSH is not key-authorized from a detached session, so the "plain SSH exec" was approximated as a clean-environment non-interactive exec (
env -i+ onlyHOME/USER/XDG_RUNTIME_DIR/DBUS_SESSION_BUS_ADDRESS/PATH), which carries the same evidentiary properties: no ambientGH_TOKEN, no graphical session env, keyring via the user bus.No repo changes were needed (remainder was laptop-live-system verification only). Closing per the task acceptance criteria.
dezren39 commentedon Nov 23, 2026
Closed: remainder verified complete — keyring-held token (hosts.yml zero oauth_token, 0.44s keyring read) with full scopes incl. codespace; login keyring unlocked. Evidence in preceding comment.