files-idp: kanidm system oauth2 update-basic-secret is not a kanidm subcommand — the off-gateway files client can never take the shared secret, so every placement deploy dies at switch exit 4 #1088
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#1088
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
Drive
20260831T202009Z(targetdevice) is red at legdeploy-takeoverafter 26 green legs (artifacts/legs.json,artifacts/verdict.json—firstRedLeg: deploy-takeover, commit090cc03eb65c6d5fa612415d10ea9744f292284d). The masked_exit detector reported it correctly:clan reported success but the log shows a real failure: the remote switch died at exit 4. Exactly one unit is failed on the gateway (logs/gateway-units.txt:2):and the journal names the cause (
logs/gateway-journal.txt:82-85, repeating every 5s until the 60-iteration settle budget is spent):Every preceding step in the oneshot succeeds (
login, group get-or-create, client create,add-redirect-url,update-scope-map,update-claim-map,update-claim-map-join,disable-consent-prompt,prefer-short-usernameall printSuccessatlogs/gateway-journal.txt:41-81). Only the final secret imposition fails, and it is&&-chained as the last link, so the wholeprovision_files_idpbody returns non-zero, the retry loop burns its full budget, and the unit exits 1 — hence switch exit 4. The device being unreachable for unit harvest (logs/device-units.txt) is downstream of the aborted switch, not a separate fault.Diagnosis
internal/clan/files_idp_gateway.go:215renders:There is no such verb, and no verb that does this job. Enumerated authoritatively from the package the gateway actually runs (
pkgs.kanidmWithSecretProvisioning_1_10, resolved to/nix/store/4wg40mgy3yvml343jnf9lvzv388ccjx8-kanidm-with-secret-provisioning-1.10.3):kanidm system oauth2 reset-basic-secret <NAME>—Usage: … reset-basic-secret [OPTIONS] <NAME>; regenerates a random secret, accepts no secret value.kanidm system oauth2 show-basic-secret <NAME>— reads the current one back.So the kanidm CLI can only generate or read a basic secret; it cannot be told one. This was known-unproven:
internal/clan/files_idp_gateway.go:213-214says "The placement drive confirms the exact kanidm secret-set verb; this is a two-way-door render", anddocs/status-archive.md:135records the same hedge ("The kanidm secret-set verb (update-basic-secret) is a two-way-door render — revertible, the placement drive confirms the exact verb (ruled by agent under ADR 0174, veto anytime)"). The placement drive has now run and the door swung shut: the verb does not exist and cannot be substituted.Note this is not the co-hosted path's problem.
internal/clan/files.go:818reads kanidm's own generated secret back (show-basic-secret) and hands it straight toocc user_oidc:provider --clientsecretin the same oneshot on the same box — no imposition needed. The split (ADR 0210 ruling 3) inverted the direction: a SHARED clan var (files-oidc-secret,share = true) is generated first and both machines read it (internal/clan/files_idp_gateway.go:142,172andinternal/clan/files.go:906,919), so the gateway must impose that value on kanidm. That requires a mechanism the CLI does not have.Suspected layer: the render seam,
internal/clan/files_idp_gateway.go(RenderFilesIDPClient) — specifically the choice to provision a pre-shared client secret imperatively rather than declaratively.What plugging it needs
The repo already contains the working pattern for exactly this problem, one file over. The auth gate's own OIDC client is a pre-shared-secret confidential client, declared declaratively at
internal/clan/vmguest.go:1346-1354:with the rationale at
internal/clan/vmguest.go:1338-1340naming the identical constraint: the secret is "read back, never CLI-minted, because the runtime needs it too (the forgejo/mattermost pre-shared pattern)". The nixpkgs option is real (services.kanidm.provision.systems.oauth2.<name>.basicSecretFile,nixos/modules/services/security/kanidm.nix:533), its secret-provisioning prerequisite is already satisfied on both gateway shapes (internal/clan/frontdoor.go:303andinternal/clan/vmguest.go:607both pinpkgs.kanidmWithSecretProvisioning_1_10), andservices.kanidm.provision.enable = trueis already rendered on the rented public path atinternal/clan/vmguest.go:1363.So the files client should be declared the same way rather than CLI-provisioned, and
files-idp.nixshould keep only what the CLI genuinely can do (the group, the scope/claim maps, the consent/username flags) — or drop the oneshot entirely if the declarative block covers those too.The open engineering question the worker must resolve: the gate client is declared at founding time by
gatewayKanidmProvision(internal/clan/vmguest.go), whereas the files client is written at placement time byAttachFilesIDPintomachines/<gateway>/files-idp.nix(internal/clan/files_idp_gateway.go:62-86). Growingservices.kanidm.provision.systems.oauth2from a second writer touches the single-writer posture (ADR 0102) — though the provision attrpath is already documented as merging with front-door'sservices.kanidm(internal/clan/vmguest.go:1356-1361), so a placement-timeservices.kanidm.provision.systems.oauth2.<files-client> = { basicSecretFile = …; }fragment infiles-idp.nixmerging into founding's block looks like the shape with the least disturbance. Decide, render, and pin it ininternal/clan/files_idp_gateway_test.go(which currently pins the shared-secret generator and thesecret="$(cat …)"read at lines 55-65 but does not pin the secret-set line, so no test caught this).This cannot be settled by a render test alone — the verdict only comes from a placement drive that reaches
deploy-takeovergreen. Also updatedocs/status-archive.md:135(andSTATUS.mdper the same-commit rule) to record that the two-way door was walked back through: the verb does not exist.Why this was not self-healed
Not mechanical (no correct verb exists to substitute — it is a mechanism change, not a rename), it is a design decision on ADR 0210 ruling 3's provisioning route, it crosses the founding/placement writer boundary, and no targeted check on this machine can prove the outcome. Signature
800a2936720bhas also already absorbed one self-fix on drive20260831T141810Z(commitbae17488f46319a018d4caa644af6849ab1faa74, the inventory re-point) — this is a second, distinct defect hiding behind the same masked_exit signature.drive
20260831T202009Zred atdeploy-takeover:deploy failed (rescue): provision: deploy gateway: clan: deploy failed on 1 node(s): gateway: clan: masked_exit on gateway: clan reported success but the log shows a real failure: the remote switch dievidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T202009Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedConfirming the fix direction from a session-side check of the pinned nixpkgs rev (
173d0ad7), to save the worker the module archaeology:services.kanidm.provision.systems.oauth2.<name>carriesscopeMaps(attrsOf list),claimMaps.<claim> = { joinType = "array"; valuesByGroup.<group> = [ … ]; },preferShortUsername,originLanding, andoriginUrlaccepts a list — so the portless + portful redirects, theidm_all_personsscope map, theocgroupsclaim map with array join, and short-username all move into the declarative fragment. The oneshot shrinks to the one thing the 1.10 provision schema can't express:disable-consent-prompt(DDR 0158). The copyable slim-oneshot pattern (settle-retry until the provision creates the client, then fail-loud) isgatewayGateConsentBlock,internal/clan/vmguest.go:1110-1175.scopeMaps/claimMapsgroup key against declaredprovision.groups(assertGroupsKnown), never the live server —idm_all_personsandnextcloud_adminsare both declared bygatewayKanidmProvision(vmguest.go), so the merged fragment passes eval on the rented path. Bonus: this moves the whole fault class into the offline eval gate — a future mis-merge reds pre-spend instead of burning a droplet at deploy-takeover.groups/personsstay out of the fragment: founding's block owns them (ADR 0105); the fragment declares onlysystems.oauth2.<files-client>.Session note (ADR 0174): the original render comment explicitly staked this verb as a two-way door pending drive confirmation — the drive has now confirmed, and the declarative flip is the ruled direction. Veto anytime.
swarm-claim host=matou-dev-server-01 run=15321
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1088 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
create --wait(drive 20260831T231010Z parked at preflight, nothing filed) #1092