fabric8-console icon indicating copy to clipboard operation
fabric8-console copied to clipboard

Make it possible to get previous log in case a container keeps crashing

Open davsclaus opened this issue 10 years ago • 4 comments

In the fabric8 console you cannot find the log of the pod if it keeps crashing.

Only from command line you can run oc logs -p where -p is to get the previous log

davsclaus:~/$ oc logs -p cdi-camel-gzpib
Executing /deployments/bin/run ...
Launching application in folder: /deployments
Running  java  -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/jolokia.properties,useSslClientAuthentication=true,extraClientCheck=true,protocol=https,caCert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt,clientPrincipal=cn=system:master-proxy -javaagent:agents/jolokia.jar=config=etc/jolokia.properties -classpath :/deployments/lib/cdi-camel.jar:/deployments/lib/camel-core-2.16.2.jar:/deployments/lib/slf4j-api-1.6.6.jar:/deployments/lib/jaxb-core-2.2.11.jar:/deployments/lib/jaxb-impl-2.2.11.jar:/deployments/lib/camel-cdi-2.16.2.jar:/deployments/lib/deltaspike-core-api-1.5.3.jar:/deployments/lib/deltaspike-core-impl-1.5.3.jar:/deployments/lib/weld-se-2.3.3.Final.jar:/deployments/lib/weld-core-2.3.3.Final.jar:/deployments/lib/weld-api-2.3.SP1.jar:/deployments/lib/weld-spi-2.3.SP1.jar:/deployments/lib/jboss-classfilewriter-1.1.2.Final.jar:/deployments/lib/jboss-annotations-api_1.2_spec-1.0.0.Final.jar:/deployments/lib/guava-18.0.jar:/deployments/lib/jboss-el-api_3.0_spec-1.0.0.Alpha1.jar:/deployments/lib/jboss-interceptors-api_1.2_spec-1.0.0.Final.jar:/deployments/lib/jboss-logging-3.2.1.Final.jar:/deployments/lib/deltaspike-cdictrl-weld-1.5.3.jar:/deployments/lib/deltaspike-cdictrl-api-1.5.3.jar:/deployments/lib/slf4j-log4j12-1.7.12.jar:/deployments/lib/log4j-1.2.17.jar org.apache.camel.cdi.Main
Error opening zip file or JAR manifest missing : agents/jolokia.jar
Error occurred during initialization of VM
agent library failed to init: instrument
davsclaus:~/$

Then you can see why the pod failed, this one is about jolokia agent failed.

davsclaus avatar Mar 01 '16 09:03 davsclaus

Maybe the log icon would try and get the previous if the current log is empty or something?

screen shot 2016-03-01 at 10 17 00 am

davsclaus avatar Mar 01 '16 09:03 davsclaus

@gashcrumb wonder how you grab the log, and if it would be possible to get the previous as the command line tool is able to do.

davsclaus avatar Mar 01 '16 09:03 davsclaus

Ah, looks like there's a 'previous' parameter we can specify, lemme see how difficult it'd be to fall back to that...

gashcrumb avatar Mar 01 '16 15:03 gashcrumb

hmm, seems the 'logs' API there just doesn't return messages if the container crashes, so you don't get anything. I've added a link that'll add the 'previous' flag that you can click which will then fetch the previous container's log.

gashcrumb avatar Mar 01 '16 17:03 gashcrumb