Skip to content

fix(ci): add SSH keepalive to deploy-dev + deploy-prd ssh commands - #112

Merged
TaprootFreak merged 1 commit into
developfrom
fix/ssh-keepalive-deploy
May 25, 2026
Merged

fix(ci): add SSH keepalive to deploy-dev + deploy-prd ssh commands#112
TaprootFreak merged 1 commit into
developfrom
fix/ssh-keepalive-deploy

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Summary

Prevents the client_loop: send disconnect: Broken pipe exit-255 failure mode where docker compose recreate runs long enough that the cloudflared SSH tunnel (or OpenSSH client default) drops the idle session even though the host-side deploy is still running and the container ends up Up + healthy.

Observed on PR #111 merge auto-deploy (run 26419696840): SSH dropped mid-recreate, exit 255, container actually came up server-side — required a manual docker start + gh run rerun to mark the deploy green.

Fix

Add to both ssh invocations:

-o ServerAliveInterval=30
-o ServerAliveCountMax=8

= keepalive packet every 30s, 8 retries before declaring dead = 4 min of network silence tolerated. The deploy script's longest silent stretch (image pull + container recreate) is comfortably under that ceiling.

Files

  • .github/workflows/deploy-dev.yaml
  • .github/workflows/deploy-prd.yaml

Test plan

  • CI Lint & Build green
  • After merge: next push-to-develop's auto Deploy DEV completes without the broken-pipe pattern

deploy_dev_node + deploy_prd_node steps hit `client_loop: send
disconnect: Broken pipe` exit 255 when `docker compose recreate`
runs longer than the cloudflared tunnel's idle timeout (~60s with no
remote stdout). The host-side deploy script keeps running and the
container comes up correctly, but CI marks the step failed.

Add ServerAliveInterval=30 + ServerAliveCountMax=8 — keepalive every
30s, 8 retries before declaring dead = 4 min of network silence
tolerated. The deploy script's longest silent stretch (`docker
compose pull` of a fresh image + container recreate) is bounded by
the host's network + disk speed, comfortably under that ceiling.

Observed on the PR #111 merge auto-deploy: run 26419696840 failed
with the broken-pipe pattern, but ssh dfxdev-remote showed the
container was already `Up (healthy)` — purely a CI-side artefact.
@TaprootFreak
TaprootFreak merged commit 2e45c80 into develop May 25, 2026
7 checks passed
@TaprootFreak
TaprootFreak deleted the fix/ssh-keepalive-deploy branch May 25, 2026 21:18
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.

1 participant