Openshift: exit code 137

If your pod exited with exit code 137 so you see something like this in pod Details page:

Last State  Terminated at Jan 7, 2018 5:00:15 PM with exit code 137 (Error)

your pod has been killed with signal 9. If you are certain it was not you who killed the process, you can check dmesg on corresponding node and you may see something like this:

Jan 7 17:00:14 node3 kernel: Out of memory: Kill process 22312 (prometheus) score 1127 or sacrifice child
Jan 7 17:00:14 node3 kernel: Killed process 22312 (prometheus) total-vm:2541820kB, anon-rss:2339336kB, file-rss:0kB, shmem-rss:0kB

This means there was OOM condition on the host and the kernel simply killed the most memory hungry process. If you check node status with

oc describe node/node3

You should also see

 FirstSeen LastSeen Count From SubObjectPath Type Reason Message
 --------- -------- ----- ---- ------------- -------- ------ -------
 19d 1h 5 kubelet, node3 Warning SystemOOM System OOM encountered

which means you should add or better plan you resources.

Did you know there are exit codes with special meaning in Linux?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.