openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

Confusing print statement if openshiftVerifyDeployment fails #144

Closed eleanordare closed 7 years ago

eleanordare commented 7 years ago

If the container errors out and the deployment fails, the logs inside Jenkins for the "verify deployment" step are unclear. It shows this same error message regardless of why the pod failed:

[Pipeline] openshiftVerifyDeployment

Starting "Verify OpenShift Deployment" with deployment config "dials-gateway" from the project "vibe-develop".
  Waiting on the latest deployment for "dials-gateway" to complete and scale to "1" replica(s) ...
Operation will timeout after 240000 milliseconds
java.util.MissingFormatArgumentException: Format specifier '%s'
    at java.util.Formatter.format(Unknown Source)
    at java.util.Formatter.format(Unknown Source)
    at java.lang.String.format(Unknown Source)
    at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftDeploymentVerification.coreLogic(IOpenShiftDeploymentVerification.java:140)
    at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftPlugin.doItCore(IOpenShiftPlugin.java:308)
    at com.openshift.jenkins.plugins.pipeline.dsl.OpenShiftDeploymentVerifierExecution.run(OpenShiftDeploymentVerifierExecution.java:42)
    at com.openshift.jenkins.plugins.pipeline.dsl.OpenShiftDeploymentVerifierExecution.run(OpenShiftDeploymentVerifierExecution.java:18)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
    at hudson.security.ACL.impersonate(ACL.java:221)
    at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
[Pipeline] echo
hudson.AbortException: "Verify OpenShift Deployment" failed

It would be great if it printed logs from the failed pod or a link to the deployment in the console instead!

gabemontero commented 7 years ago

hey @eleanordare which version of the plugin were you running at? A bug in the logging statement at the key point in your stack trace, com.openshift.jenkins.plugins.pipeline.model.IOpenShiftDeploymentVerification.coreLogic(IOpenShiftDeploymentVerification.java:140), was fixed with commit 7c4ac3b1c5bc3c144973d47bed08caf67db783a3

The fix made v1.0.43 of the plugin.

Pretty sure that is what is going on here. But please reopen if you are still seeing this at v1.0.43 or later.

thanks