Skip to content

ci(docker): bound the Swarm smoke test and fix its hang: Studio over 127.0.0.1 (#306) - #308

Merged
Madraka merged 3 commits into
mainfrom
claude/swarm-smoke-306
Nov 28, 2026
Merged

Madraka merged 3 commits into
mainfrom
claude/swarm-smoke-306

Conversation

@Madraka

@Madraka Madraka commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #306.

Root cause

The diagnostics in run 46188727714 settle it:

Probe Result
/api/health inside the cloudhal container 200
The published port over 127.0.0.1 200
The published port over localhost 000, every time

curl's verbose output for localhost shows the mechanism:

  • localhost resolves to ::1 first;
  • curl logs Established connection to localhost (::1 port 58787);
  • no response ever comes.

The routing mesh publishes IPv4 only. On GitHub's runners (since the image change around 2026-11-23), a connection to [::1]:<port> is accepted and never answered, and because it connected, curl never falls back to IPv4. The script's Studio URL was http://localhost:$port; its site URL was already 127.0.0.1. So the first wait hung until the job's 90-minute timeout.

Change

  • scripts/swarm-smoke.sh:
    • Studio is now at http://127.0.0.1:$port, with the reason in a comment.
    • Every curl is bounded (--connect-timeout, --max-time), and every docker call runs under timeout.
    • The waits use wall-clock deadlines: 240 s for the stack and 120 s for the site's 503.
    • Progress prints the published port and an in-container probe.
    • On failure, fail prints the services, the tasks and logs of both services, the containers, per-container health, host listeners, the ingress network, versions, NAT rules, and a verbose curl over 127.0.0.1 and localhost.
  • .github/workflows/docker.yml: timeout-minutes 20 on the Swarm step, 20 on Helm and 15 on Trivy.
  • Docs: docs/guides/self-host.md and deploy/swarm/README.md now say: on the node itself, use 127.0.0.1, not localhost, with the reason.

Seen in the same log, not changed here

When the two instances start together, they race on a migration: 0004_audit_actor_name failed: duplicate column name: actor_name, logged as an uncaught exception on one instance, while the other applied it. That is an app issue in the self-host cluster's startup, reported separately.

CI only; nothing ran on a local Docker engine.

🤖 Generated with Claude Code

Madraka and others added 3 commits November 28, 2026 23:31
… fails

#306: `Build edge` has been cancelled at 90 min on every run since 2026-11-23, inside
`scripts/swarm-smoke.sh`. The cancelled job's log shows the step printed nothing (not even its
first "✓") and ends with "Terminate orphan process: (curl)": the first wait loop's
`curl -sf "$studio/api/health"` had no time limit and never returned, so Helm, Trivy, arm64 and
the edge tag never ran.

- Every curl is `--connect-timeout 5 --max-time 15`; every docker call runs under `timeout`
  (120 s; 30–60 s in cleanup); `docker stack deploy` shows its output and fails the run.
- The wait loop prints progress every 30 s (replicas, health code) and fails with them.
- `fail` prints services, the tasks and logs of both services (cloudhal and seaweedfs), the
  stack's containers, and a verbose bounded curl of /api/health over 127.0.0.1 and localhost.
- docker.yml: `timeout-minutes` 15 on the Swarm step, 20 on Helm, 15 on Trivy.

The root cause comes from this run's log; the fix follows in this PR.

Refs #306

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
…app from inside

Run 46186851063 (#308) narrowed #306: the stack reports replicas 2/2 from the first minute, but
/api/health on the published port never answers (curl 000 after 15 s) for the whole wait. The
wait loop's 90 tries of up to 18 s each outran the step's 15-minute timeout, so `fail` never
printed its state.

- The waits are wall-clock deadlines (240 s for the stack, 120 s for the site's 503) with short
  probes (connect 3 s, max 5 s), so `fail` always runs well inside the step's 20 minutes.
- Progress lines show the published port over localhost and 127.0.0.1 and /api/health from
  inside a cloudhal container (node fetch, bypassing the routing mesh): a stuck app and a port
  that is not forwarded look different.
- `fail` adds health inside each container, host listeners on the published ports, the ingress
  network, the docker/kernel/firewall versions and the NAT rules for the ports.

Refs #306

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
…lhost (#306)

Root cause, from run 46188727714's probes: the app answers /api/health inside its container
(200) and on the published port over 127.0.0.1 (200), but over `localhost` never (000). curl's
verbose output shows `localhost` resolving to ::1 first and "Established connection to localhost
(::1 port 58787)", then no reply: the routing mesh publishes IPv4 only, a connection to
[::1]:<port> is accepted on GitHub's runners and never answered, and since it connected, curl
never falls back to IPv4. The script's Studio URL was `http://localhost:$port` (its site URL was
already 127.0.0.1), so the first wait hung, unbounded until #308, from the runner image change
on 2026-11-23.

- scripts/swarm-smoke.sh: Studio at http://127.0.0.1:$port, with the reason; the progress line
  shows the published port and the in-container probe; the bounds and diagnostics stay.
- docs/guides/self-host.md and deploy/swarm/README.md: on the node itself use 127.0.0.1, not
  localhost, with the same reason.

Seen in the same log, not changed here: two instances starting together race on a migration
("0004_audit_actor_name failed: duplicate column name: actor_name"); reported separately.

Closes #306

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
@Madraka Madraka changed the title ci(docker): bound the Swarm smoke test and fix its hang (#306) ci(docker): bound the Swarm smoke test and fix its hang: Studio over 127.0.0.1 (#306) Nov 28, 2026
@Madraka
Madraka merged commit 631a504 into main Nov 28, 2026
12 checks passed
@Madraka
Madraka deleted the claude/swarm-smoke-306 branch November 28, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Docker image 'Build edge' hangs in the Swarm smoke test since 2026-11-23 (90-min timeout every run)

1 participant