Bug 870258 - rhc option --enable-jenkins jenkins does not create jenkins server
rhc option --enable-jenkins jenkins does not create jenkins server
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-25 20:14 EDT by Peter Ruan
Modified: 2015-05-14 19:01 EDT (History)
3 users (show)

See Also:
Fixed In Version: devenv_2422
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:49:13 EST
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)
log (17.86 KB, text/x-log)
2012-10-31 12:40 EDT, Fabiano Franz
no flags Details

  None (edit)
Description Peter Ruan 2012-10-25 20:14:00 EDT
Description of problem:
rhc option --enable-jenkins jenkins does not create jenkins server when run under Origin/On-Premise build

Version-Release number of selected component (if applicable):


How reproducible:

always

Steps to Reproduce:
1. rhc app create app1 php-5.3 -padmin --enable-jenkins jenkins -s
2.
3.
  
Actual results:
the jenkins server is not created.

Expected results:
app1 @ http://app1-pr3.dev.rhcloud.com/
=======================================
Created: 7:29 PM
   UUID: 6dd0bcb00aab4d4781618d731a88cde9
Git URL: ssh://6dd0bcb00aab4d4781618d731a88cde9@app1-pr3.dev.rhcloud.com/~/git/app1.git/
SSH URL: ssh://6dd0bcb00aab4d4781618d731a88cde9@app1-pr3.dev.rhcloud.com

Cartridges:
  php-5.3
  haproxy-1.4
  jenkins-client-1.4 - https://jenkins-pr3.dev.rhcloud.com/job/app1-build/
RESULT:
Application app1 was created.


Additional info:
Comment 1 Wei Sun 2012-10-26 06:54:14 EDT
I test this bug on http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/Beta/2012-10-25.1/

can create jenkins server and add jenkins-client successfully.But have some warning.
Result:

[root@F17x64-openshift onpremise]# rhc app create app2 php-5.3 --enable-jenkins jenkins -s
Password: ******

Creating application 'app2'
===========================

  Namespace: wsunop26
  Cartridge: php-5.3
  Gear Size: default
  Scaling:   yes

Your application's domain name is being propagated worldwide (this might take a minute)...
Your application's domain name is being propagated worldwide (this might take a minute)...
DEBUG: Running config_ssh_key_stage
DEBUG: Running upload_ssh_key_stage
The authenticity of host 'app2-wsunop26.example.com (10.66.79.70)' can't be established.
RSA key fingerprint is c0:de:72:f4:0e:8f:e7:77:63:5d:5c:a1:d1:e7:7e:01.
Are you sure you want to continue connecting (yes/no)? yes
Cloning into 'app2'...
done

app2 @ http://app2-wsunop26.example.com/
========================================
  Created: 12:51 AM
     UUID: 300d644d0e4d48479d78caf015a1a8b9
Gear Size: small
 Scalable: true
  Git URL: ssh://300d644d0e4d48479d78caf015a1a8b9@app2-wsunop26.example.com/~/git/app2.git/
  SSH URL: ssh://300d644d0e4d48479d78caf015a1a8b9@app2-wsunop26.example.com

Cartridges:
  php-5.3
  haproxy-1.4
  jenkins-client-1.4 - https://jenkins-wsunop26.example.com/job/app2-build/
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:  Your application was created successfully but had problems during
          configuration. Below is a list of the issues and steps you can
          take to complete the configuration of your application.

  Application URL: http://app2-wsunop26.example.com/

  Issues:
    1. Jenkins client failed to install - Connection to server timed out. It is possible the operation finished without
being able to report success. Use 'rhc domain show' or 'rhc app status' to check the status of your applications.

  Steps to complete your configuration:
    1. Install the jenkins client
      $ rhc cartridge add jenkins-client -a app2

  If you can't get your application 'app2' running in the browser,
  you can try destroying and recreating the application:

    $ rhc app delete app2 --confirm

  If this doesn't work for you, let us know in the forums or in IRC and we'll
  make sure to get you up and running.

    Forums - https://openshift.redhat.com/community/forums/openshift
    IRC - #openshift (on Freenode)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


[root@F17x64-openshift ~]# rhc domain show -p redhat

Applications in wsunop26:

app2 @ http://app2-wsunop26.example.com/
========================================
  Created: 12:51 AM
     UUID: 300d644d0e4d48479d78caf015a1a8b9
Gear Size: small
 Scalable: true
  Git URL: ssh://300d644d0e4d48479d78caf015a1a8b9@app2-wsunop26.example.com/~/git/app2.git/
  SSH URL: ssh://300d644d0e4d48479d78caf015a1a8b9@app2-wsunop26.example.com

Cartridges:
  php-5.3
  haproxy-1.4
  jenkins-client-1.4 - https://jenkins-wsunop26.example.com/job/app2-build/


