openshift / jenkins-cloud-plugin

OpenShift Origin Jenkins Cloud Plugin
Other
22 stars 20 forks source link

Openshift node not getting added. #21

Open imnilesh2 opened 10 years ago

imnilesh2 commented 10 years ago

I want to use the external jenkins to build my Java application and want to deploy my .war to Openshift's "jbossews-2.0" gear.

I have built this plugin using Maven and have placed the openshift.hpi file in my jenkins.

I have done following steps in my jenkins:

  1. I have added the Openshift cloud information like from Manage Jenkins: Openshift Username,password, broker hostname, broker port
  2. Created a build job with following values for openshift variables: a. Job/Project name: jbossews-2.0 b. Application UUID: jbossews-2.0 c. Buffersize: small d. Builder Timeout: 300000 e. Builder type: (empty)
  3. When I try to build the job, it fails with following enteries in Jenkins system.log:

Checking capacity Mar 26, 2014 6:31:03 PM INFO hudson.plugins.openshift.OpenShiftCloud hasCapacity User has consumed 3 of 100 gears. Mar 26, 2014 6:31:03 PM INFO hudson.plugins.openshift.OpenShiftCloud reloadConfig Reloading configuration for jbossews-2.0... Mar 26, 2014 6:31:03 PM WARNING hudson.plugins.openshift.OpenShiftCloud provision Caught java.net.MalformedURLException: For input string: "null". Will retry 1 more times before canceling build.

Above log entries show that the connection with the broker looks successful. According to source code of plugin, OpenShiftCloud.java tries to copy config.xml of an Jenkins job where it fails.

So, my questions;

  1. Do we need additional configuration on openshift side like pre-configured jenkins or something like that.
  2. Any more configuration required in my external Jenkins job?

Thanks in advance!

bparees commented 10 years ago

the application uuid needs to be the appuid from your openshift application deployment, it should look something like: 5332e493c10c1d0c5a000029 (do an rhc app show yourapp to find it)

I think you're also going to find the build script itself isn't going to be able to deploy the new artifact, unless you've edited it to fill in the UPSTREAM_SSH variable.

Ben Parees | OpenShift

----- Original Message -----

