fj auth unusable on headless Linux: keychain errors block login/reads; FJ_TOKEN should fully bypass the keychain #147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
On the headless agent host (usw-dev-01, Linux),
fjbecame unusable for all API operations mid-session:This hit
fj pr list,fj pr merge,fj pr create,fj issueand evenfj auth login(it could not store the pasted token), box-wide and across every agent lane at once.gitpush/clone were unaffected (separate credential helper), so only the forge-API layer went down.Root cause
fj'skeyringbackend on Linux talks to the Secret Service over D-Bus (libsecret / gnome-keyring). On a headless server there is usually no unlocked keyring collection, so every keychain read and write fails. The token had been usable earlier only because a keyring/D-Bus session was transiently unlocked; once it went away, auth died with no recovery path on the box.The merged keychain fallback (rasterstate/fj#96) maps keychain errors to
Ok(None)so theFJ_TOKENenv var can take over for reads, but the binary installed on the box predated it, so the raw keychain error short-circuited beforeFJ_TOKENwas consulted.Impact
High: a transient keyring failure halted the entire agent fleet's forge-API work mid-round until the binary was rebuilt and
FJ_TOKENwas wired into the shells that runfj. This is exactly the "fj is broken in containers/CI" adoption cliff #96 was meant to close, and it is the daily environment for the headless buyer.Workaround applied
fjfrommain(has #96) and installed it to~/.local/bin/fj.FJ_TOKENin the shells that actually spawnfj(bash for Claude lanes,zsh -lcreads~/.zshenvfor codex lanes;~/.zshrcdoes NOT reach either).Asks
FJ_TOKENshould be a first-class, documented primary auth path for headless/CI, checked before the keychain, so a broken keyring never blocks a process that has the env var set.fj auth loginmust not hard-fail when the keychain is unavailable: offer a non-keychain token store (a 0600 file-based store, or print the exactFJ_TOKENexport to use) instead of erroring on store.FJ_TOKENguidance rather than a rawopening keychain entryerror (extend #96 to the login/store path).FJ_TOKENas the recommended auth for CI and headless hosts in the README/auth docs.Environment
main(851b68b) has the read-side fallback but not the login/store fix or the docs.