A container is killed with exit code 137. What usually happened?
Options
- A syntax error in the code stopped the container at startup
- It got SIGKILL (128 + 9), often from the OOM killer at the memory limit (Correct option)
- A normal shutdown that was requested with
docker stop - A network timeout while the container pulled its image
Answer
It received SIGKILL (128 + 9), very often from the OOM killer hitting the memory limit
Why
Exit codes above 128 mean 'killed by a signal': code = 128 + signal number. 137 = 128 + 9, and signal 9 is SIGKILL, which cannot be caught.
The most common reason is the container using more memory than its limit, so the kernel's OOM (out-of-memory) killer stops it.
Check with docker inspect (OOMKilled: true) or kubectl describe pod. 143 = SIGTERM, a normal stop request.
Remember
137 = killed (often out of memory). 143 = asked to stop.