portal-member: files door reads RESTING — monitor's 5-min paced check holds a stale down #1478

Closed
opened 2026-09-14 22:18:01 +00:00 by matou-build-agent · 3 comments

The failure

portal-member is the only red leg (verdict.json: "legs":{"total":27,"green":26,"red":1,"skip":0}, "firstRedLeg":"portal-member"). The member signs in fine, is greeted by the right display name, and the files service card is on the home — but its pill says RESTING where the leg requires OPEN:

Locator:  locator('[data-field="service-card"][data-door="files"]').locator('[data-field="pill"]')
Expected: "open"
Received: "resting"
Timeout:  30000ms
  64 × locator resolved to <span data-field="pill" ... data-status="resting" class="oc-door-card__pill">RESTING</span>

(artifacts/legs.json, artifacts/journey.json, .../error-context.md; asserted at app/tests/e2e/fixtures/portalJourney.ts:295.)

This is not the known frontier. The paragraph names pairing-never-flips as the KNOWN red; pair is green this run ({"leg":"pair","status":"green","ms":320}), and legs.json carries no skip reasons at all — skip: 0, no leg has a reason field. Nothing in this drive's own records scopes this red out.

What the evidence shows

The live box (still up, ssh answered) settles it. Its activity feed records both truths and the gap between them:

22:05:59.380  monitoring  critical  "Files & documents down on gateway — Files & documents is not
                                     serving — Nextcloud reports it is not ready"
22:08:13.812  devices     installed "files installed on gateway"
22:10:59.383  monitoring  info      "Files back up"

The droplet journal shows provisioning's own deploy-time probe passing at the same instant as the installed event:

Sep 14 22:08:13 gateway idss-control-plane-start[2928]: msg="service health probe"
  service=files node=gateway attempt=1 attempts=36 verdict=healthy

And the member's sign-in is stamped in logs/droplet-journal.txt inside the bad window:

Sep 14 22:08:52 kanidmd: Initiating Authentication Session | username: e2e-portal-member
Sep 14 22:08:54 kanidmd: Issuing Cookie session ... for e2e-portal-member@id.rehearsal-g.idss.nz

So: monitoring's critical files down alert stood from 22:05:59 to 22:10:59 — exactly 300s — and portal-member ran 22:08:49.5 → 22:09:26.2 (from verdict.json endedAt minus the leg's 36692 ms), wholly inside it. Meanwhile the operator-side files-healthy leg went green at ~22:08:24 off provisioning's probe, 2m46s before monitoring agreed.

By the time I read the box the alert had cleared, which is why the live reads look innocent:

/api/v1/monitor/status  → {"services":[{"service":"files","label":"Files","up":true,"runs_on":["gateway"]}]}
/api/v1/monitor/alert-count → {"count":2,"severity":"warning"}   # no critical
systemctl --failed → (empty); nextcloud/phpfpm/nginx NRestarts=0

Why RESTING follows

The door's standing has exactly one input — the monitor's service pill:

  • internal/monitor/status.go:312 — p := ServicePill{... Up: !downBy[slug] ...}, where downBy is built only from standing critical alerts.
  • internal/controlapi/me_doors.go — if s.Healthy { d.Standing = DoorStandingOpen; d.URL = s.URL }, else DoorStandingResting; liveDoors.LiveServices sets Healthy: p.Up.
  • control-plane/cmd/control-plane/main.go:1636 — NewLiveDoors(c.mon, apex, productionWebPort(log)).

A standing critical files down alert therefore forces standing:"resting" on /api/v1/me/doors, and dashboard/src/lib/api/portalClient.ts maps anything ≠ open to resting. The card was drawn (placement present) but doorless — exactly what the screenshot HTML shows.

The alert stood for a full cadence because the probe is paced and its verdict cached:

  • internal/monitor/monitor.go:86 — const CheckInterval = 5 * time.Minute
  • pacedCheck (monitor.go:614) returns last.summary, last.down while now.Sub(last.at) < o.checkEvery
  • invalidateCheck (monitor.go:636) exists precisely to drop that cache — and its only caller in the tree is internal/monitor/respond.go:307 (the heal ladder). Nothing on the provisioning go-active path calls it.

