In the UI we are adding a jenkins page that helps the user to add a new Jenkins server and add the cartridge. The flow is: 1) If there is no application with framework type 'jenkins-1.4', create a new one 2) Add the 'jenkins-client-1.4' cartridge to the current application Done immediately back to back in the site, step #2 fails with: Server error: :cartridge #157: Error contacting Jenkins server. Could not download https://jenkins-abc3453.dev.rhcloud.com/jnlpJars/jenkins-cli.jar I assume this is timing related (DNS / jenkins server not yet available), but it prevents this function from working. Adding an arbitrary sleep is not a good solution. I'm assuming that once the jenkins server has been created, any failures in the client to install should be retried vs. failed (we know the server exists in the authoritative source). This blocks implementing any improved feature for enabling Jenkins in the UI.
This is currently as designed. You're not waiting for jenkins app to be resolvable. We can consider hosting the jar from another location.
Waiting for the jenkins app to become available is not reliable either. In a example code, that I intend to use in a blog post that show the openshift-java-client, I wait for the app that shall be built and wait for the jenkins-app to become reachable (dns + health-check - see here: https://github.com/adietish/enable-openshift-ci/blob/master/src/main/java/com/openshift/client/example/enableci/OpenShiftCI.java#L64). It turns out that I get the above error even then - not always but pretty frequently.
https://github.com/openshift/crankcase/pull/381
Created attachment 604881 [details] jenkins.log Tested on devenv_1977 Still can not embed jenkins client immediately after jenkins server is created. Steps: 1.Create an app 2.Create jenkins server app, and add jenkins-client-1.4 to app as soon as jenkins server is created rhc app create -a p1 -t php-5.3 -n --no-dns;rhc app create -a jks -t jenkins-1.4 -n --no-dns;rhc app cartridge add -a p1 -c jenkins-client-1.4 RESULT: Could not add job 'p1-build' in Jenkins server: create_job status: 503 You'll need to correct this error before attempting to embed the Jenkins client again.
Patch for fix in https://github.com/openshift/crankcase/pull/388
*** Bug 848715 has been marked as a duplicate of this bug. ***
verified Chandrikas-MacBook-Pro:automation chandrikagole$ rhc app create -a p1 -t php-5.3 -n --no-dns;rhc app create -a jks -t jenkins-1.4 -n --no-dns;rhc app cartridge add -a p1 -c jenkins-client-1.4 Password: Creating application: p1 in cgolert !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT: Since the -n flag was specified, no local repo has been created. This means you can't make changes to your published application until after you clone the repo yourself. See the git url below for more information. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! git url: ssh://c16cebc6b2744e9ea342debec92255ff.rhcloud.com/~/git/p1.git/ Successfully created application: p1 Password: Creating application: jks in cgolert !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT: Since the -n flag was specified, no local repo has been created. This means you can't make changes to your published application until after you clone the repo yourself. See the git url below for more information. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! git url: ssh://6db6f537739e48199a2943c513620ac0.rhcloud.com/~/git/jks.git/ Jenkins created successfully. Please make note of these credentials: User: admin Password: E3GC5LijqNa7 Note: You can change your password at: https://jks-cgolert.dev.rhcloud.com/me/configure Password: RESULT: Associated with existing job 'p1-build' in Jenkins server. If this was not intended you can remove the jenkins client, remove or rename the existing job, and re-add the jenkins client to get a new job created. Job URL: https://jks-cgolert.dev.rhcloud.com/job/p1-build/ Jenkins client 1.4 has been added to: p1
*** Bug 849024 has been marked as a duplicate of this bug. ***