What is CrashLoopBackOff status for openshift pods?

27,032

Solution 1

Temporary workaround -> https://github.com/fabric8io/ipaas-quickstarts/issues/1157

Basically, the src/main/hawt-app directory needs to be deleted.

Solution 2

If the state of the pod goes in to CrashLoopBackOff it usually indicates that the application within the container is failing to start up properly and the container is exiting straight away as a result.

If you use oc logs on the pod name, you may not see anything useful though as it would capture what the latest attempt to start it up is doing and may miss messages.

What you should do is instead provide the --previous or -p option to oc logs along with the pod name. That will show you the complete logs from the previous attempt to start up the container.

If this is an arbitrary Docker image you are using, a common problem that can occur and which would cause the container not to start, is an application image which requires to be run as the root user. Because running an application inside of a container as root still has risks, OpenShift doesn't allow you to do that by default and will instead run as an arbitrary assigned user ID. The application image may not be designed with this possibility in mind and so is failing.

So try and get those logs messages and see what the problem is.

Share:
27,032
ZeroGraviti
Author by

ZeroGraviti

Developer, Architect, Designer, Software enthusiast

Updated on July 09, 2022

Comments

  • ZeroGraviti
    ZeroGraviti almost 2 years

    There is more than one example where I have seen this status from a pod running in openshift origin. In this case it was the quickstart for the cdi camel example. I was able to successfully build and run it locally (non - openshift) but when I try to deploy on my local openshift (using mvn -Pf8-local-deploy), I get this output for that particular example (snipped for relevance) :-

    [vagrant@vagrant camel]$ oc get pods NAME READY STATUS RESTARTS AGE cdi-camel-z4czs 0/1 CrashLoopBackOff 4 2m

    Tail of the logs are as under:-

      Error occurred during initialization of VM
      Error opening zip file or JAR manifest missing : agents/jolokia.jar
      agent library failed to init: instrument
    

    Can someone help me solve this ?

  • ZeroGraviti
    ZeroGraviti about 8 years
    Just to be sure we are on the same page, I am trying to run a canned example from here which is expected to work out of the box on this canned (vagrant) openshift box. I am just following through on their "Getting Started" example(s) here. But they dont work. This is the first time I am trying this example so there isn't any previous running version.
  • ArtOfWarfare
    ArtOfWarfare about 4 years
    Is there any way we can make it so the pod stops restarting sooner? IE, tell it to just abort after 3 restarts instead of 5 when it's in CrashLoopBackOff?
  • Philip Rego
    Philip Rego about 2 years
    You don't mention how to get the Pod to stop crashback looping so I can debug OS files. Without that your server is going to keep getting destroyed making debugging impossible downvote.
  • Philip Rego
    Philip Rego about 2 years
    But how do you get it to stop destroying the docker instance? Or how to get connection to Openshift servers