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.
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
- Check host network egress and DNS to github.com and the Actions endpoints.
- Confirm the host had free memory and disk during the job.
- Restart the runner service and verify it reconnects as Idle.
- 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.