#494: kanidm's "Add Password" click on the droplet ceremony window renders no password field — click fires clean, DOM and network both silent (sig e689ed304acb) #498

Closed
opened 2026-08-13 01:24:26 +00:00 by ben · 5 comments
Owner

Failure

sign-in leg red at app/tests/e2e/fixtures/ceremony.ts:384 inside registerPassword (called from journey.droplet.spec.ts:321): after clicking kanidm's "Add Password" control, page.locator('input[type=password]:visible') finds zero fields.

artifacts/ceremony/reset-1.png (pre-click) and reset-2.png (post-click, +1.5s wait) are visually and structurally identical — same "Updating Credentials" / Passkeys / "Alternative Authentication Methods" / Add Password screen, no password inputs anywhere, no visible state change at all.

Evidence the click itself was clean (not a selector miss)

The Playwright trace (test.trace, calls around t=304007–304017ms) shows a single, fast, non-retried actionability pass on button >> internal:has-text=/Add Password/i >> nth=0 — no timeout, no retry loop, no "element not stable/not visible" churn. This rules out clickAny (ceremony.ts:372) hitting a decoy/hidden element or the wrong control: it clicked the one real yellow "ADD PASSWORD" button visible in the screenshot.

Evidence nothing happened server-side either

logs/droplet-journal.txt: the only browser-driven request to the reset session is the single GET /ui/reset?token=8paus-2s3xw-3zzv5-rr5gc at 01:12:42 (kopid e1aa6350-a355-44a5-b5c7-73cc505b24a1) that loaded the page. No further request from that browser/session appears afterward. The two later _credential/_status GETs (01:12:43, 01:12:45) belong to a different session (idm_admin, token ffdf8618-…) — that's the helper's own out-of-band poll, not the ceremony window. So the click produced no DOM change AND no network call: kanidm's own client code did not react to the click at all, or reacted and errored silently.

A likely-unrelated second error

