Bug 823720 - Adding a Jenkins client to an application immediately after the Jenkins server is created throws an exception
Adding a Jenkins client to an application immediately after the Jenkins serve...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Jhon Honce
libra bugs
: Triaged
: 848715 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-21 21:36 EDT by Clayton Coleman
Modified: 2015-05-14 18:54 EDT (History)
9 users (show)

See Also:
Fixed In Version: devenv_2013
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 17:29:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
jenkins.log (4.25 KB, text/x-log)
2012-08-16 06:35 EDT, Jianwei Hou
no flags Details

  None (edit)
Description Clayton Coleman 2012-05-21 21:36:27 EDT
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.
Comment 1 Dan McPherson 2012-05-22 10:27:53 EDT
This is currently as designed.  You're not waiting for jenkins app to be resolvable.  We can consider hosting the jar from another location.
Comment 2 Andre Dietisheim 2012-08-10 10:40:28 EDT
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.
Comment 3 Jhon Honce 2012-08-15 11:49:56 EDT
https://github.com/openshift/crankcase/pull/381
Comment 4 Jianwei Hou 2012-08-16 06:35:27 EDT
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.
Comment 5 Jhon Honce 2012-08-16 12:33:17 EDT
Patch for fix in https://github.com/openshift/crankcase/pull/388
Comment 6 Jhon Honce 2012-08-16 13:26:02 EDT
*** Bug 848715 has been marked as a duplicate of this bug. ***
Comment 7 Chandrika Gole 2012-08-16 17:37:44 EDT
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@p1-cgolert.dev.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@jks-cgolert.dev.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
Comment 8 Jhon Honce 2012-08-17 11:57:03 EDT
*** Bug 849024 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.