Skip to content

fix(browser): launch verification Chrome without the desktop keyring - #1432

Closed
BaaRai wants to merge 2 commits into
morluto:mainfrom
BaaRai:fix/browser-lane-basic-password-store
Closed

BaaRai wants to merge 2 commits into
morluto:mainfrom
BaaRai:fix/browser-lane-basic-password-store

Conversation

@BaaRai

@BaaRai BaaRai commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Both raw browser-lane launchers now pass --password-store=basic. Verification browsers never read a real keyring, and on Linux a reachable but locked desktop keyring stalls headless Chrome profile startup before the first navigation is issued, which is the real root cause of the empty CDP URLs tracked in #1384.

Problem and expected behavior

On a machine with a desktop session bus whose login keyring is locked (reproduced under WSL with an XFCE session running), every headless Chrome build tried (Kali Chromium 150.0.7871.181, official Chrome-for-Testing 150.0.7871.124 and 154.0.8037.57) reports for the startup page: main-frame URL "" (or ":" on 150), securityOrigin":://, getNavigationHistory [""], DOMSnapshot documents with no documentURL, and storage agents rejecting with frame-not-found. inspect_web_page therefore fails target_not_allowed on main and the whole verify:browser lane is blocked.

The page itself settles on about:blank: Runtime.evaluate inside the page reports location.href === "about:blank" with empty body text, and a startup --log-net-log capture contains zero URL requests and zero proxy events. The navigation is never issued. The keyring daemon shows one pending secret-store prompt object per probe run (/org/freedesktop/secrets/prompt/p1..pN): headless Chrome reaches gnome-keyring over the session bus, the unlock prompt can never be answered, and profile startup stalls before the initial navigation.

