Bug 891801

Summary: [fork][model refactor] Cannot add jenkins client to app
Product: OKD Reporter: Meng Bo <bmeng>
Component: PodAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: qgong, wsun, yujzhang
Target Milestone: ---Keywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-13 23:05:45 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
Add jenkins-client log that from development.log
none
Rhc domain show log that from development.log
none
development_log_on_forkami_389 none

Description Meng Bo 2013-01-04 03:07:18 UTC
Description of problem:
Create jenkins server and an other app, try to embed the jenkins client to the app. Cannot embed successfully.
Also cannot embed the jenkins client by --enable-jenkins command when creating app.

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

How reproducible:
always

Steps to Reproduce:
1.Create jenkins app
2.Create a php app
3.Embed jenkins client to the php app

  
Actual results:
Cannot embed the jenkins client to the app.

[bmeng@localhost openshift_testdir]$ rhc cartridge add jenkins-client-1.4 -a perl1 
Adding 'jenkins-client-1.4' to application 'perl1'
The server did not respond correctly. This may be an issue with the server configuration or with your connection to the server (such as a Web proxy or firewall).Please verify that you can access the OpenShift server https://<instance_dns>/broker/rest/domains/bmengdev/applications/perl1/cartridges


Expected results:
Jenkins client can be embedded successfully.

Additional info:
2013-01-03 21:55:16.128 [FATAL] Mongoid::Errors::DocumentNotFound (
Problem:
  Document not found for class ComponentInstance with attributes {:cartridge_name=>"jenkins-client-1.4", :component_name=>"jenkins-client-1.4"}.
Summary:
  When calling ComponentInstance.find_by with a hash of attributes, all attributes provided must match a document in the database or this error will be raised.
Resolution:
  Search for attributes that are in the database or set the Mongoid.raise_not_found_error configuration option to false, which will cause a nil to be returned instead of raising this error.):

Comment 1 Dan McPherson 2013-01-04 03:48:50 UTC
The error has changed in >= fork_ami_refctr1_374.  Now the client is failing to recognize the jenkins server is there.  Guessing it's because the env vars aren't being added as expected.

Comment 2 Yujie Zhang 2013-01-05 06:05:13 UTC
Tested this issue on fork_ami_refctr1_381 on website, when I tried to enable jenkins, the follwoing error message will be displayed:
Cartridge Invalid cartridge.Jenkins server does not exist! Please create with rhc app create -t jenkins-1.4

Comment 3 Dan McPherson 2013-01-06 05:22:53 UTC
Fixed in >= fork_ami_refctr1_382

Comment 4 Rony Gong 🔥 2013-01-08 06:36:33 UTC
Reopened on fork_ami_refctr1_387
Steps:
1.Create jenkins server application
2.Create python application
3.Add jenkins client to this python application:
[qgong@localhost dev]$ rhc cartridge add qpython -c jenkins-client-1.4
Adding 'jenkins-client-1.4' to application 'qpython' ... Invalid cartridge. Jenkins server does not exist!  Please create with rhc app create -t jenkins-1.4

Then my account cann't connect server well anymore.
4.rhc domain show -d
......
D, [2013-01-08T14:33:33.228670 #19107] DEBUG -- : Getting all applications for domain qgong15.......
D, [2013-01-08T14:33:33.228987 #19107] DEBUG -- : Request: #<RestClient::Request:0x7f5fb7a616e8 @password=nil, @ssl_ca_file=nil, @url="https://ec2-23-22-135-211.compute-1.amazonaws.com/broker/rest/domains
D, [2013-01-08T14:33:34.733837 #19107] DEBUG -- : Response: nil
D, [2013-01-08T14:33:34.733978 #19107] DEBUG -- : Response did not include a message from server: invalid character at "<!DOCTYPE "
D, [2013-01-08T14:33:34.734053 #19107] DEBUG -- : Response: 
The server did not respond correctly. This may be an issue with the server configuration or with your connection to the server (such as a Web proxy or firewall).Please verify that you can access the OpenShift server https://ec2-23-22-135-211.compute-1.amazonaws.com/broker/rest/domains/qgong15/applications

Could see detail from attachment.
1. The log when add jenkins-client 
2. The log whe rhc domain show

Comment 5 Rony Gong 🔥 2013-01-08 06:37:38 UTC
Created attachment 674517 [details]
Add jenkins-client log that from development.log

Comment 6 Rony Gong 🔥 2013-01-08 06:38:30 UTC
Created attachment 674518 [details]
Rhc domain show log that from development.log

Comment 7 Rony Gong 🔥 2013-01-08 06:42:15 UTC
Follow the comment 4

5. If delte the application data of that python app in mongodb manually, then rhc domain show could work well, my account could work well again.

Comment 8 joycezhang 2013-01-08 09:44:06 UTC
Created attachment 674641 [details]
development_log_on_forkami_389

It still couldn't work well on fork_ami_refctr1_389.  Jenkins client can be added to apps, but jenkins build is failed again. Please refer to the log as attahced.

Comment 9 Dan McPherson 2013-01-08 14:50:40 UTC
Adding the jenkins client is still only working in one direction.  Works if you add jenkins after python.  But not jenkins after python.

Comment 10 Dan McPherson 2013-01-08 15:01:08 UTC
Sorry that was supposed to say:   Works if you add jenkins after python.  But not jenkins before python.

Comment 11 Dan McPherson 2013-01-09 18:29:45 UTC
Fixed in >= fork_ami_refctr1_393

Comment 12 Wei Sun 2013-01-10 08:17:21 UTC
Verified in fork_ami_refctr1_395.
Can add jenkins-client-1.4 to app,and jenkins build  is successful