What is CrashLoopBackOff status for openshift pods?

被刻印的时光 ゝ 提交于 2019-12-08 18:48:33

问题


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 ?


回答1:


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.




回答2:


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

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



来源:https://stackoverflow.com/questions/35710965/what-is-crashloopbackoff-status-for-openshift-pods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!