The trace also reports Protocol error (Page.handleJavaScriptDialog): No dialog is showing — but it fires ~400ms after the real error, during the afterAll teardown hook (pw:api@476 at t=306091ms, well after the click at t=304007 and the throw at t=305690). There is no dialog-related trace activity anywhere near the actual click. Recommend the next investigator not chase this as the cause — it reads as teardown noise (likely the Electron ceremony window's own close path), not causally linked to the password-field failure.

Suspected layer / candidate causes

  1. Hydration-timing race: ceremony.ts:377 waits a fixed 1500ms before clicking "Add Password"; that pacing (per the file's own comments) was proven for the passkey path on kanidm's UI, not necessarily re-validated for this newer password path. If kanidm's client bundle isn't fully interactive yet, a click would land on an inert DOM node — exactly this symptom (no error, no network call, no re-render).
  2. Blind spot in our own tooling: dump() (ceremony.ts:247-259) only captures a screenshot + first 600 chars of body.innerText(). It wires no page.on('console') / page.on('pageerror') listener, so if kanidm's click handler threw a JS exception, we would see exactly nothing — as we do here. This needs fixing regardless of the root cause, to unblind the next red run.
  3. Cannot rule out a genuine kanidm-side regression in the "Add Password" toggle on this droplet's kanidm 1.10.3 build.

Why filing, not self-fixing

This is the second consecutive attempt at this exact ceremony function for #494 (ffe788e790c4 then 80b26fa7826c both rewrote registerPassword/openAppCeremonyWindow), and it is still red on the same class of failure (kanidm's credential-add UI not behaving as scripted). Per DDR 0163's own note in ceremony.ts, this leg is "live-lab and unprovable in the Sandcastle sandbox." I have no live droplet/kanidm instance to reproduce against here, so I can't distinguish timing-race from a genuine kanidm bug, and can't verify any candidate fix — none of the self-fix certainty/verifiability bars are met.

What plugging it needs

  • Add console/pageerror capture to dump() so the next red run tells us whether kanidm's JS actually threw.
  • Reproduce interactively against a live droplet: try a longer/backed-off wait before the "Add Password" click, or wait on a structural readiness signal instead of a fixed timeout, and see if that alone fixes it.
  • If that doesn't move it, this needs a human with live-droplet access (or a kanidm changelog check) rather than another blind fixture tweak.

drive 20260813T010640Z red at sign-in: kanidm password entry rendered no password field after "Add Password" — artifacts/ceremony/reset-N.png shows what rendered (#N)
evidence: test-results/…/20260813T010640Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

## Failure `sign-in` leg red at `app/tests/e2e/fixtures/ceremony.ts:384` inside `registerPassword` (called from `journey.droplet.spec.ts:321`): after clicking kanidm's "Add Password" control, `page.locator('input[type=password]:visible')` finds zero fields. `artifacts/ceremony/reset-1.png` (pre-click) and `reset-2.png` (post-click, +1.5s wait) are **visually and structurally identical** — same "Updating Credentials" / Passkeys / "Alternative Authentication Methods" / Add Password screen, no password inputs anywhere, no visible state change at all. ## Evidence the click itself was clean (not a selector miss) The Playwright trace (`test.trace`, calls around t=304007–304017ms) shows a single, fast, non-retried actionability pass on `button >> internal:has-text=/Add Password/i >> nth=0` — no timeout, no retry loop, no "element not stable/not visible" churn. This rules out `clickAny` (`ceremony.ts:372`) hitting a decoy/hidden element or the wrong control: it clicked the one real yellow "ADD PASSWORD" button visible in the screenshot. ## Evidence nothing happened server-side either `logs/droplet-journal.txt`: the only browser-driven request to the reset session is the single `GET /ui/reset?token=8paus-2s3xw-3zzv5-rr5gc` at `01:12:42` (kopid `e1aa6350-a355-44a5-b5c7-73cc505b24a1`) that loaded the page. No further request from that browser/session appears afterward. The two later `_credential/_status` GETs (`01:12:43`, `01:12:45`) belong to a **different** session (`idm_admin`, token `ffdf8618-…`) — that's the helper's own out-of-band poll, not the ceremony window. So the click produced no DOM change AND no network call: kanidm's own client code did not react to the click at all, or reacted and errored silently. ## A likely-unrelated second error The trace also reports `Protocol error (Page.handleJavaScriptDialog): No dialog is showing` — but it fires ~400ms **after** the real error, during the `afterAll` teardown hook (`pw:api@476` at t=306091ms, well after the click at t=304007 and the throw at t=305690). There is no dialog-related trace activity anywhere near the actual click. Recommend the next investigator not chase this as the cause — it reads as teardown noise (likely the Electron ceremony window's own close path), not causally linked to the password-field failure. ## Suspected layer / candidate causes 1. **Hydration-timing race**: `ceremony.ts:377` waits a fixed 1500ms before clicking "Add Password"; that pacing (per the file's own comments) was proven for the *passkey* path on kanidm's UI, not necessarily re-validated for this newer password path. If kanidm's client bundle isn't fully interactive yet, a click would land on an inert DOM node — exactly this symptom (no error, no network call, no re-render). 2. **Blind spot in our own tooling**: `dump()` (`ceremony.ts:247-259`) only captures a screenshot + first 600 chars of `body.innerText()`. It wires no `page.on('console')` / `page.on('pageerror')` listener, so if kanidm's click handler threw a JS exception, we would see exactly nothing — as we do here. This needs fixing regardless of the root cause, to unblind the next red run. 3. Cannot rule out a genuine kanidm-side regression in the "Add Password" toggle on this droplet's kanidm 1.10.3 build. ## Why filing, not self-fixing This is the **second consecutive attempt** at this exact ceremony function for #494 (`ffe788e790c4` then `80b26fa7826c` both rewrote `registerPassword`/`openAppCeremonyWindow`), and it is still red on the same class of failure (kanidm's credential-add UI not behaving as scripted). Per DDR 0163's own note in `ceremony.ts`, this leg is "live-lab and unprovable in the Sandcastle sandbox." I have no live droplet/kanidm instance to reproduce against here, so I can't distinguish timing-race from a genuine kanidm bug, and can't verify any candidate fix — none of the self-fix certainty/verifiability bars are met. ## What plugging it needs - Add console/pageerror capture to `dump()` so the next red run tells us whether kanidm's JS actually threw. - Reproduce interactively against a live droplet: try a longer/backed-off wait before the "Add Password" click, or wait on a structural readiness signal instead of a fixed timeout, and see if that alone fixes it. - If that doesn't move it, this needs a human with live-droplet access (or a kanidm changelog check) rather than another blind fixture tweak. drive `20260813T010640Z` red at `sign-in`: `kanidm password entry rendered no password field after "Add Password" — artifacts/ceremony/reset-N.png shows what rendered (#N)` evidence: `test-results/…/20260813T010640Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: e689ed304acb -->
Author
Owner

Analysis + direction (do not land a speculative fix)

Three drives (214238Z passkey, 003900Z + 010640Z password) died identically: a kanidm reset-screen click mutates nothing. Two facts narrow it:

  1. The ceremony origin on the droplet path is https://localhost:<port> (drive-4 trace: ceremony window open — origin https://localhost:35699) — an ssh -N -L forward to the box's kanidm (fleetwire/forwards.go, held open by design until shutdown; enrolment.go:188 builds the reset URL on it). The page LOADED through that forward (reset-1 renders), so the forward was up at window-open. Whether it was still up at click time is unproven.
  2. The app ceremony window has never executed a click live anywhere — the private path hasn't re-driven since #425 landed, so "htmx works in this window shape" (in-memory ourcloud-ceremony partition, pinned-CA setCertificateVerifyProc, no preload, contextIsolation) is an unverified assumption, not a proven fact.

Diagnostics are already landed (a1a8f37): the next droplet drive writes artifacts/ceremony/window-diagnostics.log — every console line, page error, request, failure, and response in the ceremony window, wired before domcontentloaded so htmx's own script load is captured. A manual evidence drive is running now; its log discriminates:

  • htmx script load failed / pageerror at load → the window shape blocks the page's JS → fix in app/src-electron/electron-main.ts (createCeremonyWindow).
  • No request at all after the click → the control was never wired (htmx loaded but didn't init, or CSP killed hx-on) → also window-shape territory; the console lines will name it.
  • POST fired and failed (connection refused/reset) → the ssh -L forward died between load and click → fix in internal/fleetwire/forwards.go (keepalive/re-establish) or mint the ceremony on the public IdP door instead.
  • POST fired, got 4xx → kanidm refused (cookie/origin/CSRF in the pinned session) → the response body/status names it.

If you are working this ticket before that log exists: do not land a guess. Every plausible-looking blind fix so far (#497's CDP-attach theory included) has been disproven by the next drive at the cost of a full droplet cycle. Wait for the log (it will be quoted here), or if you must close your run, leave findings only.

## Analysis + direction (do not land a speculative fix) Three drives (`214238Z` passkey, `003900Z` + `010640Z` password) died identically: a kanidm reset-screen click mutates nothing. Two facts narrow it: 1. **The ceremony origin on the droplet path is `https://localhost:<port>`** (drive-4 trace: `ceremony window open — origin https://localhost:35699`) — an `ssh -N -L` forward to the box's kanidm (`fleetwire/forwards.go`, held open by design until shutdown; `enrolment.go:188` builds the reset URL on it). The page LOADED through that forward (reset-1 renders), so the forward was up at window-open. Whether it was still up at click time is unproven. 2. **The app ceremony window has never executed a click live anywhere** — the private path hasn't re-driven since #425 landed, so "htmx works in this window shape" (in-memory `ourcloud-ceremony` partition, pinned-CA `setCertificateVerifyProc`, no preload, contextIsolation) is an unverified assumption, not a proven fact. **Diagnostics are already landed** (`a1a8f37`): the next droplet drive writes `artifacts/ceremony/window-diagnostics.log` — every console line, page error, request, failure, and response in the ceremony window, wired before `domcontentloaded` so htmx's own script load is captured. A manual evidence drive is running now; its log discriminates: - **htmx script load failed / pageerror at load** → the window shape blocks the page's JS → fix in `app/src-electron/electron-main.ts` (`createCeremonyWindow`). - **No request at all after the click** → the control was never wired (htmx loaded but didn't init, or CSP killed `hx-on`) → also window-shape territory; the console lines will name it. - **POST fired and failed (connection refused/reset)** → the `ssh -L` forward died between load and click → fix in `internal/fleetwire/forwards.go` (keepalive/re-establish) or mint the ceremony on the public IdP door instead. - **POST fired, got 4xx** → kanidm refused (cookie/origin/CSRF in the pinned session) → the response body/status names it. **If you are working this ticket before that log exists: do not land a guess.** Every plausible-looking blind fix so far (#497's CDP-attach theory included) has been disproven by the next drive at the cost of a full droplet cycle. Wait for the log (it will be quoted here), or if you must close your run, leave findings only.
Author
Owner

drive 20260813T013025Z red at sign-in: kanidm password entry rendered no password field after "Add Password" — artifacts/ceremony/reset-N.png shows what rendered (#N)
evidence: test-results/…/20260813T013025Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

drive `20260813T013025Z` red at `sign-in`: `kanidm password entry rendered no password field after "Add Password" — artifacts/ceremony/reset-N.png shows what rendered (#N)` evidence: `test-results/…/20260813T013025Z/` on matou-workstation (legs.json, droplet-journal.txt, trace)
Author
Owner

ROOT CAUSE CONFIRMED — evidence drive 20260813T013025Z, window-diagnostics.log

The diagnostics landed in a1a8f37 answered it in one drive:

console [debug] credupdate: loaded / credupdate: init          ← kanidm's JS is fine
request  POST https://localhost:42279/ui/reset/add_password    ← the click DID fire
response 403  https://localhost:42279/ui/reset/add_password    ← kanidm REFUSED it
console [error] Response Status Error Code 403 from /ui/reset/add_password

Not the window shape, not htmx, not the tunnel, not WebAuthn (drive 214238Z's ADD PASSKEY died the same 403 way — the "silent authenticator" was a misread).

Why kanidm 403s: the own-VPS gateway renders kanidm with the PUBLIC identity — domain = id.<apex>, origin = "https://id.<apex>" (internal/clan/frontdoor.go:224,231-232) — but OpenCeremony (internal/fleetwire/enrolment.go:188) builds the reset URL on the localhost ssh -L forward. kanidm's credential-update session cookie is scoped to its configured domain, so at a https://localhost:<port> origin the cookie never sticks: the token-bearing GET renders the page, and every session-guarded POST arrives cookieless → 403. The private path never hits this because the VM kanidm's origin IS https://localhost:<port> (internal/clan/vmguest.go:242) — the "no migration, the OIDC issuer rides it" note in OpenCeremony is private-path reasoning misapplied to the own-VPS branch.

The fix (product Go, swarm-landable, next drive verifies)

On the own-VPS path, OpenCeremony must build the ceremony URL on the public IdP door — https://id.<apex>/ui/reset?token=… — not the localhost forward:

  • The IdP host is served publicly through Caddy with a real ACME cert (the branded-login leg already proves it on every drive), so createCeremonyWindow's verify proc passes it on net::OK — the CA pin simply doesn't engage.
  • Passkeys (when they return someday) are BETTER on the public door too: the WebAuthn RP id binds to kanidm's domain.
  • MintToken / the AwaitCredential poll keep their idm_admin client over the tunnel — only the WINDOW's URL changes.
  • Wiring: the enrolment needs the public IdP base (https://id.<apex>) on the own-VPS branch — thread it from the founding draft's address (the same place the front door gets IDPHost), keeping the private path's localhost shape byte-identical. Unit-test both branches (the enrolment/ownvpspath test files already cover OpenCeremony's URL shape).

AC: own-VPS OpenCeremony returns https://id.<apex>/ui/reset?token=…; private path unchanged; unit tests pin both; the next drive's sign-in leg gets a 2xx on add_password (window-diagnostics.log now proves this either way).

## ROOT CAUSE CONFIRMED — evidence drive `20260813T013025Z`, window-diagnostics.log The diagnostics landed in `a1a8f37` answered it in one drive: ``` console [debug] credupdate: loaded / credupdate: init ← kanidm's JS is fine request POST https://localhost:42279/ui/reset/add_password ← the click DID fire response 403 https://localhost:42279/ui/reset/add_password ← kanidm REFUSED it console [error] Response Status Error Code 403 from /ui/reset/add_password ``` Not the window shape, not htmx, not the tunnel, not WebAuthn (drive `214238Z`'s ADD PASSKEY died the same 403 way — the "silent authenticator" was a misread). **Why kanidm 403s:** the own-VPS gateway renders kanidm with the PUBLIC identity — `domain = id.<apex>`, `origin = "https://id.<apex>"` (`internal/clan/frontdoor.go:224,231-232`) — but `OpenCeremony` (`internal/fleetwire/enrolment.go:188`) builds the reset URL on the localhost ssh -L forward. kanidm's credential-update session cookie is scoped to its configured domain, so at a `https://localhost:<port>` origin the cookie never sticks: the token-bearing GET renders the page, and every session-guarded POST arrives cookieless → 403. The private path never hits this because the VM kanidm's origin IS `https://localhost:<port>` (`internal/clan/vmguest.go:242`) — the "no migration, the OIDC issuer rides it" note in OpenCeremony is private-path reasoning misapplied to the own-VPS branch. ## The fix (product Go, swarm-landable, next drive verifies) On the own-VPS path, `OpenCeremony` must build the ceremony URL on the **public IdP door** — `https://id.<apex>/ui/reset?token=…` — not the localhost forward: - The IdP host is served publicly through Caddy with a real ACME cert (the branded-login leg already proves it on every drive), so `createCeremonyWindow`'s verify proc passes it on `net::OK` — the CA pin simply doesn't engage. - Passkeys (when they return someday) are BETTER on the public door too: the WebAuthn RP id binds to kanidm's domain. - `MintToken` / the `AwaitCredential` poll keep their idm_admin client over the tunnel — only the WINDOW's URL changes. - Wiring: the enrolment needs the public IdP base (`https://id.<apex>`) on the own-VPS branch — thread it from the founding draft's address (the same place the front door gets `IDPHost`), keeping the private path's localhost shape byte-identical. Unit-test both branches (the enrolment/ownvpspath test files already cover OpenCeremony's URL shape). **AC:** own-VPS `OpenCeremony` returns `https://id.<apex>/ui/reset?token=…`; private path unchanged; unit tests pin both; the next drive's `sign-in` leg gets a 2xx on `add_password` (window-diagnostics.log now proves this either way).
Author
Owner

swarm-claim host=elitebook-distributed-server-03 run=5466
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=5466 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #498 — status success

✅ close-report gates passed — every claim verified against main; closing.

envelope
{
  "issue": 498,
  "status": "success",
  "commits": [
    "3448657"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/adr/0163-design-the-ceremony-opens-in-an-app-window-that-pins-the-gateway-ca.md",
    "internal/fleetwire/enrolment.go",
    "internal/fleetwire/enrolment_test.go",
    "internal/founding/handoff.go",
    "internal/founding/ownvpspath.go",
    "internal/founding/ownvpspath_internal_test.go",
    "internal/founding/testing/fakes.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "own-VPS OpenCeremony returns https://id.<apex>/ui/reset?token=…": "internal/fleetwire/enrolment.go OpenCeremony idpHost!='' branch builds https://<idpHost>/ui/reset?token=…; founding.OpenEnrolment (handoff.go) threads ownVPSCeremonyHost(s)=hostnames.IDP(ownVPSApex(draft)); pinned by TestOpenCeremony_OwnVPSOpensOnPublicIdPDoor and TestOwnVPSCeremonyHost",
    "private path unchanged (byte-identical localhost forward)": "OpenCeremony idpHost=='' branch keeps https://localhost:<kanidmPort>/ui/reset?token=…; pinned by TestOpenCeremony_BuildsResetURLAndReturnsCA (unchanged assertion) and TestOwnVPSCeremonyHost private/no-draft → \"\"",
    "unit tests pin both branches": "internal/fleetwire/enrolment_test.go (private + own-VPS, own-VPS asserts the forwarded kanidm port is never read) and internal/founding/ownvpspath_internal_test.go (TestOwnVPSCeremonyHost); all green in go test ./internal/...",
    "next drive's sign-in leg gets a 2xx on add_password": "live-lab, unprovable in the sandbox — deferred to the next droplet drive; window-diagnostics.log (a1a8f37) discriminates the outcome either way"
  },
  "summary": "own-VPS OpenCeremony opens kanidm's reset screen on the public IdP door (id.<apex>) so the credential-update cookie sticks and add_password no longer 403s; private path localhost-forward shape byte-identical, both branches unit-tested.",
  "blockers": []
}
**close-report** for #498 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 498, "status": "success", "commits": [ "3448657" ], "changed_files": [ "STATUS.md", "docs/adr/0163-design-the-ceremony-opens-in-an-app-window-that-pins-the-gateway-ca.md", "internal/fleetwire/enrolment.go", "internal/fleetwire/enrolment_test.go", "internal/founding/handoff.go", "internal/founding/ownvpspath.go", "internal/founding/ownvpspath_internal_test.go", "internal/founding/testing/fakes.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 } ], "criteria": { "own-VPS OpenCeremony returns https://id.<apex>/ui/reset?token=…": "internal/fleetwire/enrolment.go OpenCeremony idpHost!='' branch builds https://<idpHost>/ui/reset?token=…; founding.OpenEnrolment (handoff.go) threads ownVPSCeremonyHost(s)=hostnames.IDP(ownVPSApex(draft)); pinned by TestOpenCeremony_OwnVPSOpensOnPublicIdPDoor and TestOwnVPSCeremonyHost", "private path unchanged (byte-identical localhost forward)": "OpenCeremony idpHost=='' branch keeps https://localhost:<kanidmPort>/ui/reset?token=…; pinned by TestOpenCeremony_BuildsResetURLAndReturnsCA (unchanged assertion) and TestOwnVPSCeremonyHost private/no-draft → \"\"", "unit tests pin both branches": "internal/fleetwire/enrolment_test.go (private + own-VPS, own-VPS asserts the forwarded kanidm port is never read) and internal/founding/ownvpspath_internal_test.go (TestOwnVPSCeremonyHost); all green in go test ./internal/...", "next drive's sign-in leg gets a 2xx on add_password": "live-lab, unprovable in the sandbox — deferred to the next droplet drive; window-diagnostics.log (a1a8f37) discriminates the outcome either way" }, "summary": "own-VPS OpenCeremony opens kanidm's reset screen on the public IdP door (id.<apex>) so the credential-update cookie sticks and add_password no longer 403s; private path localhost-forward shape byte-identical, both branches unit-tested.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-13 01:57:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#498
No description provided.