deploy-surveys: the surveys port's own two units break the switch — limesurvey-admin runs nixpkgs' console.php with no LIMESURVEY_CONFIG, and surveys-brand cannot write under the root-owned Nix-store copy nixpkgs seeds upload/ from #1319
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#1319
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?
The failure
Drive
20260908T092408Z(drive 8, #1277, ond2830225): 20 legs green, red atdeploy-surveys—clan: masked_exit on gateway, the remote switch dead at exit 4 (artifacts/legs.json, leg 21;artifacts/verdict.jsonfirstRedLeg: deploy-surveys, 20 green / 1 red).#1318's eval repair held: the gateway co-hosting
surveys.nixevaluated and the LimeSurvey daemon deployed. What failed were the only two units the surveys port adds itself — each dying twice inside the switch, and each outside every assertion nixpkgs wrote:Evidence and cause
(1)
limesurvey-adminran with an empty environment. nixpkgs' limesurvey package replacesapplication/config/config.phpwith a two-linerequire(getenv("LIMESURVEY_CONFIG")), and the module hands that env to every consumer it owns —systemd.services.limesurvey-init.environment.LIMESURVEY_CONFIG(nixos/modules/services/web-apps/limesurvey.nix:332) andservices.phpfpm.pools.limesurvey.phpEnv.LIMESURVEY_CONFIG(:420).renderLimeSurveyAdmin(internal/clan/surveys.go:407-432pre-fix) ran the sameconsole.phpwith noenvironmentat all, sogetenvreturnedfalse,require("")raised the ValueError, and php aborted beforeresetpasswordwas ever dispatched. The threex3messages in (2) confirm the parent dirs existed — one message perinstall -dargument.(2)
surveys-brandcould not create its theme dir. The module seeds the writable upload dir with a tmpfiles copy of the package's own tree —"C ${stateDir}/upload 0750 ${user} ${group} - ${cfg.package}/share/limesurvey/upload"(limesurvey.nix:438) — and systemd's copy preserves the source's mode and owner on everything below the copied root: Nix store dirs areroot:root dr-xr-xr-x. Onlyupload/itself received the rule's0750 limesurvey:wwwrun;upload/themes/surveystayed root-owned and unwritable, so the oneshot'sUser = limesurvey(internal/clan/surveys.go:331) could notinstall -dbeneath it.Verified locally against systemd 259: a
Ccopy from a read-only source reproduces the mode preservation, and systemd-tmpfiles processes a path's parent item before the path's own (withzlines listed ahead of theCline, the copy still landed first and thezrules then adjusted).Suspected layer
The surveys port's declarative render,
internal/clan/surveys.go— specifically the two units the port adds besideservices.limesurvey. This is the sibling of GOTCHAS #191 one layer down: an eval smoke proves the options are real, not that the units run.The repair (landed)
limesurvey-admintakesenvironment = config.systemd.services.limesurvey-init.environment;verbatim (one home for the config store path), runs underconfig.services.phpfpm.pools.limesurvey.phpPackage(nixpkgs pins LimeSurvey to php83;pkgs.phpis a floating alias), and is handedCREDENTIALS_DIRECTORY=/var/lib/limesurvey/credentialson the command line — systemd points the unit's own$CREDENTIALS_DIRECTORYat itsLoadCredentialdir, which holds only the admin password, whileconfig.phpreads the encryption key/nonce from the daemon's dir.ztmpfiles rules re-ownupload/themesandupload/themes/surveyto the samelimesurvey wwwrun0750nixpkgs givesupload/itself.zadjusts an existing path and never creates one: a creatingdrule could makeupload/non-empty before theCruns, andCskips a non-empty target — every stock theme silently lost.Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)
Two-way and mechanical, not a design decision. Revertible how:
git revert 7bd371dcrestores the previous render byte-for-byte — the change adds aEnvironment=line and twoztmpfiles rules to a generated NixOS module, touches no route, no secrets shape, no message a community sees, no security posture (the oneshot keepsUser = limesurvey; nothing gains privilege, and the re-owned dirs get exactly thelimesurvey:wwwrun 0750nixpkgs already gives their parent). Proven by which test:TestRenderSurveys_AdminConsoleCarriesLimeSurveyConfigEnvandTestRenderSurveys_BrandThemeParentsAreWritableByLimeSurvey(both written first, both watched fail on the pre-fix render), plus the existing real-nixpkgsTestSurveysCohost_EvalSmoke, which now evaluates the co-hosted gateway to a drvPath — proving the three new config reads (systemd.services.limesurvey-init.environment,services.phpfpm.pools.limesurvey.phpPackage,users.users.limesurvey.group) resolve without recursion. Beyond the tests I read the built artifacts of that eval: the rendered unit carriesEnvironment="LIMESURVEY_CONFIG=/nix/store/in36sfliyb3zc7fgcfd457zsqiplynqy-config.php", and the built tmpfiles.d carriesz /var/lib/limesurvey/upload/themes 0750 limesurvey wwwrun - -beside nixpkgs' ownC /var/lib/limesurvey/upload … /nix/store/inj1nizfn0jwpnlid0sfz3r360bp2khh-limesurvey-6.15.14+250924/share/limesurvey/upload— the identical package store path the failing drive's journal names. Why mechanical: the module already meant to bootstrap the admin identity and land the brand theme; it simply never gave php the env nixpkgs' own consumers get, and never accounted for the store's read-only ownership surviving nixpkgs' seed copy. The code is made to do what it already meant to do — no new default, no changed trust moment, no one-way door. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.drive
20260908T092408Zred atdeploy-surveys(sig 119db33993c0) — self-fixed on the fast lane, commit409b233ef50695a605b34a57ef5f1d65a9c638c5; checks: targeted (red-first):go test ./internal/clan/ -run 'TestRenderSurveys_AdminConsoleCarriesLimeSurveyConfigEnv|TestRenderSurveys_BrandThemeParentsAreWritableByLimeSurvey' -v→ FAIL before the fix (surveys_test.go:136: the admin console must inherit limesurvey-init's environment (LIMESURVEY_CONFIG, #1319)andsurveys_test.go:167: the brand theme's parent dirs must be re-owned writable by limesurvey ("z /var/lib/limesurvey/upload/themes 0750 limesurvey ${config.users.users.limesurvey.group} - -")), PASS after. package:go test ./internal/clan/→ ok (17.986s), all 10TestRenderSurveys_*PASS. tree:go test ./internal/...→ no failures. real-nixpkgs eval:IDSS_EVAL_SMOKE=1 go test ./internal/clan/ -run TestSurveysCohost_EvalSmoke -v→ PASS (44.33s) — positive half evaluated the co-hosted gateway to/nix/store/gs0378ih7cv44z69shxfiqvs5v06c3iw-nixos-system-gateway-26.11.20260612.173d0ad.drv, teeth half still fails on the phantomuploadsDir. built-artifact check on that drv:unit-limesurvey-admin.service.drvcarriesLIMESURVEY_CONFIG=/nix/store/in36sfliyb3zc7fgcfd457zsqiplynqy-config.php;nixos-tmpfiles.d.drvcarries bothz /var/lib/limesurvey/upload/themes{,/survey} 0750 limesurvey wwwrun - -.go build ./...→ clean;go vet ./internal/clan/→ clean;gofmt -l internal/clan/→ clean. Commit shape: 3 files, 68 changed non-test lines (internal/clan/surveys.go57/3,docs/GOTCHAS.md8/0), one commit, not pushed; rails self-check → no removed or edited assertion/expectation line (the test file is additions only, 50/0), no removed test or leg declaration, no added skip.. evidence:/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T092408Zon matou-workstation.close-report for #1319 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
surveys-healthyred for the full 360s warm-up: LimeSurvey ships its RemoteControl JSON-RPC interface OFF, and OFF answers an empty HTTP 200 — the port's own health gate can never open a session #1321path— two normal-priority definitions, eval preflight excludes the gateway, nothing deployed #1329