I am using a containerized Spring boot application in Kubernetes. But the application automatically exits and restarts with exit code 143 and error message "Error".
I am not sure how to identify the reason for this error.
My first idea was that Kubernetes stopped the container due to too high resource usage, as described here, but I can’t see the corresponding kubelet logs.
Is there any way to identify the cause/origin of the SIGTERM
? Maybe from spring-boot itself, or from the JVM?
2
Answers
It denotes that the process was terminated by an
external signal
.The number 143 is a sum of two numbers: 128+x,
# where x is the signal number sent to the process that caused it to terminate.
In the example, x equals 15, which is the number of the
SIGTERM
signal, meaning the process was killed forcibly.Hope this helps better.
I’ve just run into this exact same problem. I was able to track down the origin of the
Exit Code 143
by looking at the logs on the Kubernetes nodes (note, the logs on the node not the pod). (I use Lens as an easy way to get a node shell but there are other ways)Then if you look in
/var/log/messages
forterminated
you’ll see something like this:The bit to look out for is
containerMessage="Container app failed liveness probe, will be restarted"