files-idp: the SHARED OAuth2 secret is root-owned, so kanidm-provision cannot read it through basicSecretFile — the post-start dies Permission denied and takes kanidm.service (and the switch) with it #1095
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#1095
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
20260901T005009Z(targetdevice) red atdeploy-takeoverafter 26 green legs — the same leg as20260831T202009Z, one rung deeper. #1088's declarative flip WORKED: kanidm-provision created the client, replaced its origins, and read back its basic secret (PATCH /v1/oauth2/nextcloud→ 200,GET /v1/oauth2/nextcloud/_basic_secret→ 200). It then died imposing the shared value:Read live off the gateway (
170.64.217.106,journalctl -u kanidm.service). Note the blast radius grew: the provisioning runs as kanidm.service's post-start, so its failure fails kanidm itself, andfiles-idp-client.servicethen fails downstream on a dead IdP (Failed to start Provision the files OAuth2 client…, retrying to its budget). Switch exit 4,masked_exitdetector correct as always.Diagnosis
internal/clan/files_idp_gateway.go:158declares the shared generator with no owner:That was correct while the gateway's reader was a root-run oneshot (
secret="$(cat …)"). #1088 changed the reader:basicSecretFileis read by kanidm-provision, running as the non-rootkanidmuser. Root-owned 0400 is unreadable to it.The precedent is one file over and already carries the rule. The gate client's own pre-shared secret,
internal/clan/vmguest.go:570-575:Same reader, same mechanism, ownership already stated. The files client just never inherited it — the ownership argument was chosen for the OLD reader and not revisited when the reader changed.
Why no test caught it: the render tests pin the generator's presence and
share = true, never its ownership; and ownership is a runtime property no eval can see —nix evalrendersfiles.secret = { }perfectly happily. This class only shows on a live deploy.Fix — landed
renderFilesOIDCSecretGenerator(&b, "kanidm")on the gateway side, with the reasoning recorded at the call site. Ownership is per-machine: the device declares the same generator (share = trueshares the VALUE, not the file mode) and keeps its own owner — idss-idp co-hosted, root on the member device, where no kanidm user exists and a kanidm owner would fail the chown (the mirror of #1029).Red-before-green: the render test now pins
files.secret = { owner = "kanidm"; group = "kanidm"; mode = "0400"; };and fails against the previous render; fullinternal/clansuite green.Filed and fixed in the same motion by the watching session under ADR 0174 (a two-way-door render change with an in-repo precedent, revertible) rather than routed to the swarm, because the drive executor was already re-firing and each cycle costs a ~60-minute gateway-image rebuild before it would have re-hit this same line.