Skip to content
Latchkey

GitHub Actions "The hosted runner lost communication with the server"

The runner stopped exchanging heartbeats with GitHub during the job, so the backend declared the connection lost and failed the run even though your steps may have been healthy.

What this error means

A job fails partway through with "The hosted runner: <name> lost communication with the server." Logs may cut off mid-step with no error from the command itself.

github-actions
The hosted runner: GitHub Actions 12 lost communication with the server. Verify the machine is running and has a healthy network connection.

Common causes

Transient network or backend blip

A brief connectivity loss between the runner and GitHub services dropped the heartbeat long enough to trip the lost-communication threshold.

Runner host became unhealthy

Memory pressure, CPU starvation, or disk exhaustion on the host stalled the agent so it could not send heartbeats.

How to fix it

Re-run and isolate the cause

  1. Re-run the failed job; transient drops usually clear on retry.
  2. Check the step running at the cut-off for memory or disk pressure.
  3. For self-hosted, verify host network stability and egress.
  4. Add timeout-minutes so a hung job fails predictably.

Use auto-retrying managed runners

Latchkey managed runners auto-retry transient infrastructure failures like a lost connection and run on right-sized, monitored capacity, so a one-off network blip is retried instead of failing the build, at roughly 69% less than GitHub-hosted.

How to prevent it

  • Treat isolated lost-communication failures as retryable.
  • Keep runner hosts off memory and disk limits that stall the agent.
  • Monitor host network health for self-hosted fleets.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →