Home / Blog / Runners and limits
What does "Process completed with exit code 1" mean in GitHub Actions?
"Process completed with exit code 1" means a command in a run step failed. What exit codes 1, 2, 126, 127, 128, 130, 137, 143 and 255 mean, and what to do.
“Error: Process completed with exit code 1.” means a command in a run step exited with a status other than 0, so the runner failed the step. The number is the command’s own exit status, and 1 is the general one: the cause is in the log lines above the message. Other numbers say more. 127 is a command that was not found, 137 a process that was killed and 143 one that was terminated.
- The runner prints the line when a run step's script exits with any status but 0; the number is the command's own.
- A step with no shell key runs as bash -e, which stops at the first command that fails.
- 127 is a command not found, 126 one that is not executable, and 128 a fatal error from git.
- 130, 137 and 143 are 128 plus a signal number: SIGINT, SIGKILL and SIGTERM.
- Without shell: bash there is no pipefail, so a failing command on the left of a pipe passes.
This post covers where the line comes from, what each exit code people search for means, how to find the command that failed and how to let a command fail without failing the step. Each code in the table was reproduced with the shell commands GitHub documents for a step, and the posts linked from it cover the specific causes.
What does “Process completed with exit code 1” mean in GitHub Actions?
The runner prints it. Its script handler runs your step’s commands as one script, waits for the shell to exit, and if the exit code is anything but 0 it logs “Process completed with exit code” with that number and marks the step failed. The message is the same for every non-zero code; only the number changes.
GitHub’s workflow syntax reference says how the script is run. On Linux a step with no shell key runs as bash -e, and -e makes Bash stop at the first command that fails. So the exit code is that of the first failing command, and nothing after it ran. A script of echo one, false and echo three printed “one” and exited 1 when I ran it that way.
What does each exit code mean?
The number comes from the command, or from Bash on the command’s behalf. The Bash manual fixes four of them: 127 for a command that is not found, 126 for one that is found but not executable, 2 for a builtin used wrongly, and 128 plus the signal number for a command ended by a signal. The middle column below is the meaning, and the last is the command I ran to get that code.
| Exit code | What it means | Reproduced with |
|---|---|---|
| 1 | The command failed, and says nothing more | false; grep that matched no line; a failed test run |
| 2 | Wrong usage, by Bash's convention for its builtins | cd with an invalid option; ls and grep on a missing file |
| 126 | The command was found but is not executable | ./build.sh without the executable bit: Permission denied |
| 127 | The command was not found | A program that is not installed or not on PATH |
| 128 | git stopped on a fatal error | git clone of a repository that does not exist |
| 130 | Ended by signal 2, SIGINT (128 + 2) | A process sent SIGINT |
| 137 | Ended by signal 9, SIGKILL (128 + 9) | A process sent SIGKILL; Bash logs Killed |
| 143 | Ended by signal 15, SIGTERM (128 + 15) | A process sent SIGTERM; Bash logs Terminated |
| 255 | A status of -1, or an ssh error | exit -1 in a script |
Three of them need a caution. Exit code 2 is a convention, not a rule: Bash uses it for its own builtins, and ls and grep returned it for a missing file, but any program may return 2 for its own reasons. Exit code 128 is not a signal, since there is no signal 0. The program that uses it on purpose is git, whose fatal errors all exit with 128. And Bash keeps only the low 8 bits of a status, so exit -1 gives 255 (and exit 256 gives 0). The ssh manual also gives 255 as ssh’s own status when the connection itself failed.
The codes above 128 tell you a signal ended the process, not who sent it. A cancelled or timed-out run is not where they come from in this message. GitHub’s cancellation reference says a cancelled step is sent SIGINT and then SIGTERM, but the runner stops waiting for the exit code, and the step ends with “The operation was canceled” instead of this line. So 130 or 143 here means something other than a cancellation signalled the process. The post on “The operation was canceled” lists who cancels a job. For 137, the usual question is whether the machine ran out of memory, and the post on a runner that is out of memory has a section on that code and how to measure a job’s peak. For 127, see “Unable to locate executable file”, the same problem as an action reports it. For 128 from a clone or a push, see “could not read Username”, and for 255 from ssh see “Permission denied (publickey)”.
How do I find the command that failed?
Read upwards from the error line. Because the script stops at the first failure, the failing command’s own output is the last thing printed before the message, and the lines of your script that come after it never ran. Two things hide the real command, and both are worth checking before anything else.
A multi-line script without the bar. Commands on separate lines need run: |. Without the |, YAML joins the lines with spaces: a run: followed by npm ci and npm test on two lines loaded as the single command npm ci npm test when I parsed it. The step then fails on a command you did not write.
steps:
- run: |
npm ci
npm test
A pipe. With no shell key the step runs as bash -e, without pipefail, so a pipeline’s status is its last command’s. false | true exited 0 that way: a test command piped into tee passes although the tests failed. GitHub’s reference says -o pipefail is applied only when you write shell: bash, and with it the same pipeline exited 1. If a step fails only after you add shell: bash, a command on the left of a pipe was already failing.
How do I let a command fail without failing the step?
Some commands use exit code 1 for an answer, not an error. grep exits 1 when no line matched, and under bash -e that ends the step: a script of grep -q followed by an echo exited 1 and never reached the echo. Test the command instead of running it bare. Bash does not stop for a command that is the condition of an if or the left side of ||.
steps:
- run: |
if ! grep -q 'TODO' src/*.js; then
echo "no TODOs left"
fi
./optional-cleanup.sh || true
Both forms passed when I ran them. The ! also treats grep’s error status 2, such as a missing file, as no match. For a whole step whose failure should not fail the job, GitHub documents continue-on-error: true on the step. Use it sparingly, because the step still failed and the job no longer says so. A custom shell of bash {0} removes -e altogether, and then only the last command’s status counts.
Does the runner change the exit code?
No. The code is your command’s, and the runner only reports it, so a step that exits 1 on GitHub’s runners exits 1 on any other. The one family where the machine matters is 137 from memory: a job that needs more memory than its runner has needs a larger one or a smaller peak. The post on timeout-minutes covers the other way a job is stopped from outside. Every size we run, with its memory, disk and rate a minute, is on our managed GitHub Actions runners page, and the troubleshooting page lists the messages a job page there can show.
Sources
- ScriptHandler.cs (actions/runner source) (github.com)
- Exit Status (Bash Reference Manual) (gnu.org)
- Workflow syntax for GitHub Actions (docs.github.com)
- usage.c (git source) (github.com)
- ssh(1) manual page (OpenSSH source) (github.com)
- Workflow cancellation reference (docs.github.com)
- ProcessInvoker.cs (actions/runner source) (github.com)
- Exit Status (GNU grep manual) (gnu.org)
Frequently asked questions
What does "Process completed with exit code 1" mean in GitHub Actions?
A command in a run step exited with a status other than 0, so the runner failed the step. The number is the command's own exit status, and 1 is the general one. The cause is in the log lines printed just above the message.
What does each exit code mean?
1 is a general failure and 2 usually wrong usage. 126 is a command that is not executable, 127 one that was not found, and 128 a fatal git error. 130, 137 and 143 are 128 plus the signal that ended the process. 255 is what Bash gives for exit -1, or an ssh error.
How do I find the command that failed?
Read upwards from the error: a step run as bash -e stops at the first failing command, so its output is the last thing printed. Check that a multi-line script uses run with a bar, and that the failure is not hidden on the left of a pipe.
How do I let a command fail without failing the step?
Make it the condition of an if, or follow it with || true. Bash does not stop for either under -e. For a whole step, GitHub documents continue-on-error: true, which lets the job pass when the step fails.