surveys-healthy red 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 #1321

Closed
opened 2026-09-08 13:03:03 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260908T112826Z (drive 8, #1277, on a948f6ed): 21 legs green — deploy-surveys switched clean at last, #1318's eval repair and #1319's unit repair both holding — and red at surveys-healthy, the very next leg.

surveys service is not healthy after 360s of warm-up re-probe (#556):
Surveys is not serving — LimeSurvey could not capture and keep a response
through its public form — this service is not doing its job

Nothing looked broken. logs/guest-failed-units.log reports "0 loaded units listed"; logs/guest-caddy.log logs no error for the surveys host; the control plane re-probed 36 times plus the re-probe loop with one unchanging fault (logs/guest-control-plane.log:129-200):

limesurvey remotecontrol (get_session_key): could not decode the reply: unexpected end of JSON input

The very first RPC call of the gate — every later call is unreachable behind it.

Evidence

The surveys port's health gate (ADR 0062 part 3) drives LimeSurvey's whole capture-and-keep loop over the RemoteControl 2 JSON-RPC API at /index.php/admin/remotecontrol — control-plane/cmd/control-plane/surveyshealth.go:65 (the path) and :161 (get_session_key). That is the mechanism STATUS.md:186 records as the landed #1150 design.

LimeSurvey ships that interface off: application/config/config-defaults.php:642 sets $config['RPCInterface'] = 'off', and internal/clan/surveys.go never set it (verified against the pinned package source, limesurvey-6.15.14+250924).

Off is not a refusal, which is exactly why it was invisible. application/controllers/admin/RemoteControl.php:39-69, on a POST, dispatches only when the type is 'xml' or 'json'; every other value falls straight through to Yii::app()->session->destroy(); exit; and echoes nothing. So an off interface is an HTTP 200 with a zero-byte body — not the 403/404 the check would have surfaced as HTTP 403.

surveysRPC gates on the status code before decoding (surveyshealth.go:315-325), so the honest-looking 200 carried the fault all the way to json.Unmarshal — and json.Unmarshal on zero bytes is precisely unexpected end of JSON input.

The request shape was never at fault: LSjsonRPCServer::handle wants a POST with Content-Type: application/json and {method, params, id}, which is exactly what surveysRPC sends (surveyshealth.go:301-309).

The suspected layer

The declarative render, internal/clan/surveys.go — the third contract layer of a catalogue port, under the two already learned:

  • #191 (GOTCHAS) — the upstream module's OPTIONS, proven by the eval smoke.
  • #192 (GOTCHAS) — the runtime environment of the units the port adds itself.
  • this one — the upstream APPLICATION's own feature switches. Any capability the port's gate or reconciler speaks must be explicitly enabled in the app's config, because upstreams ship remote-control and API surfaces off by default, and neither nix eval nor a green switch can see it.

The repair

RPCInterface = "json" nested at config.config: LSYii_Application::setConfigs (application/core/LSYii_Application.php:166-179) merges $userConfigs['config'] over the defaults, so a top-level key is silently ignored — #1318's lesson, one layer up. The JSON dialect only, with the API-publishing key left unset so the GET listing of every admin method stays off, and every method still demands the same admin credential the already-served admin UI takes.

Recorded as GOTCHAS #194.

Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)

Mechanical repair, not a design decision. #1150 already ruled RemoteControl 2 as the surveys port's mechanism — STATUS.md:186 records part (3) of the landed port as "LimeSurvey's whole capture-and-keep loop over RemoteControl 2 + the public form", and surveyshealth.go is built entirely on it. The render simply omitted the switch that makes the already-landed design true. This makes the code do what it already meant; it does not decide anything new. It is the same class as my two prior heals in this series (#1319 render-vs-nixpkgs drift, #1320 readiness gate), one layer further up.

Not a security-posture change in substance. The bounded delta: RC2 rides the same host and the same /index.php/admin/… prefix as LimeSurvey's already-served admin UI, and takes the same admin credential (get_session_key demands user+password; every other method demands a session key). No new credential class, no new trust boundary, nothing a community sees changes. The API-publishing key is left unset so the GET introspection listing of every admin method stays off. On the public path the whole surveys route already sits behind the front door's forward_auth gate (internal/clan/frontdoor.go:454-485) with no exempt paths declared for surveys; on this drive's private path every service route is ungated by design (ADR 0150, renderPrivateRoute).

Two-way door — revertible how: deleting the single rendered line { RPCInterface = "json"; } in renderLimeSurveyDaemon (internal/clan/surveys.go) restores the previous bytes exactly. The module is re-rendered from the live set and re-deployed on every drive, so a later commit reverts it with no migration and no residue.

Proven by which test: TestRenderSurveys_RemoteControlJSONInterfaceIsEnabled (internal/clan/surveys_test.go), written red-first — it pins both the switch AND its nesting under config.config (a top-level key would be silently ignored), and requires the XML dialect and the API-publishing key to stay off. Beyond the seam test, the existing real-nixpkgs eval smoke TestSurveysCohost_EvalSmoke passes, and I decoded the built artifact: the evaluated gateway's config.php derivation carries "config":{"RPCInterface":"json"} — the value is really reaching the deployed file, not just the render's string. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260908T112826Z red at surveys-healthy (sig 9ea63fb93ac3) — self-fixed on the fast lane, commit 62f097938765d38e9e20612ad00a9703bf801442; checks: targeted (red-first): go test ./internal/clan/ -run TestRenderSurveys_RemoteControlJSONInterfaceIsEnabled -v → FAIL before the fix (surveys_test.go:191: LimeSurvey's RemoteControl JSON-RPC interface must be enabled — the port's own health gate speaks it, and LimeSurvey ships it off (answering an empty 200)), PASS after. package: go test ./internal/clan/ → ok (17.999s), all 11 TestRenderSurveys_* PASS. trees: go test ./internal/... ./control-plane/... → no failures. real-nixpkgs eval smoke: IDSS_EVAL_SMOKE=1 go test ./internal/clan/ -run TestSurveysCohost_EvalSmoke -v → PASS (26.98s) — positive half evaluated the co-hosted gateway to /nix/store/ik6mywa8pbhqxi5kz1annh5sjlk3n5sr-nixos-system-gateway-26.11.20260612.173d0ad.drv, teeth half still fails on the phantom uploadsDir as it should. built-artifact check on that drv: decoded its config.php derivation (g8r8paiis1rhn2aqixvz5lc8wz41rwmw-config.php.drv) → config.config carries RPCInterface = "json", and the API-publishing key is absent. root-cause verified against the pinned package source (realized /nix/store/rs1f1f5smj81i1x4vv2578aqijwd0r4q-source, limesurvey-6.15.14+250924): config-defaults.php:642 = 'off'; RemoteControl.php:39-69 echoes nothing unless xml/json; LSjsonRPCServer.php accepts exactly the request shape surveysRPC sends. go build ./... → clean; gofmt -l internal/clan/ → clean; go vet ./internal/clan/ → clean. Commit shape: 3 files, 18 changed non-test lines (internal/clan/surveys.go 10/0, docs/GOTCHAS.md 8/0), one commit, not pushed; rails self-check → internal/clan/surveys_test.go is additions only (30/0), zero removed lines anywhere in the diff, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260908T112826Z on matou-workstation.

## The failure Drive `20260908T112826Z` (drive 8, #1277, on `a948f6ed`): 21 legs green — `deploy-surveys` switched clean at last, #1318's eval repair and #1319's unit repair both holding — and red at `surveys-healthy`, the very next leg. ``` surveys service is not healthy after 360s of warm-up re-probe (#556): Surveys is not serving — LimeSurvey could not capture and keep a response through its public form — this service is not doing its job ``` Nothing looked broken. `logs/guest-failed-units.log` reports "0 loaded units listed"; `logs/guest-caddy.log` logs no error for the surveys host; the control plane re-probed 36 times plus the re-probe loop with one unchanging fault (`logs/guest-control-plane.log:129-200`): ``` limesurvey remotecontrol (get_session_key): could not decode the reply: unexpected end of JSON input ``` The very first RPC call of the gate — every later call is unreachable behind it. ## Evidence The surveys port's health gate (ADR 0062 part 3) drives LimeSurvey's whole capture-and-keep loop over the RemoteControl 2 JSON-RPC API at `/index.php/admin/remotecontrol` — `control-plane/cmd/control-plane/surveyshealth.go:65` (the path) and `:161` (`get_session_key`). That is the mechanism `STATUS.md:186` records as the landed #1150 design. LimeSurvey ships that interface **off**: `application/config/config-defaults.php:642` sets `$config['RPCInterface'] = 'off'`, and `internal/clan/surveys.go` never set it (verified against the pinned package source, `limesurvey-6.15.14+250924`). Off is not a refusal, which is exactly why it was invisible. `application/controllers/admin/RemoteControl.php:39-69`, on a POST, dispatches only when the type is `'xml'` or `'json'`; every other value falls straight through to `Yii::app()->session->destroy(); exit;` and echoes **nothing**. So an off interface is an HTTP **200 with a zero-byte body** — not the 403/404 the check would have surfaced as `HTTP 403`. `surveysRPC` gates on the status code *before* decoding (`surveyshealth.go:315-325`), so the honest-looking 200 carried the fault all the way to `json.Unmarshal` — and `json.Unmarshal` on zero bytes is precisely `unexpected end of JSON input`. The request shape was never at fault: `LSjsonRPCServer::handle` wants a POST with `Content-Type: application/json` and `{method, params, id}`, which is exactly what `surveysRPC` sends (`surveyshealth.go:301-309`). ## The suspected layer The declarative render, `internal/clan/surveys.go` — the third contract layer of a catalogue port, under the two already learned: - **#191 (GOTCHAS)** — the upstream module's OPTIONS, proven by the eval smoke. - **#192 (GOTCHAS)** — the runtime environment of the units the port adds itself. - **this one** — the upstream APPLICATION's own feature switches. Any capability the port's gate or reconciler speaks must be explicitly enabled in the app's config, because upstreams ship remote-control and API surfaces off by default, and neither `nix eval` nor a green switch can see it. ## The repair `RPCInterface = "json"` nested at `config.config`: `LSYii_Application::setConfigs` (`application/core/LSYii_Application.php:166-179`) merges `$userConfigs['config']` over the defaults, so a top-level key is silently ignored — #1318's lesson, one layer up. The JSON dialect only, with the API-publishing key left unset so the GET listing of every admin method stays off, and every method still demands the same admin credential the already-served admin UI takes. Recorded as GOTCHAS #194. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) **Mechanical repair, not a design decision.** #1150 already ruled RemoteControl 2 as the surveys port's mechanism — `STATUS.md:186` records part (3) of the landed port as "LimeSurvey's whole capture-and-keep loop over RemoteControl 2 + the public form", and `surveyshealth.go` is built entirely on it. The render simply omitted the switch that makes the already-landed design true. This makes the code do what it already meant; it does not decide anything new. It is the same class as my two prior heals in this series (#1319 render-vs-nixpkgs drift, #1320 readiness gate), one layer further up. **Not a security-posture change in substance.** The bounded delta: RC2 rides the same host and the same `/index.php/admin/…` prefix as LimeSurvey's already-served admin UI, and takes the same admin credential (`get_session_key` demands user+password; every other method demands a session key). No new credential class, no new trust boundary, nothing a community sees changes. The API-publishing key is left unset so the GET introspection listing of every admin method stays off. On the public path the whole surveys route already sits behind the front door's `forward_auth` gate (`internal/clan/frontdoor.go:454-485`) with no exempt paths declared for surveys; on this drive's private path every service route is ungated by design (ADR 0150, `renderPrivateRoute`). **Two-way door — revertible how:** deleting the single rendered line `{ RPCInterface = "json"; }` in `renderLimeSurveyDaemon` (`internal/clan/surveys.go`) restores the previous bytes exactly. The module is re-rendered from the live set and re-deployed on every drive, so a later commit reverts it with no migration and no residue. **Proven by which test:** `TestRenderSurveys_RemoteControlJSONInterfaceIsEnabled` (`internal/clan/surveys_test.go`), written red-first — it pins both the switch AND its nesting under `config.config` (a top-level key would be silently ignored), and requires the XML dialect and the API-publishing key to stay off. Beyond the seam test, the existing real-nixpkgs eval smoke `TestSurveysCohost_EvalSmoke` passes, and I decoded the built artifact: the evaluated gateway's `config.php` derivation carries `"config":{"RPCInterface":"json"}` — the value is really reaching the deployed file, not just the render's string. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260908T112826Z` red at `surveys-healthy` (sig 9ea63fb93ac3) — self-fixed on the fast lane, commit `62f097938765d38e9e20612ad00a9703bf801442`; checks: targeted (red-first): `go test ./internal/clan/ -run TestRenderSurveys_RemoteControlJSONInterfaceIsEnabled -v` → FAIL before the fix (`surveys_test.go:191: LimeSurvey's RemoteControl JSON-RPC interface must be enabled — the port's own health gate speaks it, and LimeSurvey ships it off (answering an empty 200)`), PASS after. package: `go test ./internal/clan/` → ok (17.999s), all 11 `TestRenderSurveys_*` PASS. trees: `go test ./internal/... ./control-plane/...` → no failures. real-nixpkgs eval smoke: `IDSS_EVAL_SMOKE=1 go test ./internal/clan/ -run TestSurveysCohost_EvalSmoke -v` → PASS (26.98s) — positive half evaluated the co-hosted gateway to `/nix/store/ik6mywa8pbhqxi5kz1annh5sjlk3n5sr-nixos-system-gateway-26.11.20260612.173d0ad.drv`, teeth half still fails on the phantom `uploadsDir` as it should. built-artifact check on that drv: decoded its `config.php` derivation (`g8r8paiis1rhn2aqixvz5lc8wz41rwmw-config.php.drv`) → `config.config` carries `RPCInterface = "json"`, and the API-publishing key is absent. root-cause verified against the pinned package source (realized `/nix/store/rs1f1f5smj81i1x4vv2578aqijwd0r4q-source`, limesurvey-6.15.14+250924): `config-defaults.php:642` = `'off'`; `RemoteControl.php:39-69` echoes nothing unless xml/json; `LSjsonRPCServer.php` accepts exactly the request shape `surveysRPC` sends. `go build ./...` → clean; `gofmt -l internal/clan/` → clean; `go vet ./internal/clan/` → clean. Commit shape: 3 files, 18 changed non-test lines (`internal/clan/surveys.go` 10/0, `docs/GOTCHAS.md` 8/0), one commit, not pushed; rails self-check → `internal/clan/surveys_test.go` is additions only (30/0), zero removed lines anywhere in the diff, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T112826Z` on matou-workstation. <!-- rehearsal-sig: 9ea63fb93ac3 -->
Author
Member

close-report for #1321 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1321,
  "status": "success",
  "commits": [
    "62f097938765d38e9e20612ad00a9703bf801442"
  ],
  "changed_files": [
    "docs/GOTCHAS.md",
    "internal/clan/surveys.go",
    "internal/clan/surveys_test.go"
  ],
  "tests": [
    {
      "command": "targeted (red-first): `go test ./internal/clan/ -run TestRenderSurveys_RemoteControlJSONInterfaceIsEnabled -v` → FAIL before the fix (`surveys_test.go:191: LimeSurvey's RemoteControl JSON-RPC interface must be enabled — the port's own health gate speaks it, and LimeSurvey ships it off (answering an empty 200)`), PASS after. package: `go test ./internal/clan/` → ok (17.999s), all 11 `TestRenderSurveys_*` PASS. trees: `go test ./internal/... ./control-plane/...` → no failures. real-nixpkgs eval smoke: `IDSS_EVAL_SMOKE=1 go test ./internal/clan/ -run TestSurveysCohost_EvalSmoke -v` → PASS (26.98s) — positive half evaluated the co-hosted gateway to `/nix/store/ik6mywa8pbhqxi5kz1annh5sjlk3n5sr-nixos-system-gateway-26.11.20260612.173d0ad.drv`, teeth half still fails on the phantom `uploadsDir` as it should. built-artifact check on that drv: decoded its `config.php` derivation (`g8r8paiis1rhn2aqixvz5lc8wz41rwmw-config.php.drv`) → `config.config` carries `RPCInterface = \"json\"`, and the API-publishing key is absent. root-cause verified against the pinned package source (realized `/nix/store/rs1f1f5smj81i1x4vv2578aqijwd0r4q-source`, limesurvey-6.15.14+250924): `config-defaults.php:642` = `'off'`; `RemoteControl.php:39-69` echoes nothing unless xml/json; `LSjsonRPCServer.php` accepts exactly the request shape `surveysRPC` sends. `go build ./...` → clean; `gofmt -l internal/clan/` → clean; `go vet ./internal/clan/` → clean. Commit shape: 3 files, 18 changed non-test lines (`internal/clan/surveys.go` 10/0, `docs/GOTCHAS.md` 8/0), one commit, not pushed; rails self-check → `internal/clan/surveys_test.go` is additions only (30/0), zero removed lines anywhere in the diff, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit 62f097938765d38e9e20612ad00a9703bf801442"
  },
  "summary": "The surveys health gate drives LimeSurvey's RemoteControl 2 JSON-RPC API, but the render never enabled it — LimeSurvey ships `RPCInterface = 'off'`, and off echoes nothing on a POST (empty HTTP 200), so every probe died on `unexpected end of JSON input`; added `RPCInterface = \"json\"` nested at `config.config` where LimeSurvey reads its settings.",
  "blockers": []
}
**close-report** for #1321 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1321, "status": "success", "commits": [ "62f097938765d38e9e20612ad00a9703bf801442" ], "changed_files": [ "docs/GOTCHAS.md", "internal/clan/surveys.go", "internal/clan/surveys_test.go" ], "tests": [ { "command": "targeted (red-first): `go test ./internal/clan/ -run TestRenderSurveys_RemoteControlJSONInterfaceIsEnabled -v` → FAIL before the fix (`surveys_test.go:191: LimeSurvey's RemoteControl JSON-RPC interface must be enabled — the port's own health gate speaks it, and LimeSurvey ships it off (answering an empty 200)`), PASS after. package: `go test ./internal/clan/` → ok (17.999s), all 11 `TestRenderSurveys_*` PASS. trees: `go test ./internal/... ./control-plane/...` → no failures. real-nixpkgs eval smoke: `IDSS_EVAL_SMOKE=1 go test ./internal/clan/ -run TestSurveysCohost_EvalSmoke -v` → PASS (26.98s) — positive half evaluated the co-hosted gateway to `/nix/store/ik6mywa8pbhqxi5kz1annh5sjlk3n5sr-nixos-system-gateway-26.11.20260612.173d0ad.drv`, teeth half still fails on the phantom `uploadsDir` as it should. built-artifact check on that drv: decoded its `config.php` derivation (`g8r8paiis1rhn2aqixvz5lc8wz41rwmw-config.php.drv`) → `config.config` carries `RPCInterface = \"json\"`, and the API-publishing key is absent. root-cause verified against the pinned package source (realized `/nix/store/rs1f1f5smj81i1x4vv2578aqijwd0r4q-source`, limesurvey-6.15.14+250924): `config-defaults.php:642` = `'off'`; `RemoteControl.php:39-69` echoes nothing unless xml/json; `LSjsonRPCServer.php` accepts exactly the request shape `surveysRPC` sends. `go build ./...` → clean; `gofmt -l internal/clan/` → clean; `go vet ./internal/clan/` → clean. Commit shape: 3 files, 18 changed non-test lines (`internal/clan/surveys.go` 10/0, `docs/GOTCHAS.md` 8/0), one commit, not pushed; rails self-check → `internal/clan/surveys_test.go` is additions only (30/0), zero removed lines anywhere in the diff, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit 62f097938765d38e9e20612ad00a9703bf801442" }, "summary": "The surveys health gate drives LimeSurvey's RemoteControl 2 JSON-RPC API, but the render never enabled it — LimeSurvey ships `RPCInterface = 'off'`, and off echoes nothing on a POST (empty HTTP 200), so every probe died on `unexpected end of JSON input`; added `RPCInterface = \"json\"` nested at `config.config` where LimeSurvey reads its settings.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1321
No description provided.