jenkins @ http://jenkins-wsunop26.example.com/
==============================================
  Created: 12:51 AM
     UUID: 510198a528a24927ae372d4f4dcbe46d
Gear Size: small
 Scalable: false
  Git URL: ssh://510198a528a24927ae372d4f4dcbe46d@jenkins-wsunop26.example.com/~/git/jenkins.git/
  SSH URL: ssh://510198a528a24927ae372d4f4dcbe46d@jenkins-wsunop26.example.com

Cartridges:
  jenkins-1.4
Comment 2 Rob Millner 2012-10-26 14:48:15 EDT
This looks like its an issue with the Jenkins cartridge in the OnPrem environment.
Comment 3 Bill DeCoste 2012-10-29 13:21:34 EDT
This is also broken in a devenv
Comment 4 Bill DeCoste 2012-10-30 15:30:13 EDT
--enable-jenkins, --no-git, --gear-size all have dashes but we are checking values with underscores so they are always null in the rhc app.rb class
Comment 5 Fabiano Franz 2012-10-31 10:31:13 EDT
ffranz@ffranz rhc$ rhc app create test6 php-5.3 --enable-jenkins jenkins --no-git --gear-size small
Creating application 'test6'
============================

  Namespace: test5
  Cartridge: php-5.3
  Gear Size: small
  Scaling:   no

Your application's domain name is being propagated worldwide (this might take a minute)...
Your application's domain name is being propagated worldwide (this might take a minute)...
test6 @ http://test6-test5.dev.rhcloud.com/
===========================================
  Application Info
  ================
    Created   = 10:28 AM
    UUID      = a09ea4fab7a94c26bedb1294b195cc4c
    Gear Size = small
    Git URL   = ssh://a09ea4fab7a94c26bedb1294b195cc4c@test6-test5.dev.rhcloud.com/~/git/test6.git/
    SSH URL   = ssh://a09ea4fab7a94c26bedb1294b195cc4c@test6-test5.dev.rhcloud.com
  Cartridges
  ==========
    php-5.3
    jenkins-client-1.4 = https://jenkins-test5.dev.rhcloud.com/job/test6-build/

RESULT:
Application test6 was created.
Comment 6 Fabiano Franz 2012-10-31 10:57:50 EDT
Checking values with underscores is the correct behaviour, we change dashes to underscores because ruby does not allow method names with dashes. So options are being handled correctly. Also, it seems the error only occurs when creating a scaling app with Jenkins, non-scaling apps go just fine. Digging a little deeper to understand the problem.
Comment 7 Fabiano Franz 2012-10-31 12:10:33 EDT
This problem happens because scalable apps takes time to create and propagate dns, many times resulting in the following flow (see the attached debug output for details):

 1. start creating <scalable app>
 2. start creating <jenkins app>
 3. finish creating <jenkins app>
 4. start adding <jenkins cartridge> to <scalable app>
 4.1. ERROR adding <jenkins cartridge>: <scalable app> creation is not finished (in fact usually finished but dns is not yet propagated)
 5. finish creating <scalable app>

A simple sleep(30) before setup_jenkins_client makes it pass.

Now to research a better fix.
Comment 8 Fabiano Franz 2012-10-31 12:40:36 EDT
Created attachment 636214 [details]
log
Comment 9 Fabiano Franz 2012-10-31 12:58:35 EDT
Additional issue: when the Jenkins app name was not specified (just using --enable-jenkins flag instead of --enable-jenkins <name>) it should default the jenkins app name to "jenkins".
Comment 10 Fabiano Franz 2012-11-01 17:00:22 EDT
Fixed in fork_ami_BZ870258.
Comment 11 Chandrika Gole 2012-11-01 18:26:32 EDT
Tried this on fork_ami_BZ870258 and still seeing the warning msg in Comment 1. ffranz working on a fix and a new ami

Command  - 

rhc app create app1 php-5.3 -padmin --enable-jenkins jenkins -s

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:  Your application was created successfully but had problems during
          configuration. Below is a list of the issues and steps you can
          take to complete the configuration of your application.

  Application URL: http://app1-cgolexv.dev.rhcloud.com/

  Issues:
    1. We were unable to clone your application's git repo - Error in git clone - fatal: destination path 'app1' already exists and is not an empty directory.

  Steps to complete your configuration:
    1. Clone your git repo
      $ rhc app git-clone app1

  If you can't get your application 'app1' running in the browser,
  you can try destroying and recreating the application:

    $ rhc app delete app1 --confirm

  If this doesn't work for you, let us know in the forums or in IRC and we'll
  make sure to get you up and running.

    Forums - https://openshift.redhat.com/community/forums/openshift
    IRC - #openshift (on Freenode)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Comment 12 Fabiano Franz 2012-11-01 21:05:25 EDT
