The Runner Has Received a Shutdown Signal: Fix
Last updated
The runner has received a shutdown signal means the machine or service running your job was told to stop while the job was still running. On GitHub-hosted runners it is rare. On self-hosted runners it almost always means something outside the job stopped the runner: a spot instance reclaimed by the cloud, an autoscaler scaling down, a reboot, or a stopped service. This page shows how to tell which one it was and how to stop it recurring.
The exact message
Error: The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
Error: The operation was canceled.
The second line usually follows the first. If you only see The operation was canceled and the run was cancelled by a person or by a newer push, read The operation was canceled instead.
Causes, most likely first
1. Spot or preemptible instances were reclaimed
If your self-hosted runners run on spot, preemptible or low-priority VMs, the cloud can take the machine back at short notice, and the runner receives a shutdown while a job is running. Look in your cloud's event log for an interruption or termination event at the same time as the failure.
Fix: use on-demand instances for runners that run long jobs, or keep jobs short and safe to re-run. See spot instances for CI runners.
2. An autoscaler scaled the runner down while it was busy
Scale-down logic that removes idle runners by age or by count can remove one that has just picked up a job. With Actions Runner Controller (ARC), a pod can also be evicted or restarted during a node drain or an upgrade.
Fix: scale down only runners that report no job, use ephemeral runners (one job, then removed), and set pod disruption budgets and a termination grace period on ARC runner pods.
3. The runner service was stopped or the machine rebooted
Check the service on the runner host:
sudo ./svc.sh status
sudo journalctl -u 'actions.runner.*' --since "2 hours ago" | tail -50
last -x reboot shutdown | head
An unattended upgrade that reboots the host, a configuration tool that restarts the service, or someone pressing Ctrl+C in a manually started ./run.sh will all produce this error.
Fix: schedule reboots and upgrades for when the runner is drained, and run the runner as a service rather than from a terminal.
4. The host ran out of memory or disk
A host that is out of memory can kill the runner process itself. Check dmesg for Out of memory, and see hosted runner lost communication and exit code 137.
5. A GitHub-hosted runner was recycled
If you only use GitHub-hosted runners and no job of yours stopped the machine, this is an infrastructure fault. Check the GitHub status page and re-run the failed jobs.
Make the job survive a stop
You cannot stop a VM being reclaimed, but you can make the damage small. Keep each job short, save results and caches as you go, and make steps safe to repeat. A cleanup step that must always run should use if: always():
- name: Upload partial results
if: always()
uses: actions/upload-artifact@v4
with:
name: results-${{ matrix.shard }}
path: results/
How to prevent it
- Use ephemeral runners so a runner is created for one job and is not reused by a scale-down.
- Do not run long jobs on spot instances unless a re-run is cheap.
- Drain a runner (stop it taking new jobs) before maintenance, reboots or upgrades.
- Alert on runner service restarts and on cloud interruption events.
- Keep jobs short. Splitting a long job with a matrix shrinks what a single interruption costs.
FAQ
Is this error caused by my workflow?
Rarely. The message describes the runner being stopped from outside the job. A hung step is more likely to end in a timeout, not a shutdown signal.
Will GitHub retry the job automatically?
Not by default. You re-run the failed jobs yourself, or add your own retry logic around the work.
Does this happen on GitHub-hosted runners?
It can, but it is uncommon and usually tied to an incident. Check the status page, then re-run.
How is this different from exit code 143?
Exit code 143 is a process receiving SIGTERM. A shutdown signal on the runner often ends in 143 for the step that was running. See exit code 143.
Related
- Cache Service Responded With 429: FixFix "Failed to restore: Cache service responded with 429" in GitHub Actions: too many cache requests. Upgrade actions/cache, restore once, save once.
- fatal: could not read Username for github.com: FixFix "fatal: could not read Username for 'https://github.com'" in GitHub Actions: private repos, submodules and git dependencies need a token.
- Invalid Workflow File: YAML Syntax Error FixFix "Invalid workflow file" and "You have an error in your yaml syntax" in GitHub Actions: indentation, unexpected value, bad expressions, with actionlint.
- JavaScript Heap Out of Memory in GitHub Actions: FixFix "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory" and npm ENOMEM in GitHub Actions with NODE_OPTIONS.