So a service that goes live re-probes no sooner than 5 minutes later, and for that whole window the Portal tells the member a live service is RESTING while the operator's own screens call it healthy.

Suspected layer

Product (control-plane), with a harness aggravator.

  • Product: the member-visible lie is real, not a test artifact. A community co-hosting files sees RESTING on the member home for up to 5 minutes after the service is genuinely serving. Provisioning's successful activation is the event that should invalidate monitoring's cached down verdict; it doesn't.
  • Harness: the drive asserts immediately after deploy with a 30 s Playwright timeout, and PortalSurface reads /me/doors once per check() while dashboard/src/entry/portal.ts:67 polls at DEFAULT_POLL_MS = 60_000. The 30 s wait cannot outlive even one poll — hence 64 × locator resolved to the same unchanged element. The timeout was never going to absorb the lag.

What plugging it needs

  1. Primary fix (product): on a service's successful go-active, invalidate the monitor's cached check for that (device, service) so the next 30 s aggregation tick re-probes and clears the stale critical. invalidateCheck already does this for the heal ladder; it needs an exported seam the provisioning/activation path calls at the same point that emits files installed on gateway. That closes the 5-minute disagreement at its source and makes the two health truths converge within one tick.
  2. Secondary (harness, do not do alone): once (1) lands, the leg passes on its own. If the leg is hardened anyway, it should reload the home rather than wait on a static DOM — a 30 s toHaveAttribute against a page that refetches at 60 s is a cannot-succeed wait, and masking (1) with a >5 min timeout would keep a member-visible defect green.

