GitHub Actions "lost communication" After Sleep/Idle on Self-Hosted Runner
A self-hosted runner job is canceled because the host went to sleep or suspended mid-job - a laptop lid close, an OS idle-sleep timer, or aggressive power management cut the runner's connection to GitHub.
What this error means
A job on a self-hosted runner stops with a lost-communication or canceled message after a stretch of inactivity, and the host turns out to have slept or suspended. Disabling sleep on the host fixes it.
The self-hosted runner: my-laptop-runner lost communication with the server.
The operation was canceled.Common causes
Host slept or suspended mid-job
An OS idle-sleep timer, a closed laptop lid, or a power-saving suspend pauses the runner process and breaks its heartbeat, so GitHub cancels the job.
Runner runs in a user session that locks
A runner started in an interactive session can be paused when the session locks or the user logs out, dropping the connection.
How to fix it
Disable sleep and run as a service
- Disable system sleep/suspend and lid-close sleep on the runner host.
- Install the runner as a service (svc.sh) so it survives logout and runs headless.
- Re-run the canceled job; the interruption is transient once power management is fixed.
Prefer always-on hosts for runners
Run self-hosted runners on always-on servers or VMs rather than laptops, so idle power management cannot interrupt jobs.
How to prevent it
- Disable sleep/suspend on self-hosted runner hosts.
- Install runners as a managed service, not in an interactive session.
- Use always-on machines for runners instead of laptops.