An environment bisect isolates it: DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus alone, in an otherwise empty environment, reproduces the stall with the same binary and flags; a dead bus path, env -i, or --password-store=basic each load the page normally. Other machines explain the earlier confusion: a desktop that unlocks the keyring at login (CassieFox23's runs in #1384) is clean, and CI runners have no session bus at all, so both see real URLs with the same builds.

Expected behavior: the lane launches browsers it owns, so it must not depend on desktop keyring state. REA already fails closed on an uncommitted frame, which is correct; the launcher should simply not stall in that state.

Change and scope

scripts/verify-real-browser.mjs and scripts/lib/browser-runtime-fixture-lifecycle.mjs gain --password-store=basic next to --headless=new, plus a short docs/testing.md note recording the failure mode. Nothing else changes: no product source, no capture semantics, no fallbacks. PR #1411 is closed in favor of this fix; its target-URL fallback would have authorized capturing a page that never loaded, which is the wrong direction once the browser actually loads pages.

--password-store=basic is inert on Windows and macOS and equivalent to the default on Linux boxes without a session bus, so CI behavior is unchanged.

Contract and boundary impact

not applicable: verification lane launch flags and documentation only; no contract, schema, provider, or capture-path change.

Evidence and regression coverage

Before, on the affected machine (WSL Kali, XFCE session with locked keyring, official CfT 154.0.8037.57 at REA_BROWSER_EXECUTABLE), main fails the lane on the first observation with target_not_allowed. With only this flag added to main's launcher, the complete npm run verify:browser passes: "browser": "Chrome/154.0.8037.57"", "verified": true, zero target_not_allowed occurrences and zero script-metadata failures in the log. The same flag is what the pushed branch runs, and check:fast passes.

The unit suite needs no new coverage: the change is launcher-only and cannot be exercised by the fake CDP fixtures, and the lane itself is the oracle. Issue #1384 carries the full probe matrix, the environment bisect, and the correction of my earlier official-builds claim.

Headless Chrome that reaches a locked gnome-keyring over the session bus
stalls profile startup before the first navigation is issued, so every CDP
URL surface reports empty or placeholder values and the browser lanes fail
target_not_allowed. Verification browsers never read a real keyring, so
both raw launchers now pass --password-store=basic.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@CassieFox23

CassieFox23 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: The flag fixes it here too. I faked a locked keyring. Chrome hung on it, just like your box. With the flag, Chrome never called it.

I ran this on head 82338a36. I also ran the merge base, c29931ce. Both browsers are version 154.

There is no gnome-keyring on my box. So I wrote a small stand-in. It owns the keyring name on a private bus. It says the keyring is locked. It never answers the unlock prompt.

verify:browser Base Head
Fake keyring, on Chromium (BSD-3-Clause) fail pass
Fake keyring, Google's test build fail pass
Empty bus, Chromium (BSD-3-Clause) pass pass
Empty bus, Google's test build pass pass

Base failed fast with target_not_allowed. That matches #1384. Head passed with "verified": true on both.

The probe shows the same thing up close:

Fake locked keyring Frame URL Page Hits on test page
No flag "", origin "://" about:blank 0
--password-store=basic real real 2

Every no-flag run called Unlock, then Prompt. Every flag run made zero keyring calls. Waiting 15 seconds changed nothing.

Launchers. I found no missed browser launch. Two small notes are in the fold below.

Tests. The PR changes no tests. I ran the closest one, runtimeFixtureCleanup.test.ts.

Test Node 22.23.1 Node 24.18.0 Node 26.11.1
Head pass pass pass

Not run:

Edit: results are in the follow-up. A fake locked KWallet stalls base, and the flag fixes it. Still not run: real gnome-keyring, real KWallet, my real session, verify:electron, Windows and macOS.

  • Real gnome-keyring. It is not installed here.
  • A locked KWallet, real or fake. Ran with a fake one only.
  • verify:browser on my real desktop session. A local safety rule stopped it.
  • The Electron lane. Ran without a window. verify:electron itself was not run.
  • Windows and macOS.

Thanks, BaaRai, for the bisect. The prompt objects were the key clue.

Launcher and KDE notes

Both raw launchers get the flag. The other launches go through Playwright. Playwright 1.58.2 adds --password-store=basic by default. No REA code turns those defaults off.

Two small notes, not blockers:

  • docs/browser-observation.md shows a manual Chrome command. Users run it to start a browser for REA. It lacks the flag. A box like yours might stall there too. I did not test that. Maybe add the flag?
  • The Electron lane starts Electron with no flag. I did not test Electron.

My desktop is KDE 6, with KWallet. Chromium 154 picks KWallet on KDE. I read that in the source. I did not test a locked KWallet.

How the fake keyring works

It is a short Python script. It owns org.freedesktop.secrets on a private bus. It uses dbus-python (MIT).

  • ReadAlias("default") gives a login collection.
  • Unlock returns no objects, plus a prompt path.
  • Prompt returns. Completed never fires.

That is the stand-in for a locked keyring with no one to answer. It is not gnome-keyring itself.

The private bus had no service files. So nothing could start by itself. Every run used a clean env. It had a fake home and its own bus address.

Bus calls with no keyring at all

I watched an empty private bus with dbus-monitor. I ran both browsers, three desktop values, flag on and off.

Desktop No flag --password-store=basic
XFCE asks for org.freedesktop.secrets no keyring query
Unset asks for org.freedesktop.secrets no keyring query
KDE asks for org.kde.kwalletd no keyring query

The KDE row had no KDE_SESSION_VERSION. So Chromium chose the old KWallet name. With version 6 set, the source picks kwalletd6.

All twelve runs loaded the page. Nobody owned those names.

Source notes

From tag 154.0.8037.57.

  • components/os_crypt/async/browser/freedesktop_secret_key_provider.cc, lines 215-245. It reads --password-store. With no flag, KDE 6 uses kwalletd6. XFCE, GNOME and unset use the Secret Service.
  • Same file, lines 84-111. A prompt path starts a prompt. Then it waits for Completed.
  • chrome/browser/headless/headless_mode_init.cc, lines 63-68. Headless uses incognito only without --user-data-dir. The lane passes one. So its profile is a real profile.
Commands
node probe.mjs <browser> 4000 [--password-store=basic]
REA_BROWSER_EXECUTABLE=<browser> npm run verify:browser
npx vitest run tests/boundary/browser/runtimeFixtureCleanup.test.ts

Every run used env -i and a fake home. It used XDG_CURRENT_DESKTOP=XFCE unless noted. It used a private bus address. The Chromium rows used the bare binary, not the wrapper script.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 22.23.1, 24.18.0, 26.11.1 (verify:browser on 24.18.0)
  • Head / base: 82338a36 / c29931ce
  • Chromium (BSD-3-Clause): the one from Fedora 44, at 154.0.8037.57
  • Google's test build: the zip for Linux, at 154.0.8037.57
  • Playwright (Apache-2.0): the one REA pins, at 1.58.2

🤖 Generated with Claude Code (Opus 5.5) 🦊

@CassieFox23

CassieFox23 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: A locked KWallet stalls base the same way, and the flag fixes it. Plain Electron startup never asks the keyring. Only an app's own safeStorage call does, and it hangs on KDE 6 without the flag.

Still head 82338a36, base c29931ce.

Fake locked KWallet

My desktop is KDE 6. So I faked KWallet this time. The fake runs on a private bus. It says the wallet is closed. It never finishes opening it.

verify:browser, KDE 6 Base Head
Chromium 154 (BSD-3-Clause) fail, target_not_allowed pass, "verified": true
KWallet calls 3 calls, then a wait for walletAsyncOpened none

The probe agrees. I ran it on Chromium and Google's test build.

Probe, fake KWallet Frame URL Page Hits on test page
No flag, KDE 6 "", origin "://" about:blank 0
No flag, KDE 5 "", origin "://" about:blank 0
--password-store=basic real real 2

With no flag, Chrome called isEnabled, then networkWallet, then openAsync. Then it waited for a signal that never came. KDE 6 asked kwalletd6. KDE 5 asked kwalletd5. With the flag, it made no wallet calls.

Electron lane

The PR does not touch Electron. Neither Electron path passes the flag. But Electron leaves the keyring alone at startup.

I used Electron 44.7.0 (MIT). That is the version the docs name. It ships Chromium 152.

Electron app, full env No flag --password-store=basic
Start, cookies, fetch, KDE 6 fine, no keyring calls fine, no keyring calls
Start, cookies, fetch, XFCE fine, no keyring calls fine, no keyring calls
App calls safeStorage, KDE 6 hangs, killed at 20 s fine, basic_text

Stock Electron does not encrypt cookies. So startup needs no key. A safeStorage call is different. On KDE 6 it called the blocking open. With no answer, the main process froze.

capture_electron_scenario is safe either way. Its env keeps only eight variables, plus a run id. The bus address and desktop vars are not among them. My test app saw the bus as disabled:. Its safeStorage call fell back to basic_text. The private bus saw zero calls. Base and head matched. Both captures then stalled, for a reason I did not find. The fold has more.

verify:electron keeps the full env. So a test app that calls safeStorage could hang there. REA's fixture app does not call it. Adding the flag to that spawn would be cheap. I did not test that spawn itself.

Still not run

  • verify:electron. Its fixture opens windows. I have no spare display here.
  • An Electron capture with a window.
  • Real KWallet. I left my own wallet alone.
  • Real gnome-keyring. It is not installed here.
  • verify:browser on my real desktop session.
  • Windows and macOS.
How the fake KWallet works

It is a short Python script. It uses dbus-python (MIT). It owns org.kde.kwalletd6, org.kde.kwalletd5 and org.kde.kwalletd. Each sits at /modules/<name>, with interface org.kde.KWallet.

  • isEnabled says yes.
  • networkWallet says kdewallet.
  • isOpen says no.
  • openAsync returns an id. walletAsyncOpened never fires.
  • open never replies.

It is not KWallet itself. The bus had no service files. Every run used a clean env and a fake home.

Electron detail

Code paths, the same on base and head:

  • capture_electron_scenario: src/browser/PlaywrightElectronActiveProvider.ts. It uses Playwright to start Electron. It passes -r <hook> <app> and the request's args. safeElectronEnvironment builds the env. It keeps these:
    • HOME, LANG, PATH, USER
    • TMP, TMPDIR
    • DISPLAY, WAYLAND_DISPLAY
  • verify:electron: scripts/verify/electron/tool-contracts.mjs, line 65. It spawns Electron with {...process.env}.

A caller can still pass the flag through args.

Electron sets the bus to disabled: by itself. A direct run with no bus variable showed the same value.

My REA captures used a windowless app. The app finished its checks in 11 ms. Then both captures stalled until my 150 s timeout. I did not find out why.

A window plus --ozone-platform=headless crashed Electron here. So the apps in this table had no window.

Commands
dbus-daemon --config-file=bus.conf --print-address --fork
python3 -I fake_kwallet.py kw.log
node probe.mjs <browser> 4000 [--password-store=basic]
REA_BROWSER_EXECUTABLE=<browser> npm run verify:browser
node eprobe.mjs <electron> <app> --ozone-platform=headless [--password-store=basic]
node scripts/rea.mjs capture-electron-scenario scenario.json --json

Every run used env -i and a fake home. The bus address pointed at the private bus. The KDE runs set XDG_CURRENT_DESKTOP=KDE and KDE_SESSION_VERSION. Later Electron runs had no network but loopback.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 24.18.0
  • Head / base: 82338a36 / c29931ce
  • Chromium (BSD-3-Clause): the one from Fedora 44, at 154.0.8037.57
  • Google's test build: the zip for Linux, at 154.0.8037.57
  • Electron (MIT): 44.7.0 from its GitHub release, checksum matched
  • dbus-daemon: 1.16.2
  • dbus-python: 1.4.0

🤖 Generated with Claude Code (Opus 5.5) 🦊

Review of morluto#1432 flagged that the documented manual Chrome command can hit
the same locked-keyring startup stall the launchers were fixed for, since
desktop users reach keyrings gnome-keyring and KWallet alike.
@BaaRai

BaaRai commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

This is exactly the confirmation the PR needed, thank you. The fake locked keyring reproducing the stall on a machine that has no gnome-keyring at all, and the flag eliminating every keyring call, closes the loop on causality across boxes. The KWallet result matters too: it shows the stall is a desktop-secret-service behavior, not a gnome-keyring quirk, so KDE boxes are covered by the same flag, and I have noted that in the PR description language ('a reachable but locked desktop keyring') rather than gnome-specific wording.

Your launcher survey matches what I found: the two raw spawn sites were the only REA-owned launches without the flag, and Playwright's own default already passes it for the rest.

On your two notes: I added --password-store=basic to the manual launch recipe in docs/browser-observation.md (aa9cc0a) with one sentence explaining the stall, since a user following that command on an affected box would otherwise recreate #1384 by hand. For the Electron lane I left it alone: plain Electron startup never touches the keyring per your probe, the lane's app does not call safeStorage, and Playwright's default args apply there anyway.

Not-run lists line up with mine: real gnome-keyring on a desktop with an unlocked session passes by construction (that is the clean-machine case from #1384), and verify:electron is unaffected for the reason above.

@morluto morluto closed this Oct 10, 2026
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @BaaRai for tracing the browser-lane startup failure to Chrome’s locked desktop keyring and reproducing it with a fake locked keyring. Main now launches its verification Chrome with --password-store=basic (c57e759ae), so this lane does not depend on the desktop keyring (main).

@morluto morluto added the area: tests Test suite and verification label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants