OpenShift - Resolve "CrashLoopBackOff"
by
Jeremy Canfield |
Updated: November 08 2022
| OpenShift articles
The oc get pods command can be used to view the status of a pod. In this example, a pod has crash looped 123 times.
~]# oc get pods --output wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED MODE
my-app-1-9mzm2 1/1 Running 0 8d 10.142.118.51 my-worker-9mfhx <none>
my-app-2-vmzmz 1/1 Running 0 8d 10.142.118.52 my-worker-mf8sm <none>
my-app-3-pflxc 1/1 CrashLoopBackOff 123 8d 10.142.118.53 my-worker-m4dm4 <none>
The oc get events command may display helpful events. Something like this could be returned.
~]# oc get events
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/my-app-3-pflxc
Or in the previous log.
oc logs --previous pod/my-app-3-pflxc
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.
Did you find this article helpful?
If so, consider buying me a coffee over at