Repository navigation
Description
Summary
On headless Linux/WSL2 with no session bus, every gog invocation — even gog --version with GOG_KEYRING_BACKEND=file — can spawn dbus-launch. On our WSL2 host this leaked 575 session dbus-daemon processes, exhausted the inotify instance limit (max_user_instances=128), and left daemons holding temporary HOME directories open so our tooling could not clean them up.
Setting DBUS_SESSION_BUS_ADDRESS=disabled: stops the launches, but auto then no longer falls back to the file backend (it picks pass and fails if the store isn't initialized).
Reproduction
Tested with the official Linux amd64 release v0.46.0 (e0e3cb9c 2026-10-21T05:43:32Z) on WSL2 Linux 6.6.114.1. No Google credentials or network requests are needed. Set GOG_BIN to the absolute path of that release binary. Run in Bash:
GOG_BIN=/absolute/path/to/gog
probe=$(mktemp -d)
mkdir -p "$probe/bin" "$probe/home"
cat > "$probe/bin/dbus-launch" <<'SH'
#!/bin/sh
printf 'launch\n' >> "$PROBE_LOG"
exit 1
SH
chmod +x "$probe/bin/dbus-launch"
: > "$probe/launches.log"
run_gog() {
env -i PATH="$probe/bin:/usr/bin:/bin" HOME="$probe/home" \
XDG_CONFIG_HOME="$probe/config" XDG_DATA_HOME="$probe/data" \
XDG_STATE_HOME="$probe/state" XDG_CACHE_HOME="$probe/cache" \
XDG_RUNTIME_DIR="$probe/runtime" GOG_HOME="$probe/gog" \
GNUPGHOME="$probe/gnupg" PASSWORD_STORE_DIR="$probe/pass" \
GOG_KEYRING_PASSWORD=synthetic-probe-password \
PROBE_LOG="$probe/launches.log" "$@"
}
run_gog GOG_KEYRING_BACKEND=file "$GOG_BIN" --version
wc -l < "$probe/launches.log"
# Observed: 2 launcher attempts, despite --version and file backend.
# Requires pass installed, but no initialized password store:
printf 'synthetic-not-a-real-token\n' | run_gog \
DBUS_SESSION_BUS_ADDRESS=disabled: GOG_KEYRING_BACKEND=auto \
"$GOG_BIN" --no-input auth import --email probe@example.invalid \
--refresh-token-stdin
# Fails: pass init your-gpg-id; store token: set token: exit status 1
printf 'synthetic-not-a-real-token\n' | run_gog \
DBUS_SESSION_BUS_ADDRESS=disabled: GOG_KEYRING_BACKEND=file \
"$GOG_BIN" --no-input auth import --email probe@example.invalid \
--refresh-token-stdin
# Succeeds; neither disabled: invocation adds launcher attempts.The failing fake launcher causes two attempts; it demonstrates startup execution, not daemon persistence. Without pass installed, the second symptom may differ. The first step assumes /run/user/<uid>/bus and dbus-session are absent; godbus checks those before launching.
Cause
- 99designs/keyring v1.2.2 opens the D-Bus session bus during package init (kwallet.go, secretservice.go), and godbus falls back to
dbus-launch— before gog picks a backend. shouldForceFileBackendonly treats an empty address as "no bus".
Upstream dependency report: 99designs/keyring#103.
Suggestion
Would you be open to (1) avoiding D-Bus until a command actually needs a keyring backend, and (2) treating disabled:/unreachable buses like a missing bus for the auto fallback? Happy to send a PR once we agree on the approach.
Investigated and reproduced with AI assistance (the Astrarch agent team); the reproduction was verified on a real host.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Oct 23, 2026
Codex review: this still needs some work.
Summary
Keep open: the disabled-bus fallback is released, but the pinned dependency still connects to D-Bus during package initialization, and maintainer discussion explicitly preserves this issue for that remaining defect.
Reproducibility: Current imports and pinned dependency source establish launcher execution before main when no session bus is configured or discoverable; the reporter and maintainer provide built-CLI probes, but this review ran no reproduction or tests.
Root-cause cluster
Relationship:
canonicalCanonical: #1258
Summary: This issue retains the eager-startup defect after a merged PR fixed only explicit-disabled-bus fallback; searches found no separate current owner for the remaining work.
Members:
partial_overlap: fix(auth): use file keyring when D-Bus is explicitly disabled #1266 - Merged fallback repair explicitly leaves dependency startup initialization unresolved.adjacent_distinct: fix(secrets): detect headless Linux and avoid D-Bus hangs #51 - Earlier headless runtime guards cannot prevent package initialization before main.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Maintainer decision needed
Next step
Choose a compatible dependency-level lazy-initialization fix and establish a failing subprocess regression for file-backend --version without a discoverable session bus.
Review details
Best possible solution:
Defer dependency D-Bus connections until an applicable backend is opened while preserving existing credentials and the released disabled-bus fallback.
Do we have a high-confidence way to reproduce the issue?
Current imports and pinned dependency source establish launcher execution before main when no session bus is configured or discoverable; the reporter and maintainer provide built-CLI probes, but this review ran no reproduction or tests.
Is this the best way to solve the issue?
Lazy dependency initialization addresses the remaining failure boundary; broad fallback for unreachable desktop buses could hide existing credentials and should remain outside this repair.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 6d97417eade9.
Label changes
Label changes:
impact:auth-provider: Current review impact labels areimpact:crash-loop.Label justifications:
P1: An official-release report describes repeated startup process leakage exhausting host resources, and current pinned source retains the launcher path.impact:crash-loop: The remaining startup side effect can accumulate session daemons and impair process-level availability on headless hosts.Evidence reviewed
Acceptance criteria:
What I checked:
go.mod:10, 6d97417eade9)secretservice.go:17, 929f178361c0)conn_other.go:20, 4481cbc300e2)internal/secrets/backend.go:204, 6d97417eade9)CHANGELOG.md:77, 16dfdd825e55)gogrunsdbus-launchat startup, andDBUS_SESSION_BUS_ADDRESS=disabled:skips the file fallback #1258 (comment), steipete records two fake-launcher attempts for file-backend --version on the dependency-update candidate and explicitly keeps this issue open; the linked proof was not independently exercised in this review.How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 14, 2026, 12:33 PM ET / 17:33 UTC.
fix(auth): use file keyring when D-Bus is explicitly disabled (#1266)
steipete commentedon Oct 26, 2026
The explicit-disabled-bus fallback is fixed by #1266, merged as 16dfdd8. On headless Linux,
DBUS_SESSION_BUS_ADDRESS=disabled:withGOG_KEYRING_BACKEND=autonow selects encrypted file storage, matching the missing-bus case.Proof: the built CLI imported a synthetic token and read back the stored account with zero
passordbus-launchinvocations. Linux CLI proof. Focused keyring/rekey tests, localmake ci, and CI on the exact PR head passed, including Linux, minimum-Go, macOS, Windows, and Worker checks.Thanks @pkyIntelligence for the reproduction. Leaving this issue open: the dependency's eager D-Bus initialization when the address is not explicitly disabled still needs a separate upstream fix.
steipete commentedon Oct 27, 2026
Rechecked the remaining startup behavior on the dependency-update candidate in #1274. Under an isolated Linux user without a session bus, a fake launcher records two
dbus-launchattempts forGOG_KEYRING_BACKEND=file gog --version. WithDBUS_SESSION_BUS_ADDRESS=disabled:andGOG_KEYRING_BACKEND=auto, importing a synthetic token succeeds with zero launcher attempts. Built-CLI probe.The disabled-bus fallback from #1266 remains correct. Keeping this issue open for the eager D-Bus initialization in the pinned keyring dependency; current package initialization still runs before gog chooses its backend. No real Google credentials or daemon launches were used in the probe.