OpenShift Sample Jenkins job relaunch fails for nodejs app
Relaunching OpenShift Sample Jenkins job it fails, cannot understand if it is a template issue, OCP issue or a Jenkins issue. Just want to be sure that I correctly deployed Jenkins and OpenShift Jenkins Plugin is running correctly.
Version
oc v3.6.173.0.5 kubernetes v1.6.1+5115d708d7 features: Basic-Auth GSSAPI Kerberos SPNEGO
openshift v3.4.1.7 kubernetes v1.4.0+776c994
Steps To Reproduce
oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/application-template.json- I have a Jenkins server running in the same project, deployed from the Persistent Template. Start the build from the OpenShift Sample job (following here https://github.com/openshift/origin/tree/master/examples/jenkins). The job finishes successfully, both the test and production services are available.
- Start the Jenkins job again.
Current Result
Build fails.
Exiting "Trigger OpenShift Deployment" successfully; deployment "frontend-2" has completed with status: [Complete]. However frontend pod has replica 0, so the "Verify OpenShift Service" step fails.
Here you are the verbose logs for that step:
Starting "Trigger OpenShift Deployment" with deployment config "frontend" from the project "ci".
Found global job type timeout configuration: 600000 milliseconds
No local timeout configured for this step
Operation will timeout after 600000 milliseconds
OpenShiftDeployer latest version now 2 and was 1
OpenShiftDeployer returned rep ctrl {"kind" : "ReplicationController", "apiVersion" : "v1", "metadata" : {"name" : "frontend-2", "namespace" : "ci", "selfLink" : "/api/v1/namespaces/ci/replicationcontrollers/frontend-2", "uid" : "2873a235-9919-11e7-9827-000c29ae3420", "resourceVersion" : "22527771", "generation" : 1, "creationTimestamp" : "2017-09-14T06:51:38Z", "labels" : {"app" : "nodejs-helloworld-sample", "openshift.io/deployment-config.name" : "frontend", "template" : "application-template-stibuild"}, "annotations" : {"kubectl.kubernetes.io/desired-replicas" : "0", "openshift.io/deployment-config.latest-version" : "2", "openshift.io/deployment-config.name" : "frontend", "openshift.io/deployment.phase" : "New", "openshift.io/deployment.replicas" : "0", "openshift.io/deployment.status-reason" : "manual change", "openshift.io/encoded-deployment-config" : "{\"kind\":\"DeploymentConfig\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"frontend\",\"namespace\":\"ci\",\"selfLink\":\"/oapi/v1/namespaces/ci/deploymentconfigs/frontend\",\"uid\":\"c9fd4e22-9918-11e7-8b07-000c29621a0c\",\"resourceVersion\":\"22527770\",\"generation\":4,\"creationTimestamp\":\"2017-09-14T06:49:00Z\",\"labels\":{\"app\":\"nodejs-helloworld-sample\",\"template\":\"application-template-stibuild\"},\"annotations\":{\"openshift.io/generated-by\":\"OpenShiftNewApp\"}},\"spec\":{\"strategy\":{\"type\":\"Rolling\",\"rollingParams\":{\"updatePeriodSeconds\":1,\"intervalSeconds\":1,\"timeoutSeconds\":120,\"maxUnavailable\":\"25%\",\"maxSurge\":\"25%\"},\"resources\":{}},\"triggers\":[{\"type\":\"ImageChange\",\"imageChangeParams\":{\"containerNames\":[\"nodejs-helloworld\"],\"from\":{\"kind\":\"ImageStreamTag\",\"namespace\":\"ci\",\"name\":\"origin-nodejs-sample:latest\"},\"lastTriggeredImage\":\"172.30.218.186:5000/ci/origin-nodejs-sample@sha256:55af89eff1bf494710ecddf4342d576ef019bde8ddd8e75e7117ed301441b894\"}},{\"type\":\"ConfigChange\"}],\"replicas\":0,\"test\":false,\"selector\":{\"name\":\"frontend\"},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"app\":\"nodejs-helloworld-sample\",\"name\":\"frontend\"},\"annotations\":{\"openshift.io/generated-by\":\"OpenShiftNewApp\"}},\"spec\":{\"containers\":[{\"name\":\"nodejs-helloworld\",\"image\":\"172.30.218.186:5000/ci/origin-nodejs-sample@sha256:55af89eff1bf494710ecddf4342d576ef019bde8ddd8e75e7117ed301441b894\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{\"limits\":{\"memory\":\"512Mi\"}},\"terminationMessagePath\":\"/dev/termination-log\",\"imagePullPolicy\":\"IfNotPresent\",\"securityContext\":{\"capabilities\":{},\"privileged\":false}}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":30,\"dnsPolicy\":\"ClusterFirst\",\"securityContext\":{}}}},\"status\":{\"latestVersion\":2,\"observedGeneration\":3,\"details\":{\"message\":\"manual change\",\"causes\":[{\"type\":\"Manual\"}]},\"conditions\":[{\"type\":\"Progressing\",\"status\":\"True\",\"lastTransitionTime\":\"2017-09-14T06:50:02Z\",\"reason\":\"NewReplicationControllerAvailable\",\"message\":\"Replication controller \\\"frontend-1\\\" has completed progressing\"},{\"type\":\"Available\",\"status\":\"False\",\"lastTransitionTime\":\"2017-09-14T06:50:50Z\",\"message\":\"Deployment config does not have minimum availability.\"}]}}\n"}}, "spec" : {"replicas" : 0, "selector" : {"deployment" : "frontend-2", "deploymentconfig" : "frontend", "name" : "frontend"}, "template" : {"metadata" : {"labels" : {"app" : "nodejs-helloworld-sample", "deployment" : "frontend-2", "deploymentconfig" : "frontend", "name" : "frontend"}, "annotations" : {"openshift.io/deployment-config.latest-version" : "2", "openshift.io/deployment-config.name" : "frontend", "openshift.io/deployment.name" : "frontend-2", "openshift.io/generated-by" : "OpenShiftNewApp"}}, "spec" : {"containers" : [{"name" : "nodejs-helloworld", "image" : "172.30.218.186:5000/ci/origin-nodejs-sample@sha256:55af89eff1bf494710ecddf4342d576ef019bde8ddd8e75e7117ed301441b894", "ports" : [{"containerPort" : 8080, "protocol" : "TCP"}], "resources" : {"limits" : {"memory" : "512Mi"}}, "terminationMessagePath" : "/dev/termination-log", "imagePullPolicy" : "IfNotPresent", "securityContext" : {"capabilities" : {}, "privileged" : false}}], "restartPolicy" : "Always", "terminationGracePeriodSeconds" : 30, "dnsPolicy" : "ClusterFirst", "securityContext" : {}}}}, "status" : {"replicas" : 0}}
An exception occurred invoking a REST operation against the OpenShift master. The operation will be retried. Exception message "Exception trying to PUT https://172.30.0.1/api/v1/namespaces/ci/replicationcontrollers/frontend-2 response code: 409 Operation cannot be fulfilled on replicationcontrollers "frontend-2": the object has been modified; please apply your changes to the latest version and try again".
An exception occurred invoking a REST operation against the OpenShift master. The operation will be retried. Exception message "Exception trying to PUT https://172.30.0.1/api/v1/namespaces/ci/replicationcontrollers/frontend-2 response code: 409 Operation cannot be fulfilled on replicationcontrollers "frontend-2": the object has been modified; please apply your changes to the latest version and try again".
An exception occurred invoking a REST operation against the OpenShift master. The operation will be retried. Exception message "Exception trying to PUT https://172.30.0.1/api/v1/namespaces/ci/replicationcontrollers/frontend-2 response code: 409 Operation cannot be fulfilled on replicationcontrollers "frontend-2": the object has been modified; please apply your changes to the latest version and try again".
After a few retries, giving up invoking the REST operation against the OpenShift master. Final exception message "Exception trying to PUT https://172.30.0.1/api/v1/namespaces/ci/replicationcontrollers/frontend-2 response code: 409 Operation cannot be fulfilled on replicationcontrollers "frontend-2": the object has been modified; please apply your changes to the latest version and try again".
com.openshift.restclient.OpenShiftException: Exception trying to PUT https://172.30.0.1/api/v1/namespaces/ci/replicationcontrollers/frontend-2 response code: 409 Operation cannot be fulfilled on replicationcontrollers "frontend-2": the object has been modified; please apply your changes to the latest version and try again
at com.openshift.internal.restclient.okhttp.ResponseCodeInterceptor.createOpenShiftException(ResponseCodeInterceptor.java:114)
at com.openshift.internal.restclient.okhttp.ResponseCodeInterceptor.intercept(ResponseCodeInterceptor.java:65)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
at okhttp3.RealCall.execute(RealCall.java:60)
at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:255)
at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:219)
at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:207)
at com.openshift.internal.restclient.DefaultClient.update(DefaultClient.java:313)
at com.openshift.jenkins.plugins.pipeline.model.RetryIClient.lambda$update$11(RetryIClient.java:198)
at com.openshift.jenkins.plugins.pipeline.model.RetryIClient.retry(RetryIClient.java:65)
at com.openshift.jenkins.plugins.pipeline.model.RetryIClient.update(RetryIClient.java:198)
at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftPlugin.annotateJobInfoToResource(IOpenShiftPlugin.java:629)
at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftDeployer.coreLogic(IOpenShiftDeployer.java:85)
at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftPlugin.doItCore(IOpenShiftPlugin.java:308)
at com.openshift.jenkins.plugins.pipeline.model.IOpenShiftPlugin.doIt(IOpenShiftPlugin.java:326)
at com.openshift.jenkins.plugins.pipeline.OpenShiftBaseStep.perform(OpenShiftBaseStep.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
OpenShiftDeploy current phase New
OpenShiftDeployer wait 10 seconds, then try oc deploy again
OpenShiftDeployer returned rep ctrl {"kind" : "ReplicationController", "apiVersion" : "v1", "metadata" : {"name" : "frontend-2", "namespace" : "ci", "selfLink" : "/api/v1/namespaces/ci/replicationcontrollers/frontend-2", "uid" : "2873a235-9919-11e7-9827-000c29ae3420", "resourceVersion" : "22527801", "generation" : 1, "creationTimestamp" : "2017-09-14T06:51:38Z", "labels" : {"app" : "nodejs-helloworld-sample", "openshift.io/deployment-config.name" : "frontend", "template" : "application-template-stibuild"}, "annotations" : {"openshift.io/deployer-pod.name" : "frontend-2-deploy", "openshift.io/deployment-config.latest-version" : "2", "openshift.io/deployment-config.name" : "frontend", "openshift.io/deployment.phase" : "Complete", "openshift.io/deployment.replicas" : "", "openshift.io/deployment.status-reason" : "manual change", "openshift.io/encoded-deployment-config" : "{\"kind\":\"DeploymentConfig\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"frontend\",\"namespace\":\"ci\",\"selfLink\":\"/oapi/v1/namespaces/ci/deploymentconfigs/frontend\",\"uid\":\"c9fd4e22-9918-11e7-8b07-000c29621a0c\",\"resourceVersion\":\"22527770\",\"generation\":4,\"creationTimestamp\":\"2017-09-14T06:49:00Z\",\"labels\":{\"app\":\"nodejs-helloworld-sample\",\"template\":\"application-template-stibuild\"},\"annotations\":{\"openshift.io/generated-by\":\"OpenShiftNewApp\"}},\"spec\":{\"strategy\":{\"type\":\"Rolling\",\"rollingParams\":{\"updatePeriodSeconds\":1,\"intervalSeconds\":1,\"timeoutSeconds\":120,\"maxUnavailable\":\"25%\",\"maxSurge\":\"25%\"},\"resources\":{}},\"triggers\":[{\"type\":\"ImageChange\",\"imageChangeParams\":{\"containerNames\":[\"nodejs-helloworld\"],\"from\":{\"kind\":\"ImageStreamTag\",\"namespace\":\"ci\",\"name\":\"origin-nodejs-sample:latest\"},\"lastTriggeredImage\":\"172.30.218.186:5000/ci/origin-nodejs-sample@sha256:55af89eff1bf494710ecddf4342d576ef019bde8ddd8e75e7117ed301441b894\"}},{\"type\":\"ConfigChange\"}],\"replicas\":0,\"test\":false,\"selector\":{\"name\":\"frontend\"},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"app\":\"nodejs-helloworld-sample\",\"name\":\"frontend\"},\"annotations\":{\"openshift.io/generated-by\":\"OpenShiftNewApp\"}},\"spec\":{\"containers\":[{\"name\":\"nodejs-helloworld\",\"image\":\"172.30.218.186:5000/ci/origin-nodejs-sample@sha256:55af89eff1bf494710ecddf4342d576ef019bde8ddd8e75e7117ed301441b894\",\"ports\":[{\"containerPort\":8080,\"protocol\":\"TCP\"}],\"resources\":{\"limits\":{\"memory\":\"512Mi\"}},\"terminationMessagePath\":\"/dev/termination-log\",\"imagePullPolicy\":\"IfNotPresent\",\"securityContext\":{\"capabilities\":{},\"privileged\":false}}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":30,\"dnsPolicy\":\"ClusterFirst\",\"securityContext\":{}}}},\"status\":{\"latestVersion\":2,\"observedGeneration\":3,\"details\":{\"message\":\"manual change\",\"causes\":[{\"type\":\"Manual\"}]},\"conditions\":[{\"type\":\"Progressing\",\"status\":\"True\",\"lastTransitionTime\":\"2017-09-14T06:50:02Z\",\"reason\":\"NewReplicationControllerAvailable\",\"message\":\"Replication controller \\\"frontend-1\\\" has completed progressing\"},{\"type\":\"Available\",\"status\":\"False\",\"lastTransitionTime\":\"2017-09-14T06:50:50Z\",\"message\":\"Deployment config does not have minimum availability.\"}]}}\n", "openshift.io/jenkins-build-uri" : "https://jenkins-ci.apps.cloud.extrasys.it/job/OpenShift%20Sample/13/"}}, "spec" : {"replicas" : 0, "selector" : {"deployment" : "frontend-2", "deploymentconfig" : "frontend", "name" : "frontend"}, "template" : {"metadata" : {"labels" : {"app" : "nodejs-helloworld-sample", "deployment" : "frontend-2", "deploymentconfig" : "frontend", "name" : "frontend"}, "annotations" : {"openshift.io/deployment-config.latest-version" : "2", "openshift.io/deployment-config.name" : "frontend", "openshift.io/deployment.name" : "frontend-2", "openshift.io/generated-by" : "OpenShiftNewApp"}}, "spec" : {"containers" : [{"name" : "nodejs-helloworld", "image" : "172.30.218.186:5000/ci/origin-nodejs-sample@sha256:55af89eff1bf494710ecddf4342d576ef019bde8ddd8e75e7117ed301441b894", "ports" : [{"containerPort" : 8080, "protocol" : "TCP"}], "resources" : {"limits" : {"memory" : "512Mi"}}, "terminationMessagePath" : "/dev/termination-log", "imagePullPolicy" : "IfNotPresent", "securityContext" : {"capabilities" : {}, "privileged" : false}}], "restartPolicy" : "Always", "terminationGracePeriodSeconds" : 30, "dnsPolicy" : "ClusterFirst", "securityContext" : {}}}}, "status" : {"replicas" : 0, "observedGeneration" : 1}}
Exiting "Trigger OpenShift Deployment" successfully; deployment "frontend-2" has completed with status: [Complete].
Starting "Verify OpenShift Service" for the service "frontend" from the project "ci".
Attempting to connect to "172.30.145.144:8080" ...
Exiting "Verify OpenShift Service" unsuccessfully; a connection to "172.30.145.144:8080" could not be made.
ERROR: "Verify OpenShift Service" failed
Finished: FAILURE
Expected Result
I expected the build run successfully again even if no changes were applied.
Additional Information
From documentation I read that "Trigger OpenShift Deployment" step consists in oc deploy --latest command, so I run manually oc deploy frontend --latest --follow:
Started deployment #3
--> Scaling up frontend-3 from 0 to 0, scaling down frontend-2 from 0 to 0 (keep 0 pods available, don't exceed 0 pods)
--> Success
So the pod still remains at 0 replicas. Only scaling manually it comes up to 1.
Is that related to the dc triggers? Triggers: Image(origin-nodejs-sample@latest, auto=false), Config
Ready to provide any other infos. Thanks a lot.
Seems like a deployment issue, as I understand it, after we scaled the pod to 0 replicas and then triggered a deployment, it should have gone back to 1 replica.
Exactly. Can anybody reproduce that? I would like to exclude issues from Jenkins/OCP side. Thanks
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.
/close