branded-chrome: assertBrandedChrome's page.request theming-logo GET reds — the community gate session cookie is gone by the time it fires, even though the immediately-prior /settings/admin navigation proved it live #658
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#658
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?
Failure
branded-chromeleg (drive20260822T111032Z, sigc898f3073ff4) reds inassertBrandedChrome(app/tests/e2e/fixtures/provision.ts:963-977):page.request.get(doorPath(door, '/index.php/apps/theming/image/logo'))returns 200 with 2846 bytes oftext/html; charset=utf-8, not the 70-byte uploaded PNG. Step 1 of the same assertion (theocc config:list themingproof over SSH, provision.ts:927-955) already passed —logoMime: image/pngwas confirmed stored server-side (droplet-journal.txt:1921Updated logoMime to image/png). So the theming push itself (DDR 0147/#356 mechanism, internal/clan/files.go:401-457renderNextcloudBrand) landed correctly. The fault is in reaching the served bytes, not in producing them.Evidence chain
oidc-adminleg (provision.ts:558-582,oidcSignInAsOperator+assertOperatorIsAdmin) completes a full gate-oidc authorize (state=e358b9a2..., kanidm returns 303 directly — its SPA auto-completed via an existing local session) followed by Nextcloud's own user_oidc login.assertOperatorIsAdmin(provision.ts:799-830) then does a realpage.goto('/settings/admin')and assertsresp.ok()ANDlandedUrl.endsWith('/settings/admin')— since/settings/adminsits behind the same ungated-nowhereforward_auth(internal/clan/frontdoor.go:412-439renderRoute, no exempt paths for this route), this proves the community SSO session cookie (idss_session, internal/controlapi/session.go:142-153) was valid at that moment.occ config:list(droplet-journal.txt:1986-1987, 11:20:56).page.request.get()to the theming image triggers a brand-new gate-oidc authorize attempt (freshstate=fe95ca69..., fresh PKCE) that kanidm answers withstatus_code: 200andERROR: Invalid identity: NotAuthenticated— i.e. Caddy's forward_auth (internal/clan/frontdoor.go:428-437) found no valididss_sessioncookie for this specific request and redirected to/authz/signin(internal/controlapi/signin.go), and kanidm itself also saw no active browser session. The 200/HTML response IS kanidm's/ui/oauth2SPA shell — a plausible match for "2846 bytes text/html".test-results/.../state/Cookies, the ceremony window's real Chromium cookie DB): at end-of-run it holds only the transient flow cookies from the failed 11:20:57 attempt —idss_authz_flow(hostrehearsal-b.idss.nz, path/authz) and kanidm's owno2-authreq(host.id.rehearsal-b.idss.nz) — both created at exactly 11:20:57.044-069. There is noidss_sessioncookie anywhere in the store, despite step (1) proving one was live only ~9 seconds earlier. It was never written, or was written and then lost, before the theming-image GET.Compounding factor (not the root cause, but sharpens the failure mode)
Kanidm's
/ui/oauth2authorize endpoint only auto-completes via client-side JS reading a stored session token (that's why the earlier real-navigation flows show either a single 303 hit — JS ran, auto-completed — or a 200 SPA-shell then a follow-up hit).page.request.get()is a bare HTTP fetch with no JS execution, so if forward_auth ever redirects it into this path, it can never complete the flow — it always dead-ends on the SPA shell. This makesassertBrandedChrome's use ofpage.request.get()against a gated route (provision.ts:963) fragile even for a transient session hiccup: a realpage.goto()would self-heal (kanidm's stored session auto-completes it), but the bare API fetch cannot.Suspected layer
Either (a)
internal/controlapi/signin.go(signinCallback, line 202) /session.go(SessionCookie) has a narrow window where the mintedidss_sessioncookie doesn't durably land in the browser's cookie store after a rapid preceding gate-oidc round trip, or (b) something in the app/ceremony window between theoidc-adminandbranded-chrometest steps drops it. I could not pin down which — the trace.zip network capture only covers the unrelated fresh throwaway browser from thebranded-loginstep (a different browser entirely, cookie-less by design), not the ceremony window's own traffic, so I have no packet-level view of the actual/authz/callbackresponse that should have minted the cookie at ~11:20:48.What plugging it needs
Live reproduction on a droplet with the ceremony window's own network/cookie tracing enabled (or added), to see: does
/authz/callbackactually issueSet-Cookie: idss_session=...on this run, and if so, why does it not persist ~9 seconds later. This is a session/auth-timing bug spanning Caddy forward_auth, kanidm's OIDC flow, and the control-plane's cookie minting — not a mechanical fix I can make or verify from static logs on this dev machine.Signature:
c898f3073ff4drive
20260822T111032Zred atbranded-chrome:the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364)evidence:
test-results/…/20260822T111032Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Static-evidence pass + one instrumentation commit — ADR 0174 (agent ruling, veto anytime)
I worked this against the evidence already on disk (
test-results/drive-droplet/20260822T111032Z/is reachable from this session at/home/dev/swarm/Matou/idss/test-results/...— same host family as matou-workstation) before reaching for a fresh live drive, since the ticket's own "what plugging it needs" already named the open questions precisely.Ruled out (with proof, no live drive needed)
gateSessionTTL = 12 * time.Hour(control-plane/cmd/control-plane/main.go:90) — nowhere near the ~9s gap in the evidence chain.droplet-journal.txtshows exactly one stableidss-control-plane.serviceprocess (PID 2400, started 11:17:36,composition_whole=true) running continuously through both the successfuloidc-adminexchange (11:20:47-49) and the failed theming request (11:20:57) — no intervening restart that could have rederived the session-signing secret.page.requestcookie-sharing gap (my own leading hypothesis going in, given the ceremony window is_electron.launch()-driven). Traced the pinnedplaywright-core@1.62.1source directly (node_modules/.pnpm/playwright-core@1.62.1/...lib/coreBundle.js):ElectronApplication._browserContext = browser._defaultContextis a REALBrowserContext(the sameCRBrowserclass regular Chromium tests use), andpage.requestagainst it resolves toBrowserContextAPIRequestContext, whose.cookies()/_updateRequestCookieHeader()read LIVE offthis._context.cookies(...)(a CDP query of the actual browser's jar) — the exact same source a realpage.goto()would consult. Confirmed this isBrowserContextAPIRequestContext, not the standaloneGlobalAPIRequestContext(which DOES carry a private, potentially-stale cookie mirror — that class is used only forplaywright.request.newContext(), notpage.request). So a red here is not test-tooling noise; the browser's live jar genuinely had no valididss_sessionat request time, corroborating the ticket's evidence chain rather than explaining it away.state/Cookiesdb (evidence point 4) merely lagged Chromium's batched SQLite commit rather than reflecting the live jar. Checked directly (sqlite3 state/Cookies): the two flow cookies it DOES hold (idss_authz_flow,o2-authreq, bothis_persistent=1) were written at 11:20:57.04x and the run continued for minutes after (logs go to 11:32) — so the persistent-cookie flush path clearly works within this run's lifetime, andidss_session(alsoMaxAge-persistent, 12h) had ample time to have been flushed too, had it still been live. This weakens but doesn't fully retire the theory — I did not get a byte-level trace of the flush itself.What's still open
Whether
idss_sessionwas genuinely never retained by the browser after theoidc-admincallback, or was cleared by something between the two requests — I could not get the one piece of evidence that settles it: a live read of the browser's actual cookie jar (or the rawSet-Cookieheader off/authz/callback) at the moment of the theming request. Getting that needs either a live droplet or the local-guest QEMU path (scripts/smoke-private-path.sh --drive nextcloud --target local-guest, which drives the identicalassertOperatorIsAdmin→assertBrandedChromesequence viaprovision-nextcloud.live.spec.tsat no cloud cost) — and this session-runner container cannot do either:systemctl --userhere reportsFailed to connect to bus: No medium found(no user systemd session, so the QEMU guest machinery can't run), and this container's hostname ismatou-dev-server-01, notmatou-workstation— a fresh droplet spin-up is normally the standingrehearsal-executor.shcron's job, not an ad hoc diagnostic session's, and I didn't judge it right to improvise around that gap for a one-off investigation.What I landed instead (two-way door: a commit to a test fixture, revertible, provable by the next drive)
246dc4ae—assertBrandedChrome(app/tests/e2e/fixtures/provision.ts) now readspage.context().cookies(...)foridss_sessionimmediately before firing the theming GET — the same live read the request itself performs — and folds the result into both failure messages. This doesn't require me to trigger anything: the standingrehearsal-executor.shcadence will runjourney.droplet.spec.tsagain on its own schedule, and if this leg reds again the ticket filing will carry the answer (present-with-expiry, or absent-plus-what-else-is-in-the-jar) directly, closing the exact gap the "what plugging it needs" section named — no separate live-tracing session required to even SEE the evidence next time.Ruling
Two-way door under ADR 0174 (a revertible test-fixture commit) — landed. The live-reproduction root-cause work itself is NOT a human judgement call (no credentials/posture/trust-surface/data-destruction/hardware involved), so I'm leaving this
ready-for-sessionrather thanready-for-human: the next session that picks it up should have matou-workstation-level access (or genuinesystemd --useraccess to run the local-guest path) and can read straight off the nextbranded-chromered — automatic or hand-triggered — for the now-instrumented answer, rather than re-deriving items 1-4 above.session-runner: two unattended attempts did not advance this ticket — labelled
agent-blockedfor a human look (ADR 0174 escalation). Latest session log:/home/dev/.local/state/matou-session-runner/logs/run-658-20260822T134007Z.logon the workstation. Removeagent-blocked(and the stale fail counter if re-arming by hand) to let the runner retry.drive
20260822T164737Zred atbranded-chrome:the theming logo served 2846 bytes as "text/html; charset=utf-8" — not the 70 uploaded logo bytes; the DDR 0147 logo-bytes push did not land the operator's mark on the files surface (#364) (idss_sesevidence:
test-results/…/20260822T164737Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Second access path, and now with
246dc4a's breadcrumb — evidence from thephase-2 re-confirmation drive
20260822T164737Z(#669,--target droplet),legs 1–23 green, this the only red (779ms):
Two things this pins down that the ticket did not have before:
246dc4a's instrumentation works and names the cause directly —idss_sessionis absent from the browser context at the momentpage.requestissues the theming GET. Not stale, not wrong-scoped: absent.text/html, 2846 bytes — i.e. Nextcloud answered thelogo GET with a page (the login/redirect shell), which is exactly what an
unauthenticated theming request gets. So the logo bytes are not missing from
the push; the request never arrives authenticated. That moves suspicion off
the DDR 0147 push path and onto how
page.requestinherits (or fails toinherit) the context's cookie jar.
This is the same failure on
--target dropletas on--target selfhosted, soit is path-independent — a harness/cookie-propagation fault, not something
about a particular access path. Still
agent-blocked; recording the evidenceso the next session starts from the diagnosis rather than re-deriving it.
ROOT CAUSE FOUND — this is a harness bug, not a session/auth bug. The product is fine.
Decisive evidence from drive
20260822T164737Z's own ceremony diagnostics(
artifacts/ceremony/window-diagnostics.log, lines 706/711):The ceremony page fetched the theming logo successfully, authenticated, 200 —
at the very moment
assertBrandedChromereported the session gone. The wholesigned-in Nextcloud dashboard rendered around it: every
apps/theming/theme/*.css,img/*.svg, the background webp — all 200 as subresources of an authenticatedpage. The session was never lost. It was live the entire time.
What
246dc4a's breadcrumb actually reported this run was not "expired" but:(none). Zero cookies for an origin the page had just finished loading anauthenticated dashboard from. That is not a session that expired — a jar with a
stale or wrong-scoped cookie still has cookies in it. An entirely empty jar
for a busy origin means the jar being read is not the jar being used.
Why
ceremonyPagecomes fromElectronApplication.waitForEvent('window')(
ceremony.ts:243-255) — a Playwright Electron page. Its real cookie jar isElectron's own
session.page.context()on an Electron page is a syntheticBrowserContextPlaywright fabricates; it does not proxy Electron's sessioncookie store. So both
page.context().cookies()(reads empty) andpage.request.get()(sends no cookies, gets bounced to the gate, receiveskanidm's 2846-byte SPA shell as
text/html) operate on a jar that is not theone the renderer uses.
page.goto()and every subresource fetch go throughElectron's real session, which is why
assertOperatorIsAdminpasses 9 secondsearlier and why the logo subresource above is a clean 200.
dashandceremonyPageare the SAME object (journey.droplet.spec.ts:469,const dash = ceremonyPage!), so this is not a wrong-window mix-up — I checkedthat first and it is not the answer.
What this retires from the ticket
The whole "Suspected layer" section is chasing a phantom. No live
reproduction with cookie tracing is needed; no investigation of
signinCallback/SessionCookieminting, Caddyforward_auth, or kanidmtiming is needed. The code comment at
provision.ts:964-971asserting thatpage.request"shares the page's OWN browser-context cookie jar ... verifiedagainst Playwright's own BrowserContextAPIRequestContext" is true for
Chromium and false for Electron — that is the assumption that cost this
ticket its investigation.
The one thing the ticket already had right, and which now explains everything,
is the "compounding factor" paragraph: a bare
page.requestfetch runs no JSand can never complete kanidm's authorize flow. Correct — and it never should
have been asked to.
The fix
Assert the served bytes from inside the renderer, where the real session
lives, instead of from the context-level request API — e.g.
page.evaluate()with a
fetch()of the theming URL returning the bytes, compared toexpect_.logoexactly as now. Byte-equality (#364 / DDR 0147) is preserved;only the transport changes. Keep
246dc4a's breadcrumb — it is what caughtthis, and it should stay to catch the next one.
Path-independent, as expected for a harness fault: identical on
--target droplet(this drive) and--target selfhosted.Removing
agent-blocked— the block was "needs a live drive I cannot run", andthat is no longer true: the root cause is pinned from evidence already on disk
and the remaining change is a small, testable harness edit. Ruled by agent
under ADR 0174 — veto anytime.
FIXED — landed
040988aThe diagnosis in my previous comment is now code.
assertBrandedChrome(app/tests/e2e/fixtures/provision.ts)page.evaluate+fetch(url, { credentials: 'include', cache: 'no-store' }), bytes chunkedback as base64. Byte-equality against
expect_.logo(#364 / DDR 0147) isuntouched; only the transport moved. This is also strictly more correct on
the private path, where
dashis a real Chromium — a renderer fetch is rightfor both.
now reds on its own precondition instead of masquerading as a branding fault.
(Both callers already satisfy it:
assertOperatorIsAdminnavigates to/settings/adminon the door immediately before, on the droplet path and theprivate path alike.)
246dc4a's breadcrumb stays, relabelledcontext-jar (not authoritative on Electron, #658). It is what caught this; it must never again be readable asproof a session died.
function's last statement, so for two months every red left no picture of the
chrome it was complaining about. A capture failure still never reds the leg.
Beyond this leg.
journey.droplet.spec.tscarried the same false rule in acomment — "the same
page.requestrides the page's session precedent the S5fleet probe already uses". Those calls (
invite-member's komiti/member POSTs,the S5 fleet probe) are safe only because the portal's own
/api/v1mux isnot cookie-gated — the gate is Caddy
forward_authon the PUBLIC door(
internal/clan/frontdoor.go), not on the control plane. Comment corrected sothe precedent cannot be extended to a gated route. I checked every other
page.requestintests/e2e/: the rest are ungated or best-effort probes.GOTCHAS #56 records the shape, including the general tell worth keeping:
read
cookies present: (none)as "wrong jar", not "expired". An expiredsession leaves stale cookies behind; an empty jar for a busy origin means the
jar being read is not the jar being used.
vue-tsc+vitest runboth green.Left OPEN deliberately. The diagnosis is proven from evidence already on
disk, but the fix is not yet proven live — no drive has reached leg 24 since it
landed. Closing on a landing alone is the repo's usual convention (#643's
precedent), and I am not following it here: this leg has been red for two months
and false confidence is what cost it that time. It closes when a phase-2 drive
returns 24/24.
Dropped
agent-blocked(the block was "needs a live drive I cannot run" — nolonger true) and
ready-for-session(there is nothing left for a session to do;the next step is a drive, not an edit), so neither the runner nor the swarm
churns on it while it waits. Ruled by agent under ADR 0174 — veto anytime.
Triage pass — category added, state deliberately left unset
Added the
bugcategory label (missing; this is a harness bug per Ben's2026-08-23T02:23 root-cause comment). Not applying a state label
(
needs-triage/ready-for-agent/etc.) — Ben's fix-landed comment explicitlystripped
agent-blockedandready-for-session"so neither the runner northe swarm churns on it while it waits" for the confirming phase-2 drive
(24/24). This ticket is closed only on a green drive, not an edit; the next
actor is a drive, not an agent or a human editor. Assigning a queue-routing
state label now (even
ready-for-human) would re-surface it to automationand defeat that intent.
Ruled by agent under ADR 0174 — veto anytime. This is a two-way door:
reversible by adding the state label back, and provable by re-reading this
thread — nothing here is a judgement call about the underlying bug, only
about whether to disturb a maintainer decision made in this same session.
Re-triage once the confirming drive lands (green → close per the ticket's own
stated closing bar; red → back to the swarm/session queue with the
appropriate state label at that point).
PROVEN LIVE —
branded-chromeis GREEN. Closing.Drive
20260823T030519Z(#683,--target droplet, atbb9c700):Legs 1–24 all green. The leg that had been red since 2026-06 passes on the
first drive after the fix, with no retry and no flake — 3.2s, the same order as
every other assertion leg.
The frame this project had never produced
artifacts/nextcloud/branded-chrome.pngexists, attached below. It is theNextcloud dashboard — "Hello, Drive Operator", the community's logo in the
header, the kit's background — which is the surface #409 is about and the
surface drive-17 originally found unbranded. Both halves of
bb9c700show init: the frame is taken at all (it used to be the function's last statement, so
no red ever left one), and it is taken on the dashboard rather than the
/settings/adminpageassertOperatorIsAdminparks on.What the fix was, in one line
The session was never lost.
page.requeston a Playwright Electron pagereads a synthetic cookie jar that is not the renderer's, so the request arrived
unauthenticated and read back kanidm's SPA shell as a plausible 200. Fetching
in-renderer (
page.evaluate+fetch(credentials:'include')) carries thesession the page actually has. Byte-equality (#364 / DDR 0147) never changed.
Honesty note on the drive's overall verdict
The drive itself is RED, but not here: it got past leg 24 for the first
time and immediately hit
invite-member(leg 25), now filed as #684 — theleg asserts
occ user:infobefore the member's first OIDC login, but NextcloudJIT-provisions accounts at sign-in. That is a different defect on a leg this
journey had never before reached, not a residue of this one. ADR 0179's own
closing line already said that materialization "needs working on a real gateway
anyway"; #683's drive is what finally got there.
I held this ticket open against the repo's usual close-on-landing convention
precisely so this drive, not a commit, would decide it. It decided it.
whakapapa-wears-kitred on first contact: the brand PUT answered 200 with the applied keys, but the Gramps Web door serves the DEFAULT title *and* default palette — the frontend's read offrontend.*was never verified (the "deferred clan-lab driv… #1317