FreeKB - OpenShift Resolve "CrashLoopBackOff"
OpenShift - Resolve "CrashLoopBackOff"

The oc get pods command can be used to view the status of a pod. In this example, mypod003 has crash looped 123 times.

~]# oc get pods -o wide
NAME        READY   STATUS            RESTARTS  AGE  IP              NODE                 NOMINATED MODE
mypod001    1/1     Running           0         8d   10.142.118.51   server1.example.com  <none>
mypod002    1/1     Running           0         8d   10.142.118.52   server2.example.com  <none>
mypod003    1/1     CrashLoopBackOff  123       8d   10.142.118.53   server3.example.com  <none>

 

The oc get events command may display helpful events.

oc get events --namespace project001

 

Something like this could be returned.

LAST SEEN   FIRST SEEN   COUNT     NAME                                                             KIND      SUBOBJECT                        TYPE      REASON      SOURCE              MESSAGE
53m         1d           162       pod001-0.0.5-master-2-2-7db7cccc54-x4lql.162212ee500ec2d5        Pod       spec.containers{mypod001}        Warning   Unhealthy   kubelet, server01   Readiness probe failed: HTTP probe failed with statuscode: 503

 

With this intel in hand, you can check to see if there is anything interesting in the current log.

oc logs pod/pod001 --namespace project001 --container app001

 

Or in the previous log.

oc logs --previous pod/pod001 --namespace project001 --container app001

 

If the logs contain some sort of event at something other than log level INFO, this might be why the pod is crash looping.

-2021-08-05 05:30:24.085 - WARN                  7 --- [nio-8081-exec-3] o.s.b.a.amqp.RabbitHealthIndicator       : Rabbit health check failed
org.springframework.amqp.AmqpIOException: java.net.SocketTimeoutException: connect timed out

 

Following are things you can try to resolve the crash looping.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter e6a43 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |