invite-member red: the Nextcloud reconciler cannot reach the OCS API — /ocs is gated at the front door and the control plane carries no admin credential #790
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.
Blocks
Reference
Matou/idss#790
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
20260825T050659Z(droplet, commitb8b71ce7) — leginvite-memberred at 24 green / 1 red / 1 skip:The by-hand create, komiti materialisation and the member's own OIDC sign-in all passed; the leg dies on the FIRST OCS call the suspend makes —
Port.user's read atinternal/nextcloud/nextcloud.go:214, reached fromsetEnabled(internal/nextcloud/nextcloud.go:184-191) viaDisableCredentials(:168).Defect 1 —
/ocsis not exempt from the browser gateThe reconciler drives the DERIVED public files URL (
https://files.rehearsal-b.idss.nz,control-plane/cmd/control-plane/main.go:249-254), so every OCS call goes through the front door. The files route's exempt list carries the DAV sync paths and/status.phpbut NOT the OCS Provisioning API:internal/clan/files.go:74-79—FilesExemptPaths=/remote.php/dav*,/remote.php/webdav*,/public.php/dav*,/status.phpinternal/provision/deploy.go:602— that list IS the public route'sExemptPathsinternal/clan/frontdoor.go:428-437— everything not exempt falls into thehandle { forward_auth ... }blockinternal/clan/frontdoor.go:466-470— the gate's 401 becomes a 302 tohttps://<apex>/authz/signinThe reconciler's
http.DefaultClientfollows that redirect into the sign-in flow and reads back an HTML page.Port.requestonly special-cases 401/403 and >=500 (internal/nextcloud/nextcloud.go:264-269), so the HTML falls straight intojson.Unmarshalat:277— the'<'in the error is the sign-in page's first byte, not Nextcloud's.Corroboration: the files health probe went green in the same run (
droplet-journal.txt:1858,verdict=healthy) because/status.phpIS exempt — the exempt mechanism works;/ocsis simply missing from the list.Precedent settles the shape. The two sibling reconciler ports already exempt their credential-authenticated management APIs:
internal/clan/code.go:83—CodeExemptPathscarries/api/v1/*(the token-auth Forgejo REST API the code reconciler drives)internal/clan/chat.go:92—ChatExemptPathscarries/api/v4/*(the token-auth Mattermost API the chat reconciler drives)Files is the odd one out. Recommend the NARROW form rather than a blanket
/ocs/*, since/ocsalso carries user-facing sharing endpoints that should stay behind the gate:That is the only OCS subtree
internal/nextcloudtouches (nextcloud.go:199and:214). It is credential-governed exactly as the DAV paths are — Nextcloud refuses the OCS Provisioning API without the admin's basic auth — so the ADR 0074 posture holds.Defect 2 — the control plane carries no Nextcloud admin credential
Even past the gate the call 401s. From the same run:
admin=""—IDSS_NEXTCLOUD_ADMIN_USER/IDSS_NEXTCLOUD_ADMIN_PASSWORD(control-plane/cmd/control-plane/main.go:252) are read but never set anywhere outside tests. A repo-wide grep finds onlymain.go:252andoffboard_catalogue_test.go:63-64. The rendered unit confirms it:state/clan-config/machines/gateway/control-plane.nix:313-325exports the KANIDM / ALERT / CLAIM / ACCESS / GATE_OIDC vars and noIDSS_NEXTCLOUD_*.The two halves the credential needs already exist and just aren't joined:
internal/clan/files_attach.go:44,NextcloudAdminUser = "ocadmin", documented as "the admin service identity the module deploys AND the member-orbit reconciler authenticates as (one identity, ADR 0062 part 2)"nextcloud-adminclan-vars generator,internal/clan/files.go:338-344(files.adminpass, ownernextcloud, mode 0400). The control-plane unit runs as root (noUser=incontrol-plane.nix:280-303), so it can read that path.Suspected layer
Provisioning render, both halves —
internal/clan(front-door exempt list + control-plane env exports) withinternal/provision/deploy.goas the caller. NOT theinternal/nextcloudadapter: it is doing the right thing over a door that refuses it with no credential to present.What plugging it needs
Exempt the OCS Provisioning subtree. Add
"/ocs/v1.php/cloud/users*"toFilesExemptPaths(internal/clan/files.go:74-79) and extend the comment the waycode.go:64-82does — naming the reconciler as the credential-governed caller. Cover it ininternal/clan/files_frontdoor_test.goalongside the existing/status.phppin.Thread the admin credential into the control-plane unit. Emit
IDSS_NEXTCLOUD_ADMIN_USER=ocadminandIDSS_NEXTCLOUD_ADMIN_PASSWORDfrom thenextcloud-admingenerator ingatewayEnvExports(internal/clan/vmguest.go:1329-1366). The password followsvarSecretExport(vmguest.go:1372) — note it readsfiles.secret.path, whereas this generator's file is namedadminpass, so it needs its own line rather than that helper.Gate the export on files actually being placed, and mind the render order. The
nextcloud-admingenerator is declared by the FILES module (files.go:338), which does not exist at founding — an ungatedconfig.clan.core.vars.generators.nextcloud-adminreference incontrol-plane.nixis an eval error on any community without files. Gate it on a newGatewayFactsflag the waySMTPSubmission/ClaimSecret/CommunityApexalready gate theirs, and make sure the control-plane surface is RE-rendered afterattachFilesso the gateway switch carries the export. Both gateway renders must carry it — the own-VPS box runs the full-install render (the DUAL-RENDER hazard, GOTCHAS #12).Consider an eval assertion in the files/control-plane pair, matching
control-plane.nix:326+, so a files-placed gateway missing the export fails eval with the remedy rather than reding this leg one drive later.Both halves must land in one change. Shipping only the exempt path moves the failure from an HTML parse to
nextcloud: GET /ocs/v1.php/cloud/users/e2e-member: unauthorised (HTTP 401) — check the admin credential(internal/nextcloud/nextcloud.go:265) and burns another droplet on the same leg.Side observation (not the defect)
The control plane logged nothing when the act failed — no
idss-control-planeline at 05:17:57 indroplet-journal.txt, only the 05:17:26 health probe. The whole diagnosis had to come off the Playwright error string. A failed member act reaching a service port is worth a WARN.drive
20260825T050659Zred atinvite-member:POST /api/v1/members/e2e-member/suspend failed: 400 {"code":"act_failed","message":"nextcloud: GET /ocs/v1.php/cloud/users/e2e-member: cannot parse OCS response: invalid character '\u003c' looking forevidence:
test-results/…/20260825T050659Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)swarm-claim host=elitebook-distributed-server-03 run=10055
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #790 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
deploy-files' switch stopsidss-control-plane, whose cgroup holds theclanCLI, andswitch-to-configurationdies at 101 before it ever restarts anything #858deploy-files' switch stopsidss-control-plane, whose cgroup holds theclanCLI, andswitch-to-configurationdies at 101 before it ever restarts anything #858