Skip to content

Process Completed With Exit Code 143: SIGTERM Fix

Last updated

Process completed with exit code 143 means a process was asked to stop with SIGTERM. The number is 128 plus 15, and 15 is the SIGTERM signal. Unlike exit code 137, which is a forced kill, SIGTERM is a polite request that the process can catch and clean up after. In GitHub Actions, something told your step to stop: usually a cancelled run, a timeout, or a runner shutdown.

The exact message

Error: Process completed with exit code 143.

You may see Terminated printed just above it, and often The operation was canceled near the end of the log.

Causes, most likely first

1. The run was cancelled

Someone cancelled the run, or a workflow concurrency group with cancel-in-progress: true cancelled it because a newer run started. The step that was running at that moment ends with 143.

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

This is intended behaviour for pull request builds, but dangerous on deploy workflows. Do not cancel a deploy half way: use cancel-in-progress: false there. See The operation was canceled.

2. A job or step hit timeout-minutes

When a job or step exceeds its timeout-minutes, GitHub terminates it. Check the job's duration against the limit you set, and see timeout-minutes.

3. The runner is shutting down

On self-hosted runners, a stopped service, a reboot or a scale-down sends SIGTERM to the job. See The runner has received a shutdown signal.

4. docker stop or a container being replaced

docker stop sends SIGTERM first, and force-kills after a grace period (10 seconds by default). A container whose main process ignores SIGTERM then ends with 137, and one that handles it ends with 143 or 0.

5. Your own script sent it

kill, pkill and timeout send SIGTERM by default. A pkill node that matches more than you intended will stop the build tool as well.

Handle SIGTERM in your own scripts

To clean up when the job is stopped, trap the signal:

- run: |
    cleanup() { echo "stopping"; docker compose down; }
    trap cleanup TERM INT
    ./long-running-task.sh &
    wait $!

For steps that must run even when the job is cancelled, use if: always() or if: cancelled():

- name: Stop services
  if: always()
  run: docker compose down

A cancelled job has a short window to run these steps, so keep cleanup fast.

How to prevent it

  1. Use cancel-in-progress only on workflows that are safe to interrupt.
  2. Set timeout-minutes with headroom above the normal run time.
  3. Make long tasks resumable, and trap SIGTERM to release locks and containers.
  4. On self-hosted runners, drain before restarts.
  5. Be specific in pkill and kill commands.

FAQ

What does exit code 143 mean?

The process received SIGTERM (128 + 15). It was asked to terminate, and it did.

Is exit code 143 an error in my code?

Usually not. It points to something outside the step stopping it. Check cancellation, timeouts and the runner first.

What is the difference between 137 and 143?

137 is SIGKILL, which cannot be caught and is typical of out-of-memory kills. 143 is SIGTERM, which a process can catch and handle.

Why did my passing job end in 143?

If a later step failed and the workflow cancelled the remaining work, or a sibling job in a matrix with fail-fast: true failed, running jobs are cancelled and can end in 143. Set fail-fast: false if you want them to finish.