founding: self-hosted kanidm sign-in shows the raw domain, never the community name — WriteCommunityKit lands after the gateway's one reconcile #667
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#667
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: sign-in. The kanidm sign-in heading reads "Kanidm id.rehearsal-b.idss.nz" instead of the community name "E2E Drive" (artifacts/ceremony/login-1.png; assertion in
assertSignInBrand/loginWithPasskey, journey.selfhosted-self-ho-3d505-ey-on-the-rehearsal-droplet/error-context.md). This is the own-VPS/self-hosted full-install path (rundrive-selfhosted/20260822T132259Z).Root cause
The self-hosted gateway's
kanidm-brand-pushsystemd unit — which pushes the community display name viakanidm system domain set-displayname— is gatedlib.mkIf (builtins.pathExists brandHeader)at Nix eval time (internal/clan/vmguest.go:493, insidegatewayBrandPush,internal/clan/vmguest.go:461-528;brandHeaderisCommunityHeaderNixPath = "../../idss/brand-kit.json",internal/clan/vmguest.go:897). If that file doesn't exist in the config repo when the gateway's ONE build/reconcile evaluates, the unit is compiled away entirely — not merely skipped, never declared — and nothing re-triggers its creation afterward. The code comment atinternal/clan/vmguest.go:906-909names this exact failure mode: "no header yet → no unit (mkIf), and the sign-in rests on kanidm's own 'Kanidm ' until the first brand lands."But in the founding sequence (
internal/founding/deploy.go), the community header is written to the config repo (WriteCommunityKit,deploy.go:573, logged atdeploy.go:576as "community header recorded in the config repo") after the single reconcile that builds this gateway's Nix config (rev := o.clan.Config().Head(ctx)atdeploy.go:454, applied viao.applyControlPlane(ctx, clanNode, rev, log)atdeploy.go:472). By contrast,landBrandArtifacts/landBrandLogo(deploy.go:437-443) ARE landed before that same reconcile, specifically so the applied revision carries them (comment atdeploy.go:432-436) — the community header just wasn't given the same treatment (#349's original push covered the artifacts/logo; the header-driven kanidm display-name push apparently shipped without the ordering fix).Since founding never triggers a second reconcile of the gateway after
WriteCommunityKit, thekanidm-brand-pushunit is permanently absent from this gateway's activated config, and the display name is never pushed.Evidence
founding-state.logevent order: "compiled brand artifacts landed in the config repo" → "eval preflight passed" → "reconciled" → "config repo, deploy runner and sign-in service up" → "brand kit applied to every bound surface" → "community header recorded in the config repo" (the header write is strictly after the only reconcile).state/clan-config/idss/brand-kit.jsonon disk correctly holds"Name": "E2E Drive"— the header DID land, just too late for this build.logs/droplet-journal.txt: zero occurrences ofkanidm-brand-pushanywhere (no Starting/Started/Failed line) — consistent with the unit never being declared, not with it running and failing.systemctl --failedinlogs/droplet-units.txtis also empty.kanidmdboots as domainid.rehearsal-b.idss.nzwith no later CLI push touchingdomain set-displaynamein the journal.Suspected layer
internal/founding/deploy.gostep ordering (Go orchestration), interacting with the Nix eval-timemkIfgate ininternal/clan/vmguest.go(gatewayBrandPushfor self-hosted/own-VPS; the VM path'skanidmDisplayNamePushBlock,vmguest.go:899-980, has the identical shape and is presumably equally exposed — worth checking whether the VM founding path lands its header before or after its own single reconcile).What plugging it needs
Two candidate fixes, and picking between them is a design call (not mechanical):
WriteCommunityKitearlier, alongsidelandBrandArtifacts/landBrandLogo(before therev := o.clan.Config().Head(ctx)capture atdeploy.go:454), so the same single reconcile picks it up. Risk:deploy.go:557-570's comment says the header write's current placement (after the control-plane unit is probed active) is deliberate — it's the signal the operator app's seat reads to know the community is "founded" (seat-source-real, referencing #312/#202). Moving it earlier would mark the seat founded before the control-plane is confirmed live, which is exactly the false-green shape other comments in this file (#443, #476) warn against.WriteCommunityKit, so themkIfre-evaluates with the header present without disturbing the founded-signal ordering. Adds a second deploy round-trip to every founding run — cost/latency tradeoff, and needs its own failure handling (a second apply that fails mid-founding).Either also needs the equivalent check on the private VM path (
kanidmDisplayNamePushBlock, gated the same way) and on Settings re-apply after founding (where the comment claims a header rewrite naturally re-triggers the oneshot — true only once the unit exists at all, which this bug shows may never happen on a fresh self-hosted founding).drive
20260822T132259Zred atsign-in:kanidm sign-in heading reads "Kanidm id.rehearsal-b.idss.nz", not the community name "E2E Drive" — the #349 display-name push did not take; artifacts/ceremony/login-1.png shows what renderedevidence:
test-results/…/20260822T132259Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Why this stayed invisible for twelve green legs: the push fails QUIET
internal/clan/vmguest.go:512-514(thekanidm-brandoneshot):A missing community name is treated as a no-op and the unit exits 0. So activation is green,
foundedis green, the whole founding chain is green — and the only thing that ever notices is a UI assertion on the sign-in heading, five legs later. That is the opposite of ADR 0100's posture, and it is why this survived every prior drive on this path.The comment's reasoning holds for the loopback/demo surface, where a nameless header genuinely is legitimate. It does not hold here: this unit only renders for a public gateway carrying a community apex (the
gatewayBrandPushgate), and on that surface a community always has a name — the wizard cannot reach S12 without one. A nameless header on the public surface is a BUG upstream, not an honest no-op.So the fix wants two parts, not one:
WriteCommunityhalf this ticket names).brandHeadercarries no.Name, instead ofexit 0. Without (2) the next path that forgets to write the header reproduces this exact silent failure, and we find it again only by eyeballing a screenshot.Scope: please check the RENTED path in the same change
This is the third defect in two days with an identical shape — a capability wired for own-VPS, never extended to the other live-public carriers, invisible because no drive exercised it there:
liveBoxHost(9292726).Phase 4 (rented, #645–#652) stands up the same public gateway surface and will run the same
kanidm-brandunit. If the seed-leg write is carrier-specific, rented is very likely missing it too — and phase 4 would meet this at its ownsign-inleg. Worth confirming while the fix is open rather than filing a fourth one.Evidence that #660's fix is good
Same drive (
20260822T132259Z), so this is a clean confirmation: the ceremony window now loadshttps://id.rehearsal-b.idss.nz/ui/reset/add_password— the public door, not the ssh -L forward — and the ceremony log carries zero 4xx/5xx. The 403 is gone and the credential enrols. 12/13 green; this ticket is the only thing between the widened phase-3 journey and its first real tail.Ruled by agent under ADR 0174 — veto anytime.
Root cause confirmed exactly as the ticket traced it, with one correction to the "suspected layer": this is not actually a shared-code problem across all founding paths — only the self-hosted full-install path is affected. The own-VPS, private-VM and rented paths all already land the community header via
seedCommunityConfig'sWriteCommunityKitcall before their single reconcile (internal/founding/{ownvpspath,privatepath,rentedpath}.go, all callingseedCommunityConfigahead ofrunDeploy). The self-hosted path'scomposeSelfHostedGateway(internal/founding/selfhostedpath.go, added by #626) portedSeedCommunity+EnsureOperatorfrom that same pattern to close a different gap, but leftWriteCommunityKitbehind — it only ever landed atdeploy.go's late, post-activation call. So the header write ordering bug is real, but scoped to exactly one path, not a generaldeploy.goordering defect.Considered both candidate fixes in the ticket and rejected both:
deploy.goWriteCommunityKitcall earlier — rejected. That call is the operator-app seat's sole "founded" signal (#312/#202), deliberately placed after the control-plane apply/activation/liveness-probe sequence so the seat is never marked founded before the control plane is confirmed live. Moving it would reproduce the exact false-green shape#443/#476already warn against in the surrounding comments — and it would move the signal for all four founding paths to fix a bug that only exists on one of them.WriteCommunityKit— rejected as a dead end for founding's own code path. The very activation this deploy just ran permanently closes the founding orchestrator's root@127.0.0.1 SSH door (the "#414 triad"/#550) — this is exactly whydeploy.go's ownapplyControlPlanecall is already guarded byif !st.Activated. A second call from founding's adapter after activation would faultPermission denied (publickey). (Confirmed by readinginternal/clan/vmguest.go'sgatewaySelfTrustUnit/idss-control-planeunit: post-founding config pushes — e.g. a Settings brand re-apply — are driven by the gateway's own in-process control-plane process, using a key it mints for itself after activation, never by the founding app reconnecting over root SSH. There is no lightweight "nudge the deploy runner to reconcile now" primitive reachable frominternal/foundingtoday.)Actual fix (landed,
a2acaec7):composeSelfHostedGatewaynow also callso.clan.Config().WriteCommunityKit(ctx, d.brandKit(false))right afterSeedCommunityand before the clanEnroll— landing the header in the same commit landscaperunDeploy'sConfig().Head()captures for this path's one reconcile. This exactly mirrors the already-working pattern the other three paths use.deploy.go's later call is untouched: it's an idempotent no-op there (the header is already present), and it remains the seat's real founded signal, unchanged for every path.Also closes the ticket's "worth checking" note on the VM path: confirmed the VM (private) founding path is not affected — it lands the header via
seedCommunityConfigbefore its own single reconcile, same as own-VPS and rented.Two-way door: revertible by commit, provable by a new seam test — not a security-posture widening, credential, trust-surface accept, data destruction, or physical-hands action, so it does not touch the ADR 0174 one-way-door list.
Proof
TestSelfHosted_CommunityHeaderRidesTheAppliedRevision(internal/founding/selfhostedpath_test.go) backs the fake clan config with a real*clan.ConfigRepoand readsidss/brand-kit.jsonback at the exact revisionDeploywas called with (not merely the post-deploy HEAD, which the pre-existing late call would already satisfy either way, masking the bug). Confirmed red before the fix:git show <rev>:idss/brand-kit.json→fatal: path 'idss/brand-kit.json' exists on disk, but not in '<rev>'. Green after the fix.go build ./...,go vet ./...,go test ./...all green across every package.sign-inleg of a self-hosted rehearsal drive is the live proof, per the established#635/#636/#641/etc. precedent for this class of fix.Close-report
main: commita2acaec7— "#667 — land the community header before the self-hosted gateway's one reconcile" (internal/founding/selfhostedpath.go,internal/founding/selfhostedpath_test.go,STATUS.md).STATUS.mdheader updated with the full account (same commit).Closing — the two-way-door fix is landed, proven by seam test, and does not require a human ruling or a one-way-door action.