From: "imnilesh2" notifications@github.com To: "openshift/jenkins-cloud-plugin" jenkins-cloud-plugin@noreply.github.com Sent: Wednesday, March 26, 2014 9:10:08 AM Subject: [jenkins-cloud-plugin] Openshift node not getting added. (#21)

I want to use the external jenkins to build my Java application and want to deploy my .war to Openshift's "jbossews-2.0" gear.

I have built this plugin using Maven and have placed the openshift.hpi file in my jenkins.

I have done following steps in my jenkins:

  1. I have added the Openshift cloud information like from Manage Jenkins: Openshift Username,password, broker hostname, broker port
  2. Created a build job with following values for openshift variables: a. Job/Project name: jbossews-2.0 b. Application UUID: jbossews-2.0 c. Buffersize: small d. Builder Timeout: 300000 e. Builder type: (empty)
  3. When I try to build the job, it fails with following enteries in Jenkins system.log:

Checking capacity Mar 26, 2014 6:31:03 PM INFO hudson.plugins.openshift.OpenShiftCloud hasCapacity User has consumed 3 of 100 gears. Mar 26, 2014 6:31:03 PM INFO hudson.plugins.openshift.OpenShiftCloud reloadConfig Reloading configuration for jbossews-2.0... Mar 26, 2014 6:31:03 PM WARNING hudson.plugins.openshift.OpenShiftCloud provision Caught java.net.MalformedURLException: For input string: "null". Will retry 1 more times before canceling build.

Above log entries show that the connection with the broker looks successful. According to source code of plugin, OpenShiftCloud.java tries to copy config.xml of an Jenkins job where it fails.

So, my questions;

  1. Do we need additional configuration on openshift side like pre-configured jenkins or something like that.
  2. Any more configuration required in my external Jenkins job?

Thanks in advance!


Reply to this email directly or view it on GitHub: https://github.com/openshift/jenkins-cloud-plugin/issues/21

imnilesh2 commented 10 years ago

Thanks for UUID thing. I have an application pre-created with name 'testproject' with jbossews-2.0. I have enabled jenkins for it also.

Following further steps I did:

  1. Configure UUID 5333d12eac9410a68b000116 for the application in my external jenkins job property.
  2. Specify the Builder type as 'jbossews-2.0'

Still I get the same above error regarding the URL. Looking at the code of plugin(OpenShiftCloud.java), method reloadConfig() tries to copy config.xml. It expects the enviornment variables OPENSHIFT_JENKINS_IP, OPENSHIFT_JENKINS_PORT which are missing in my case.

I tried to hardcode ips and port associated with 'testproject-build' jenkins job. It is able to read the config.xml but again fails while posting the xml:

Connection to Jenkins is successful... Mar 27, 2014 5:51:23 PM INFO hudson.plugins.openshift.OpenShiftCloud reloadConfig Reloading config from XML: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

302 Found

Found

The document has moved here.


Apache/2.2.22 (Red Hat Enterprise Web Server) Server at jenkins-devops2.xx.xx.xxxx.com Port 80

Mar 27, 2014 5:51:23 PM INFO hudson.plugins.openshift.OpenShiftCloud createConnection Using credentials admin:2jrUUzRbzDE4 Mar 27, 2014 5:51:23 PM INFO hudson.plugins.openshift.OpenShiftCloud reloadConfig Reload ResponseCode: 302 Mar 27, 2014 5:51:23 PM WARNING hudson.plugins.openshift.OpenShiftCloud provision Caught java.lang.RuntimeException: Received an invalid response (302) while updating config XML. Server response: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

302 Found

Found

The document has moved here.


Apache/2.2.22 (Red Hat Enterprise Web Server) Server at jenkins-devops2.xx.xx.xxxx.com Port 80

Is it trying to copy the internal jenkins configuration to my external jenkins?

Can you please suggest further inputs on this ?

bparees commented 10 years ago

You should be getting a config xml back from that call, but you're getting a 302 redirect back instead from jenkins. The client then tries to upload that invalid XML content as the config content, which of course fails.

Not sure why you're getting the redirect from jenkins. It looks like maybe you're getting redirected to https.

Look for this line in your jenkins log to confirm the url the request is being sent to is otherwise correct.

INFO: Reloading configuration for php-build... Mar 27, 2014 5:58:57 PM hudson.plugins.openshift.OpenShiftCloud reloadConfig INFO: Retrieving config XML from http://127.1.247.1:8080/job/php-build/config.xml

There may be a jenkins setting you need to disable which is forcing https.

Ben Parees | OpenShift

----- Original Message -----

From: "imnilesh2" notifications@github.com To: "openshift/jenkins-cloud-plugin" jenkins-cloud-plugin@noreply.github.com Cc: "Ben Parees" bparees@redhat.com Sent: Thursday, March 27, 2014 9:43:44 AM Subject: Re: [jenkins-cloud-plugin] Openshift node not getting added. (#21)

Thanks for UUID thing. I have an application pre-created with name 'testproject' with jbossews-2.0. I have enabled jenkins for it also.

Following further steps I did:

  1. Configure UUID 5333d12eac9410a68b000116 for the application in my external jenkins job property.
  2. Specify the Builder type as 'jbossews-2.0'

Still I get the same above error regarding the URL. Looking at the code of plugin(OpenShiftCloud.java), method reloadConfig() tries to copy config.xml. It expects the enviornment variables OPENSHIFT_JENKINS_IP, OPENSHIFT_JENKINS_PORT which are missing in my case.

I tried to hardcode ips and port associated with 'testproject-build' jenkins job. It is able to read the config.xml but again fails while posting the xml:

Connection to Jenkins is successful... Mar 27, 2014 5:51:23 PM INFO hudson.plugins.openshift.OpenShiftCloud reloadConfig Reloading config from XML: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

302 Found

Found

The document has moved here.


Apache/2.2.22 (Red Hat Enterprise Web Server) Server at jenkins-devops2.xx.xx.xxxx.com Port 80

Mar 27, 2014 5:51:23 PM INFO hudson.plugins.openshift.OpenShiftCloud createConnection Using credentials admin:2jrUUzRbzDE4 Mar 27, 2014 5:51:23 PM INFO hudson.plugins.openshift.OpenShiftCloud reloadConfig Reload ResponseCode: 302 Mar 27, 2014 5:51:23 PM WARNING hudson.plugins.openshift.OpenShiftCloud provision Caught java.lang.RuntimeException: Received an invalid response (302) while updating config XML. Server response: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

302 Found

Found

The document has moved here.


Apache/2.2.22 (Red Hat Enterprise Web Server) Server at jenkins-devops2.xx.xx.xxxx.com Port 80

Is it trying to copy the internal jenkins configuration to my external jenkins?

Can you please suggest further inputs on this ?


Reply to this email directly or view it on GitHub: https://github.com/openshift/jenkins-cloud-plugin/issues/21#issuecomment-38803511