Absent from this run's evidence

  • logs/founding-state.log and logs/state-logs.log are harvest errors, not data: cat .../state/founding-state.json: No such file or directory and no state logs directory at .../state/logs.
  • artifacts/host.json records "qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT" — expected for the droplet target, not a fault.
  • trace.zip does not cover the failing browser: assertPortalMemberJourney launches its own chromium.launch(), so the trace's two contexts hold only the operator/Nextcloud pages, and the auto-attached test-failed-*.png are the electron helper and Nextcloud's first-run modal — no screenshot of the member home exists (the leg's own screenshot is written after the failing assertion). The member's /me/doors response body is therefore not captured anywhere in the run directory; the diagnosis above rests on the live box's activity feed instead.
  • No sign-in or other mutating command was run against the box — only reads.

drive 20260914T214850Z red at portal-member: expect(locator).toHaveAttribute(expected) failed Locator: locator('[data-field="service-card"][data-door="files"]').locator('[data-field="pill"]') Expected: "open" Received: "resting" Timeout: 30000ms
evidence: /home/swarm/session-runner/idss/test-results/drive-droplet/20260914T214850Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure `portal-member` is the only red leg (`verdict.json`: `"legs":{"total":27,"green":26,"red":1,"skip":0}`, `"firstRedLeg":"portal-member"`). The member signs in fine, is greeted by the right display name, and the files service card **is** on the home — but its pill says RESTING where the leg requires OPEN: ``` Locator: locator('[data-field="service-card"][data-door="files"]').locator('[data-field="pill"]') Expected: "open" Received: "resting" Timeout: 30000ms 64 × locator resolved to <span data-field="pill" ... data-status="resting" class="oc-door-card__pill">RESTING</span> ``` (`artifacts/legs.json`, `artifacts/journey.json`, `.../error-context.md`; asserted at `app/tests/e2e/fixtures/portalJourney.ts:295`.) **This is not the known frontier.** The paragraph names pairing-never-flips as the KNOWN red; `pair` is **green** this run (`{"leg":"pair","status":"green","ms":320}`), and `legs.json` carries **no skip reasons at all** — `skip: 0`, no leg has a `reason` field. Nothing in this drive's own records scopes this red out. ## What the evidence shows The live box (still up, ssh answered) settles it. Its activity feed records both truths and the gap between them: ``` 22:05:59.380 monitoring critical "Files & documents down on gateway — Files & documents is not serving — Nextcloud reports it is not ready" 22:08:13.812 devices installed "files installed on gateway" 22:10:59.383 monitoring info "Files back up" ``` The droplet journal shows provisioning's own deploy-time probe passing at the same instant as the `installed` event: ``` Sep 14 22:08:13 gateway idss-control-plane-start[2928]: msg="service health probe" service=files node=gateway attempt=1 attempts=36 verdict=healthy ``` And the member's sign-in is stamped in `logs/droplet-journal.txt` inside the bad window: ``` Sep 14 22:08:52 kanidmd: Initiating Authentication Session | username: e2e-portal-member Sep 14 22:08:54 kanidmd: Issuing Cookie session ... for e2e-portal-member@id.rehearsal-g.idss.nz ``` So: monitoring's critical `files down` alert stood from **22:05:59 to 22:10:59 — exactly 300s** — and `portal-member` ran **22:08:49.5 → 22:09:26.2** (from `verdict.json` `endedAt` minus the leg's 36692 ms), wholly inside it. Meanwhile the operator-side `files-healthy` leg went green at ~22:08:24 off provisioning's probe, 2m46s before monitoring agreed. By the time I read the box the alert had cleared, which is why the live reads look innocent: ``` /api/v1/monitor/status → {"services":[{"service":"files","label":"Files","up":true,"runs_on":["gateway"]}]} /api/v1/monitor/alert-count → {"count":2,"severity":"warning"} # no critical systemctl --failed → (empty); nextcloud/phpfpm/nginx NRestarts=0 ``` ## Why RESTING follows The door's standing has exactly one input — the monitor's service pill: - `internal/monitor/status.go:312` — `p := ServicePill{... Up: !downBy[slug] ...}`, where `downBy` is built only from **standing critical alerts**. - `internal/controlapi/me_doors.go` — `if s.Healthy { d.Standing = DoorStandingOpen; d.URL = s.URL }`, else `DoorStandingResting`; `liveDoors.LiveServices` sets `Healthy: p.Up`. - `control-plane/cmd/control-plane/main.go:1636` — `NewLiveDoors(c.mon, apex, productionWebPort(log))`. A standing critical `files down` alert therefore forces `standing:"resting"` on `/api/v1/me/doors`, and `dashboard/src/lib/api/portalClient.ts` maps anything ≠ `open` to `resting`. The card was drawn (placement present) but doorless — exactly what the screenshot HTML shows. The alert stood for a full cadence because the probe is paced and its verdict cached: - `internal/monitor/monitor.go:86` — `const CheckInterval = 5 * time.Minute` - `pacedCheck` (`monitor.go:614`) returns `last.summary, last.down` while `now.Sub(last.at) < o.checkEvery` - `invalidateCheck` (`monitor.go:636`) exists precisely to drop that cache — and its **only** caller in the tree is `internal/monitor/respond.go:307` (the heal ladder). Nothing on the provisioning go-active path calls it. So a service that goes live re-probes no sooner than 5 minutes later, and for that whole window the Portal tells the member a live service is RESTING while the operator's own screens call it healthy. ## Suspected layer **Product (control-plane), with a harness aggravator.** - *Product:* the member-visible lie is real, not a test artifact. A community co-hosting files sees RESTING on the member home for up to 5 minutes after the service is genuinely serving. Provisioning's successful activation is the event that should invalidate monitoring's cached down verdict; it doesn't. - *Harness:* the drive asserts immediately after deploy with a 30 s Playwright timeout, and `PortalSurface` reads `/me/doors` once per `check()` while `dashboard/src/entry/portal.ts:67` polls at `DEFAULT_POLL_MS = 60_000`. The 30 s wait cannot outlive even one poll — hence `64 × locator resolved to` the *same unchanged element*. The timeout was never going to absorb the lag. ## What plugging it needs 1. **Primary fix (product):** on a service's successful go-active, invalidate the monitor's cached check for that `(device, service)` so the next 30 s aggregation tick re-probes and clears the stale critical. `invalidateCheck` already does this for the heal ladder; it needs an exported seam the provisioning/activation path calls at the same point that emits `files installed on gateway`. That closes the 5-minute disagreement at its source and makes the two health truths converge within one tick. 2. **Secondary (harness, do not do alone):** once (1) lands, the leg passes on its own. If the leg is hardened anyway, it should reload the home rather than wait on a static DOM — a 30 s `toHaveAttribute` against a page that refetches at 60 s is a cannot-succeed wait, and masking (1) with a >5 min timeout would keep a member-visible defect green. ## Absent from this run's evidence - `logs/founding-state.log` and `logs/state-logs.log` are harvest errors, not data: `cat .../state/founding-state.json: No such file or directory` and `no state logs directory at .../state/logs`. - `artifacts/host.json` records `"qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT"` — expected for the droplet target, not a fault. - `trace.zip` does **not** cover the failing browser: `assertPortalMemberJourney` launches its own `chromium.launch()`, so the trace's two contexts hold only the operator/Nextcloud pages, and the auto-attached `test-failed-*.png` are the electron helper and Nextcloud's first-run modal — no screenshot of the member home exists (the leg's own screenshot is written *after* the failing assertion). The member's `/me/doors` response body is therefore not captured anywhere in the run directory; the diagnosis above rests on the live box's activity feed instead. - No sign-in or other mutating command was run against the box — only reads. drive `20260914T214850Z` red at `portal-member`: `expect(locator).toHaveAttribute(expected) failed Locator: locator('[data-field="service-card"][data-door="files"]').locator('[data-field="pill"]') Expected: "open" Received: "resting" Timeout: 30000ms` evidence: `/home/swarm/session-runner/idss/test-results/drive-droplet/20260914T214850Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 2e161898384a -->
Author
Member

swarm-claim host=matou-dev-server-01 run=24113
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=24113 (automated multi-host claim — lowest live claim id works this ticket)
Owner

A consideration for whoever picks this up (Ben's Portal session, 2026-09-14) — not a ruling.

The diagnosis above is right and complete. I checked it against the same drive's evidence: provisioning's deploy probe passed at 22:08:13, the monitor's critical alert stood from 22:05:59 to 22:10:59, and portal-member ran from 22:08:49 to 22:09:26, inside that window.

Please do not fix this in the harness alone. A leg that simply waits out the monitor's five-minute cycle would go green and hide a real member-facing wart. The drive is doing exactly what a member does: signing in to the Portal right after a service lands. For up to five minutes that member sees a working service drawn as resting, with no address and no Open button. DDR 0232 decision 6 says a resting card means the service is actually failing its health check. Here it is serving fine, and the monitor has not caught up.

Shapes worth weighing, all product-side:

  • Let a fresh healthy verdict clear the standing down, so a deploy's own passing probe ends the critical alert instead of waiting for the next paced tick.
  • Have the monitor re-probe immediately when a service finishes installing, rather than on its fixed five-minute clock.
  • Keep the doors route's "one truth" (ADR 0233 §3), but make the truth current.

A harness wait is reasonable as well, as long as it is not the only change.

For the Portal arc: this is the last blocker on #1373, which is the last ticket on map #1336. The drive went 26 of 27 green twice today, and both reds were on the member-journey leg.

**A consideration for whoever picks this up (Ben's Portal session, 2026-09-14) — not a ruling.** The diagnosis above is right and complete. I checked it against the same drive's evidence: provisioning's deploy probe passed at 22:08:13, the monitor's critical alert stood from 22:05:59 to 22:10:59, and `portal-member` ran from 22:08:49 to 22:09:26, inside that window. **Please do not fix this in the harness alone.** A leg that simply waits out the monitor's five-minute cycle would go green and hide a real member-facing wart. The drive is doing exactly what a member does: signing in to the Portal right after a service lands. For up to five minutes that member sees a working service drawn as **resting**, with no address and no Open button. DDR 0232 decision 6 says a resting card means the service is actually failing its health check. Here it is serving fine, and the monitor has not caught up. Shapes worth weighing, all product-side: - Let a **fresh healthy verdict** clear the standing down, so a deploy's own passing probe ends the critical alert instead of waiting for the next paced tick. - Have the monitor **re-probe immediately** when a service finishes installing, rather than on its fixed five-minute clock. - Keep the doors route's "one truth" (ADR 0233 §3), but make the truth current. A harness wait is reasonable as well, as long as it is not the only change. For the Portal arc: this is the last blocker on #1373, which is the last ticket on map #1336. The drive went 26 of 27 green twice today, and both reds were on the member-journey leg.
Author
Member

close-report for #1478 — status success

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

envelope
{
  "issue": 1478,
  "status": "success",
  "commits": [
    "7ca139a789d57c4e359129aee393698940a120d2"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/monitor/monitor.go",
    "internal/monitor/monitor_test.go",
    "internal/monitor/respond.go",
    "internal/provision/health.go",
    "internal/provision/health_test.go",
    "internal/provision/provision.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/monitor/ ./internal/provision/ -count=1",
      "exit_code": 0
    },
    {
      "command": "go build ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/monitor/ ./internal/provision/ ./control-plane/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Primary fix (product): on a service's successful go-active, invalidate the monitor's cached check for that (device, service)": "internal/provision/health.go healthGate + RetryService call o.healthCache.InvalidateCheck for each healthy service; internal/monitor/monitor.go exports InvalidateCheck; control-plane/.../whole_composition.go wires pv.SetHealthCacheInvalidator(mon)",
    "The next 30s aggregation tick re-probes and clears the stale critical (two health truths converge within one tick)": "TestInvalidateCheck_GoActiveClearsAStaleDownWithinATick (internal/monitor/monitor_test.go): under the production CheckInterval cadence a cached down still stands on an in-cadence tick, then clears on the tick after InvalidateCheck",
    "invalidateCheck gains an exported seam the provisioning/activation path calls at the same point that emits the installed event": "internal/monitor: invalidateCheck -> InvalidateCheck; internal/provision: HealthCacheInvalidator port + SetHealthCacheInvalidator, called in the go-active publish loop; TestDeploy_HealthyGoActiveInvalidatesMonitoringCache proves only the healthy files@totara is invalidated, not the failed backup-copy"
  },
  "summary": "A service's healthy go-active now drops monitoring's paced-check cache so the member's door clears from RESTING to OPEN within one aggregation tick instead of a whole 5-minute cadence.",
  "blockers": []
}
**close-report** for #1478 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1478, "status": "success", "commits": [ "7ca139a789d57c4e359129aee393698940a120d2" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/whole_composition.go", "internal/monitor/monitor.go", "internal/monitor/monitor_test.go", "internal/monitor/respond.go", "internal/provision/health.go", "internal/provision/health_test.go", "internal/provision/provision.go" ], "tests": [ { "command": "go test ./internal/monitor/ ./internal/provision/ -count=1", "exit_code": 0 }, { "command": "go build ./control-plane/...", "exit_code": 0 }, { "command": "go vet ./internal/monitor/ ./internal/provision/ ./control-plane/...", "exit_code": 0 } ], "criteria": { "Primary fix (product): on a service's successful go-active, invalidate the monitor's cached check for that (device, service)": "internal/provision/health.go healthGate + RetryService call o.healthCache.InvalidateCheck for each healthy service; internal/monitor/monitor.go exports InvalidateCheck; control-plane/.../whole_composition.go wires pv.SetHealthCacheInvalidator(mon)", "The next 30s aggregation tick re-probes and clears the stale critical (two health truths converge within one tick)": "TestInvalidateCheck_GoActiveClearsAStaleDownWithinATick (internal/monitor/monitor_test.go): under the production CheckInterval cadence a cached down still stands on an in-cadence tick, then clears on the tick after InvalidateCheck", "invalidateCheck gains an exported seam the provisioning/activation path calls at the same point that emits the installed event": "internal/monitor: invalidateCheck -> InvalidateCheck; internal/provision: HealthCacheInvalidator port + SetHealthCacheInvalidator, called in the go-active publish loop; TestDeploy_HealthyGoActiveInvalidatesMonitoringCache proves only the healthy files@totara is invalidated, not the failed backup-copy" }, "summary": "A service's healthy go-active now drops monitoring's paced-check cache so the member's door clears from RESTING to OPEN within one aggregation tick instead of a whole 5-minute cadence.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1478
No description provided.