Skip to content
Subnomic
← Back to blog
Fleet Nov 22, 2026 · 3 min read

Kubernetes exit codes: 1, 137, 139, 143 and the rest

The number a container exited with narrows a crash down before you read a log line. Above 128, it names the signal that killed it.

When a container stops, Kubernetes records the number its main process exited with. That number, and the reason next to it, narrow down most crashes before you read a single log line. Codes below 126 are usually the program’s own; codes above 128 mean the process was killed by a signal, and the signal is the code minus 128.

Where to find it

kubectl describe pod checkout-5c8d7-q2v9n -n shop

Under the container, Last State: Terminated has a Reason and an Exit Code. For a script, or for every container in a namespace:

kubectl get pod checkout-5c8d7-q2v9n -n shop \
  -o jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}'

kubectl get pods -n shop -o custom-columns=\
POD:.metadata.name,\
CODE:.status.containerStatuses[0].lastState.terminated.exitCode,\
REASON:.status.containerStatuses[0].lastState.terminated.reason

The codes

CodeSignalUsually means
0—The process finished successfully. In a Job that is the goal; in a Deployment, whose containers are expected to keep running, a command that completes is started again forever. Check the command and its arguments.
1—A general error from the application itself: a missing setting, a refused connection, an unhandled exception. The previous container’s logs say which.
2—Often a usage error: the program did not understand its arguments. Compare the container’s command and args with what the program accepts.
126—The command was found but could not be executed: no execute permission, or a script without a valid interpreter line.
127—Command not found, inside a shell: a typo in the entrypoint, a binary missing from the image, or a PATH that does not contain it.
128—With the reason StartError or ContainerCannotRun, the runtime could not start the process at all, for example an executable that is not in the image. The message next to it names the file.
130SIGINT (2)Interrupted, as by Ctrl-C. Rare in a cluster.
134SIGABRT (6)The process aborted itself, typically a failed assertion or a fatal error in a native library.
137SIGKILL (9)Killed outright. With the reason OOMKilled, the container went over its memory limit. Without it, something else sent the kill, most often the kubelet after a container ignored SIGTERM for the whole grace period.
139SIGSEGV (11)A segmentation fault: the process touched memory it should not. Look at native code, a library built for another C library or CPU than the image, and recent base-image changes.
143SIGTERM (15)Asked to stop and stopped. Normal during a rollout, a scale-down or a node drain; also the first step when a failing liveness probe restarts a container.

137: out of memory, or out of patience

When Kubernetes stops a container it sends SIGTERM, waits for terminationGracePeriodSeconds (30 seconds unless the pod says otherwise), then sends SIGKILL. So 137 has two common stories:

139: a crash inside the process

A segmentation fault is not a configuration problem Kubernetes can show you. The usual suspects: a native extension compiled against a different C library than the image’s (common after moving to or from a minimal base image), an image built for another CPU architecture running under emulation, or a real bug in native code. Reproduce it with the same image locally before changing the cluster.

143 is usually fine

A container that exits 143 during a rollout did what it was asked. If you see 143 while nothing was being rolled out, look at the events for Liveness probe failed: the probe is restarting it. If you would rather see 0, handle SIGTERM in the application and exit cleanly.

Reading it for a whole namespace

In a cluster connected to Subnomic, Runa’s crashloop_report lists every pod in a namespace that is restarting, OOM-killed or not running, each with its restart count and its last exit code and reason, and investigate_resource adds the events and recent logs for one pod. When the code points at the restart loop itself, the four commands that find its cause are in CrashLoopBackOff: find the cause in four commands.