#589 — invite-member leg's occ user:info check runs before the member's first OIDC login, but Nextcloud accounts JIT-provision at sign-in #684
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#684
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
Red leg
invite-member(drive20260823T030519Z, signature1dc3e7a84786):(the ssh client's host-key banner is all that's in
stderr; the actual occ error text — probably "User does not exist" — went to stdout, whichjourney.droplet.spec.ts:690doesn't capture into the thrown error. Worth also fixing the error message to include stdout while this is being fixed.)Evidence
app/tests/e2e/journey.droplet.spec.ts:650-687: theinvite-memberleg by-hand-creates a komiti + member over the control-plane API, then IMMEDIATELY runsnextcloud-occ user:info e2e-member --output=jsonover ssh (:683-687) — before the member ever signs in (oidcSignInAsMemberdoesn't run until:723).logs/droplet-journal.txt(run dir, tail): at03:15:19kanidmd creates thee2e-memberperson, thekomiti_e2e-crewgroup, sets the credential, and appends the group membership — all kanidm-side, no Nextcloud/PHP-FPM activity around it. Theocc user:infossh session opens a second later and its systemd unit (run-p9240-i9241.service) exits status 1.internal/member/byhand.go:71-82:CreateByHandonly callso.accounts.CreatePerson(the kanidmidpport) — it never touches Nextcloud.internal/nextcloud/nextcloud.go:30-38+internal/memberorbit/memberorbit.go:128-150(ServicePortinterface): there is no create/provision verb for Nextcloud accounts anywhere in the codebase — Nextcloud'suser_oidcis the only thing that ever creates a local user row, and it does so at OIDC token exchange (JIT provisioning), not at kanidm-side person creation.docs/adr/0179-design-komiti-materialise-as-nextcloud-groups-via-runtime-claim-maps.md: komiti reach Nextcloud only via theocgroupsOIDC claim at login; its own closing line says this materialization "needs...working on a real gateway anyway" — i.e. it was never live-proven before this drive.journey.droplet.spec.ts:626-647) explicitly argues occ should work "before the member ever signs in...independent of anything the browser later renders" — a design assumption this run's evidence now contradicts.3ca0578c("#589 wire the invite-member e2e leg") that authored this leg says explicitly: "Not live-proven...this session's bound could not also absorb the 1-2+ hour live founding drive." This is that leg's first live run.Suspected layer
Test design (
app/tests/e2e/journey.droplet.spec.ts), resting on a materialization-timing assumption that conflicts with the JIT-provisioning architecture (ADR 0179,internal/nextcloud/nextcloud.go). Not a selector/constant slip — the occ assertion is checking the wrong system at the wrong time.What plugging it needs (a design call, not mine to make)
One of:
occ user:infodisplay-name/komiti assertion to afteroidcSignInAsMember(:723) once the account has JIT-provisioned — but then it's no longer proving the by-hand-create + komiti chain independent of the browser, which was the leg's explicit point.CreateByHand(internal/member/byhand.go) eagerly provision the Nextcloud account too, so occ genuinely has something to read pre-login — a behavior change to production code, not just the test.Also worth fixing while here:
journey.droplet.spec.ts:689-691only surfacesinfo.stderrin the thrown error; occ's real diagnostic text is very likely on stdout and got swallowed, which is why the evidence signature is just the ssh host-key banner instead of the actual occ complaint.drive
20260823T030519Zred atinvite-member:occ user:info e2e-member exited 1: Warning: Permanently added '134.199.162.140' (ED25519) to the list of known hosts.evidence:
test-results/…/20260823T030519Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Ruled by agent under ADR 0174 — veto anytime.
Ruling: option 2 (assert the pre-login kanidm-side materialisation instead of Nextcloud's occ), adapted to an existing control-plane read rather than a new SSH+kanidm-CLI probe.
Root cause confirmed as diagnosed:
internal/member/byhand.go'sCreateByHandonly callso.accounts.CreatePerson(kanidm, via the IdP port) — it never touches Nextcloud. Nextcloud'suser_oidccreates its local user row only at OIDC token exchange (JIT provisioning, ADR 0179), so the leg's pre-loginocc user:infocall always had nothing to read.Why option 2, not 1 or 3:
oidcSignInAsMember) was rejected — it would stop proving the by-hand-create + komiti chain independent of the browser, which is the leg's whole point (its own comment block says so).CreateByHandeagerly provision Nextcloud) is a production behavior change that contradicts the JIT-provisioning architecture ADR 0179 deliberately chose, and ADR 0179 was itself an accepted design ruling — reopening it isn't a call to make inside a red-leg fix.Implementation: rather than a new SSH+kanidm-CLI probe, the leg now calls
GET /api/v1/members/{id}/detail(app/tests/e2e/journey.droplet.spec.ts:680-704) — the same control-plane read the P6-S4 member-detail screen renders (internal/member/detail.go'sMemberDetail), which reads display name + komiti straight through the IdP port to kanidm. This is test-only: no production code changed. It reuses the same direct-to-portal precedent this leg already uses for creation (dash.requestover the control plane's ungated/api/v1mux).Proof:
git revert a7b433d4.internal/member/detail_test.go'sTestMemberDetail_ShowsRoleKomitiAccessKaitiakiAndActionsalready provesDetail.Name/Detail.Komitipopulate correctly from the IdP alone (no Nextcloud involved) — the exact pre-login pathCreateByHanduses.go test ./internal/member/... ./internal/controlapi/...passes.npx tsc --noEmitover the e2e test package shows no new errors.invite-memberleg needs a real droplet drive to exercise this. I did not run one this session: the standing executor'sREHEARSAL_DRIVE_ISSUEenv var currently points at #657 (closed), not the open standing drive #652, so the automatic drive loop is not currently ticking this forward — filed as a separate follow-up, out of scope for this ticket (rule 1). A manual live founding drive is 1-2+ hours, the same bound the leg's own authoring commit (3ca0578c) already noted a single session can't safely absorb alongside everything else. Next live drive that reachesinvite-memberis the actual proof; if this ruling is wrong, the reporter will file a fresh signature ticket (dedup only matches open issues), same as any other gap-ticket fix in this repo.Commit:
a7b433d4— "#684 — invite-member's pre-login assertion reads kanidm, not occ". STATUS.md lead updated in the same commit.Close report.
Landed:
a7b433d4— "#684 — invite-member's pre-login assertion reads kanidm, not occ" (app/tests/e2e/journey.droplet.spec.ts,STATUS.md). Pushed toorigin/main.What changed: the
invite-memberleg's pre-login materialisation check no longer callsnextcloud-occ user:infoover SSH (which was reading Nextcloud before its JIT-provisioned user row exists, ADR 0179). It now callsGET /api/v1/members/{id}/detailover the same ungated control-plane API the leg already uses for creation — a read that goes straight through the IdP port to kanidm, populated synchronously byCreateByHand. The leg's point (by-hand-create + komiti chain proven independent of the browser) is preserved.Design ruling and rationale: posted separately above under ADR 0174.
Proof: existing unit coverage (
TestMemberDetail_ShowsRoleKomitiAccessKaitiakiAndActions) plusgo test/tscsanity — not yet live-proven against a real droplet drive (see the ruling comment for why, and #685 filed as the follow-up blocking automatic re-verification: the standing executor currently watches a closed issue, #657, instead of the open standing drive #652).Also noted, not separately fixed: the stdout-swallowing bug in the old error path (
journey.droplet.spec.ts:689-691in the pre-fix version) is moot — that code path is deleted along with the occ call it wrapped. Thebranded-chromeleg's own occ call (a different leg, working leg, out of scope here) still only surfaces stderr; not touched.Closing — the fix is a genuine two-way door (test-only, revertible), backed by existing test proof and direct code reading of the exact system it now reads. If the live drive proves it wrong when it next reaches this leg, the reporter will file a fresh signature ticket (dedup only matches open issues).