provision: service health check is one-shot and races co-host warm-up — Files stands FAILED seconds before nginx/fpm come ready (files-healthy red, drive 234251Z) #552

Closed
opened 2026-08-15 00:03:52 +00:00 by ben · 3 comments
Owner

What breaks

Drive 20260814T234251Z — the FIRST drive past the finish leg since the #547 cache-race fix — red at files-healthy: the S5 row stands Files & documents FAILED — Nextcloud reports it is not ready … status: could not assert anything about this response (empty or below the body-size floor).

Evidence it's a warm-up race, not a broken deploy

Droplet journal from the same run (the #536 harvest): nginx active 23:59:49, php-fpm ready to handle connections 00:00:01, brand applied 00:00:05 — the whole Files stack came up seconds after the check gave up (drive died ~23:59). systemctl --failed on the droplet: EMPTY. The product UI itself offers Retry Files & documents (RetryService, DDR 0157), which would have cleared it — the check is right that it saw nothing, and wrong to stop looking after one shot.

Cause

The app-side health check (internal/provision/health.go, nextcloudHealthCheck → GET files.<apex>/status.php) runs ONCE at deploy completion. A fresh co-host deploy always has a warm-up tail (php first-request compile, fpm pool start), so the one-shot check false-FAILs the row for real operators too — the e2e leg (expectFilesHealthy, provision.ts:352) just reads the row honestly.

Fix directed

Bounded re-probe in the app's service health check, ADR 0161 family / the door-probe shape: poll status.php until it asserts healthy or a warm-up budget (~3 min) expires; only then stand the row FAILED with Retry. Applies to the shared service-health path (all co-host services, not just files — same sweep #527/#528 mapped). Seam test: a check that fails N times then succeeds within budget must yield a healthy row; one that never succeeds must stand FAILED with the existing honest Detail (#536).

NOT the fix: pressing Retry from the e2e leg (masks the product race), or lengthening the leg timeout (the row has already stood FAILED — waiting longer changes nothing).

Context

Frontier tooth of #492 (phase-2 standing drive). Prior files-healthy reds had REAL causes (#527 exempt-path, #529 port collision, #536 silence — all landed); this one is the first where the droplet proves the service healthy seconds later. 171114Z's "layer-3 silence" may have been this same race before the #536 harvest existed to show it.

## What breaks Drive `20260814T234251Z` — the FIRST drive past the finish leg since the #547 cache-race fix — red at `files-healthy`: the S5 row stands `Files & documents FAILED — Nextcloud reports it is not ready … status: could not assert anything about this response (empty or below the body-size floor)`. ## Evidence it's a warm-up race, not a broken deploy Droplet journal from the same run (the #536 harvest): nginx active 23:59:49, php-fpm `ready to handle connections` 00:00:01, brand applied 00:00:05 — the whole Files stack came up seconds after the check gave up (drive died ~23:59). `systemctl --failed` on the droplet: EMPTY. The product UI itself offers `Retry Files & documents` (RetryService, DDR 0157), which would have cleared it — the check is right that it saw nothing, and wrong to stop looking after one shot. ## Cause The app-side health check (`internal/provision/health.go`, nextcloudHealthCheck → GET `files.<apex>/status.php`) runs ONCE at deploy completion. A fresh co-host deploy always has a warm-up tail (php first-request compile, fpm pool start), so the one-shot check false-FAILs the row for real operators too — the e2e leg (`expectFilesHealthy`, provision.ts:352) just reads the row honestly. ## Fix directed Bounded re-probe in the app's service health check, ADR 0161 family / the door-probe shape: poll `status.php` until it asserts healthy or a warm-up budget (~3 min) expires; only then stand the row FAILED with Retry. Applies to the shared service-health path (all co-host services, not just files — same sweep #527/#528 mapped). Seam test: a check that fails N times then succeeds within budget must yield a healthy row; one that never succeeds must stand FAILED with the existing honest Detail (#536). NOT the fix: pressing Retry from the e2e leg (masks the product race), or lengthening the leg timeout (the row has already stood FAILED — waiting longer changes nothing). ## Context Frontier tooth of #492 (phase-2 standing drive). Prior files-healthy reds had REAL causes (#527 exempt-path, #529 port collision, #536 silence — all landed); this one is the first where the droplet proves the service healthy seconds later. 171114Z's "layer-3 silence" may have been this same race before the #536 harvest existed to show it.
Author
Owner

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

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

swarm-claim host=elitebook-distributed-server-03 run=6479
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=6479 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #552 — status success

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

envelope
{
  "issue": 552,
  "status": "success",
  "commits": [
    "6e1e9db"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/provision/health.go",
    "internal/provision/health_test.go",
    "internal/provision/provision.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/provision/...",
      "exit_code": 0
    },
    {
      "command": "go test ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/provision/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/provision/... ./control-plane/cmd/control-plane/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A check that fails N times then succeeds within the warm-up budget yields a healthy row": "TestDeploy_WarmupReprobeYieldsAHealthyRow (internal/provision/health_test.go) — files fails 3 times then passes on the 4th within a 6-attempt budget, out.State==StateActive, files.Healthy with empty Failure/Detail, both services published; runCheck's warmup re-probe loop in internal/provision/health.go",
    "A check that never succeeds within budget stands FAILED with the existing honest Detail (#536)": "TestDeploy_WarmupExhaustedStandsFailedWithHonestDetail — files never ready across the 3-attempt budget → out.State==StateServiceFailed, files.Healthy false, files.Failure==port summary, files.Detail==the check's inner error, files.Retry set; runCheck falls through to the FAILED branch carrying lastErr as Detail",
    "Applies to the shared service-health path (all co-host services, not just files)": "The fix is in runCheck (internal/provision/health.go), the single per-service path healthGate calls for every selected service; production wires WithServiceWarmup once for the whole composition (control-plane/cmd/control-plane/{compose.go,main.go,whole_composition.go})",
    "Manual RetryService stays one-shot (not warm-up re-probed)": "TestRetryService_IsOneShotNotWarmupReprobed — RetryService calls runCheck with warmup=false so a failing check runs exactly once; verified the backup-copy check ran once on retry"
  },
  "summary": "The deploy-time service health check now re-probes each port's own check across a bounded ~3-minute warm-up budget before standing a row FAILED, so a fresh co-host's warm-up tail no longer false-FAILs the S5 row while a genuinely-dead service still reds with its honest Detail.",
  "blockers": []
}
**close-report** for #552 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 552, "status": "success", "commits": [ "6e1e9db" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/provision/health.go", "internal/provision/health_test.go", "internal/provision/provision.go" ], "tests": [ { "command": "go test ./internal/provision/...", "exit_code": 0 }, { "command": "go test ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go vet ./internal/provision/... ./control-plane/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/provision/... ./control-plane/cmd/control-plane/", "exit_code": 0 } ], "criteria": { "A check that fails N times then succeeds within the warm-up budget yields a healthy row": "TestDeploy_WarmupReprobeYieldsAHealthyRow (internal/provision/health_test.go) — files fails 3 times then passes on the 4th within a 6-attempt budget, out.State==StateActive, files.Healthy with empty Failure/Detail, both services published; runCheck's warmup re-probe loop in internal/provision/health.go", "A check that never succeeds within budget stands FAILED with the existing honest Detail (#536)": "TestDeploy_WarmupExhaustedStandsFailedWithHonestDetail — files never ready across the 3-attempt budget → out.State==StateServiceFailed, files.Healthy false, files.Failure==port summary, files.Detail==the check's inner error, files.Retry set; runCheck falls through to the FAILED branch carrying lastErr as Detail", "Applies to the shared service-health path (all co-host services, not just files)": "The fix is in runCheck (internal/provision/health.go), the single per-service path healthGate calls for every selected service; production wires WithServiceWarmup once for the whole composition (control-plane/cmd/control-plane/{compose.go,main.go,whole_composition.go})", "Manual RetryService stays one-shot (not warm-up re-probed)": "TestRetryService_IsOneShotNotWarmupReprobed — RetryService calls runCheck with warmup=false so a failing check runs exactly once; verified the backup-copy check ran once on retry" }, "summary": "The deploy-time service health check now re-probes each port's own check across a bounded ~3-minute warm-up budget before standing a row FAILED, so a fresh co-host's warm-up tail no longer false-FAILs the S5 row while a genuinely-dead service still reds with its honest Detail.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-15 00:32:59 +00:00
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.

Reference
Matou/idss#552
No description provided.