Fixed in devenv_2422.
Comment 13 Fabiano Franz 2012-11-01 21:12:08 EDT
In fact that warning message is related to git (trying to clone when a directory with the same name already exists). I suggest using --no-git option or removing the <appname> directory before running the command.

(In reply to comment #11)
> Tried this on fork_ami_BZ870258 and still seeing the warning msg in Comment
> 1. ffranz working on a fix and a new ami
> 
> Command  - 
> 
> rhc app create app1 php-5.3 -padmin --enable-jenkins jenkins -s
> 
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> WARNING:  Your application was created successfully but had problems during
>           configuration. Below is a list of the issues and steps you can
>           take to complete the configuration of your application.
> 
>   Application URL: http://app1-cgolexv.dev.rhcloud.com/
> 
>   Issues:
>     1. We were unable to clone your application's git repo - Error in git
> clone - fatal: destination path 'app1' already exists and is not an empty
> directory.
> 
>   Steps to complete your configuration:
>     1. Clone your git repo
>       $ rhc app git-clone app1
> 
>   If you can't get your application 'app1' running in the browser,
>   you can try destroying and recreating the application:
> 
>     $ rhc app delete app1 --confirm
> 
>   If this doesn't work for you, let us know in the forums or in IRC and we'll
>   make sure to get you up and running.
> 
>     Forums - https://openshift.redhat.com/community/forums/openshift
>     IRC - #openshift (on Freenode)
> 
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Comment 14 Wei Sun 2012-11-01 23:07:27 EDT
verified on devenv-stage_242
rhc 1.0.4

Result:
C:\Users\Win7x64\test\dev>rhc app create r9s ruby-1.9  --enable-jenkins jenkins
-s
Password:

Creating application 'r9s'
==========================

  Namespace: wsundevstg1102
  Cartridge: ruby-1.9
  Gear Size: default
  Scaling:   yes

Jenkins domain name is being propagated worldwide (this might take a minute)...
Your application's domain name is being propagated worldwide (this might take a
minute)...
Cloning into 'r9s'...
r9s @ http://r9s-wsundevstg1102.dev.rhcloud.com/
================================================
  Application Info
  ================
    Created   = Nov 01 10:57 PM
    UUID      = 35565ab5043e41c9ab171877d5cda2c5
    Gear Size = small
    Git URL   =
ssh://35565ab5043e41c9ab171877d5cda2c5@r9s-wsundevstg1102.dev.rhcloud.com/~/git/

r9s.git/
    SSH URL   =
ssh://35565ab5043e41c9ab171877d5cda2c5@r9s-wsundevstg1102.dev.rhcloud.com
  Cartridges
  ==========
    ruby-1.9
    jenkins-client-1.4 =
https://jenkins-wsundevstg1102.dev.rhcloud.com/job/r9s-build/
    haproxy-1.4
  Scaling Info
  ============
    Scaled x2 (minimum: 2, maximum: available gears) with haproxy-1.4 on small
gears

RESULT:
Application r9s was created.
Application jenkins was created.

Jenkins created successfully.  Please make note of these credentials:

   User: admin
   Password: kyV8eczcCHxV

Note:  You can change your password at:
https://jenkins-wsundevstg1102.dev.rhcloud.com/me/configure


C:\Users\Win7x64\test\dev>rhc domain show
Password: ******

Applications in wsundevstg1102
==============================

  r9s @ http://r9s-wsundevstg1102.dev.rhcloud.com/
  ================================================
    Application Info
    ================
      Created   = Nov 01 10:57 PM
      UUID      = 35565ab5043e41c9ab171877d5cda2c5
      Gear Size = small
      Git URL   =
ssh://35565ab5043e41c9ab171877d5cda2c5@r9s-wsundevstg1102.dev.rhcloud.com/~/git/

r9s.git/
      SSH URL   =
ssh://35565ab5043e41c9ab171877d5cda2c5@r9s-wsundevstg1102.dev.rhcloud.com
    Cartridges
    ==========
      ruby-1.9
      jenkins-client-1.4 =
https://jenkins-wsundevstg1102.dev.rhcloud.com/job/r9s-build/
      haproxy-1.4
    Scaling Info
    ============
      Scaled x2 (minimum: 2, maximum: available gears) with haproxy-1.4 on small

gears

  jenkins @ http://jenkins-wsundevstg1102.dev.rhcloud.com/
  ========================================================
    Application Info
    ================
      Created   = Nov 01 10:59 PM
      UUID      = 3082508af89c4c74991a13ed0495123f
      Gear Size = small
      Git URL   =
ssh://3082508af89c4c74991a13ed0495123f@jenkins-wsundevstg1102.dev.rhcloud.com/~/

git/jenkins.git/
      SSH URL   =
ssh://3082508af89c4c74991a13ed0495123f@jenkins-wsundevstg1102.dev.rhcloud.com
    Cartridges
    ==========
      jenkins-1.4

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