Skip to content
Latchkey

GitHub Actions "The self-hosted runner lost connection"

The self-hosted runner stopped responding to GitHub during a job, so the service marked it disconnected and the job failed; the host itself is usually the problem, not your workflow.

What this error means

A running job fails when the self-hosted runner drops offline, and the Runners page shows the runner as Offline. The job log often ends mid-step with no command error.

github-actions
The self-hosted runner: my-runner-3 lost connection with the server.

Common causes

Host network instability

Flaky egress, VPN drops, or DNS failures on the host severed the runner's persistent connection to GitHub.

Host resource exhaustion

The runner process was starved by an out-of-memory condition or full disk and could no longer maintain the connection.

How to fix it

Stabilize the host

  1. Check host network egress and DNS to github.com and the Actions endpoints.
  2. Confirm the host had free memory and disk during the job.
  3. Restart the runner service and verify it reconnects as Idle.
  4. Re-run the job once the runner is healthy.

Offload to auto-retrying managed runners

Latchkey managed runners auto-retry transient infrastructure failures and run on monitored, right-sized hosts, so a flaky self-hosted box does not fail your builds, at roughly 70% less than GitHub-hosted.

How to prevent it

  • Monitor self-hosted host network and resource health.
  • Keep runners off memory and disk limits.
  • Alert when a runner flips Offline unexpectedly.

Frequently asked questions

What causes ""Self-hosted lost connection""?
Flaky egress, VPN drops, or DNS failures on the host severed the runner's persistent connection to GitHub.
How do I fix "Self-hosted lost connection"?
Stabilize the host

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card