Bug 823720

Summary: Adding a Jenkins client to an application immediately after the Jenkins server is created throws an exception
Product: OKD Reporter: Clayton Coleman <ccoleman>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: adietish, cgole, dmace, jhonce, jhou, mgao, rmillner, wsun, xcoulon
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devenv_2013 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-17 21:29:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
jenkins.log none

Description Clayton Coleman 2012-05-22 01:36:27 UTC
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 14:27:53 UTC
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 14:40:28 UTC
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 15:49:56 UTC
https://github.com/openshift/crankcase/pull/381

Comment 4 Jianwei Hou 2012-08-16 10:35:27 UTC
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 16:33:17 UTC
Patch for fix in https://github.com/openshift/crankcase/pull/388

Comment 6 Jhon Honce 2012-08-16 17:26:02 UTC
*** Bug 848715 has been marked as a duplicate of this bug. ***

Comment 7 Chandrika Gole 2012-08-16 21:37:44 UTC
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

Comment 8 Jhon Honce 2012-08-17 15:57:03 UTC
*** Bug 849024 has been marked as a duplicate of this bug. ***