How to un-installed Hudson service from nodes

scmuser created the topic: How to un-installed Hudson service from nodes
Hi,

Could you please let me know “How to un-installed Hudson service from nodes”?

-Sm

scmuser replied the topic: How to un-installed Hudson service from nodes
To uninstall the service, run hudson-slave.exe uninstall from the command line. The Hudson-slave executable can be found in the slave root directory. Note that you should run the uninstall from a admin command prompt on Windows 7 and the service will not be removed until the service is manually stopped or the Windows machine is re-booted. you can also manually uninstall the service using the command: sc delete Hudson Slave, again issue this from an admin console.

Tagged :

ERROR: Failed to create a service: Status Invalid Service Account

scmuser created the topic: ERROR: Failed to create a service: Status Invalid Service Account
Hi,

I am setting up the jenkins nodes in one machine where hudson nodes and services as already setup but getting following error ..
any clue —

ERROR: Failed to create a service: Status Invalid Service Account

scmuser replied the topic: ERROR: Failed to create a service: Status Invalid Service Account
Solution which i found is –

If you upgrade jenkins to latest versions, again ssh commands through windows will hang for the same reason mentioned above.
The fix is not to run Jenkins service as ‘Local user’. Now you can configure it through jenkins node configuration page.
Login to jenkins -> Manage Jenkins -> Manage Nodes -> Click on your node -> configure -> Run service as -> select ‘Log on using a different account’ ->
For ex:
User name: .\Administrator
pasword: ********

Note: .\ in user name is must , otherwise it fails with
ERROR: Failed to create a service: Status Invalid Service Account

Tagged :

Stderr: Error: unable to resolve reference refs – Not a directory

rajeshkumar created the topic: stderr: error: unable to resolve reference refs – Not a directory
Fetching changes from the remote Git repository
Fetching upstream changes from git@gitlab.XXX.XXXX.net:XXXXX
FATAL: Failed to fetch from git@gitlab.XXXX.XXXXX.XXX:sbfs/source-code.git
hudson.plugins.git.GitException: Failed to fetch from git@gitlab.XXXX.XXXXX.XXX:sbfs/source-code.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:625)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:847)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:872)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
at hudson.model.Run.execute(Run.java:1665)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.plugins.git.GitException: Command “git fetch –tags –progress git@gitlab.XXXX.XXXXX.XXX:sbfs/source-code.git +refs/heads/*:refs/remotes/origin/*” returned status code 1:
stdout:
stderr: error: unable to resolve reference refs/remotes/origin/release/v2222: Not a directory
From gitlab.XXXX.XXXXX.XXX:sbfs/source-code
! [new branch] release/v70 -> origin/release/v70 (unable to update local ref)
error: unable to resolve reference refs/remotes/origin/release/v71: Not a directory
! [new branch] release/v71 -> origin/release/v71 (unable to update local ref)
error: some local refs could not be updated; try running
‘git remote prune git@gitlab.XXXX.XXXXX.XXX:sbfs/source-code.git’ to remove any old, conflicting branches

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1086)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:968)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:197)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Jenkins Upgrade and Solution!!!

rajeshkumar created the topic: Jenkins Upgrade and Solution!!!
Issues 1: You will find these entry in jenkins log file which will take longer time to start the services of jenkins

SEVERE: org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not # (position: START_DOCUMENT seen #… @1:1)
Feb 25, 2014 2:12:56 AM hudson.plugins.testng.parser.ResultsParser log
SEVERE: org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not # (position: START_DOCUMENT seen #… @1:1)
Feb 25, 2014 2:12:56 AM hudson.plugins.testng.parser.ResultsParser log
SEVERE: org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not # (position: START_DOCUMENT seen #… @1:1)
Feb 25, 2014 2:12:57 AM hudson.plugins.testng.parser.ResultsParser log
SEVERE: org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not # (position: START_DOCUMENT seen #… @1:1)
Feb 25, 2014 2:12:57 AM hudson.plugins.testng.parser.ResultsParser log
SEVERE: org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not # (position: START_DOCUMENT seen #… @1:1)

Issues 2: Post upgrade, you will find under “Manage Jenkins” sections

You have data stored in an older format and/or unreadable data

Issues 3: Post upgrade, you will find under “Manage Jenkins” sections
It appears that your reverse proxy set up is broken.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Jenkins Upgrade and Solution!!!
Solution for Issues 2
To the right of that messages is a “Manage” button.. click that, and it
explains in great detail what this is about.

Once you will click on it, You may find information as below;

Manage Old Data

When there are changes in how data is stored on disk, Jenkins uses the following strategy: data is migrated to the new structure when it is loaded, but the file is not resaved in the new format. This allows for downgrading Jenkins if needed. However, it can also leave data on disk in the old format indefinitely. The table below lists files containing such data, and the Jenkins version(s) where the data structure was changed.

Sometimes errors occur while reading data (if a plugin adds some data and that plugin is later disabled, if migration code is not written for structure changes, or if Jenkins is downgraded after it has already written data not readable by the older version). These errors are logged, but the unreadable data is then skipped over, allowing Jenkins to startup and function properly.

Type Name Version

The form below may be used to resave these files in the current format. Doing so means a downgrade to a Jenkins release older than the selected version will not be able to read the data stored in the new format. Note that simply using Jenkins to create and configure jobs and run builds can save data that may not be readable by older Jenkins releases, even when this form is not used. Also if any unreadable data errors are reported in the right side of the table above, note that this data will be lost when the file is resaved.

Eventually the code supporting these data migrations may be removed. Compatibility will be retained for at least 150 releases since the structure change. Versions older than this are in bold above, and it is recommended to resave these files.
No old data was found.

Unreadable Data

It is acceptable to leave unreadable data in these files, as Jenkins will safely ignore it. To avoid the log messages at Jenkins startup you can permanently delete the unreadable data by resaving these files using the button below.
Type Name Error
hudson.maven.MavenModuleSet US-Harmony-E2E-C4-Regression MissingFieldException: No field ‘perModuleEmail’ found in class ‘hudson.maven.MavenModuleSet’
hudson.maven.MavenModuleSet DY-Classic-QA-US-trunk MissingFieldException: No field ‘perModuleEmail’ found in class ‘hudson.maven.MavenModuleSet’
hudson.maven.MavenModuleSet UK-Classic-E2E-C1-Regression MissingFieldException: No field ‘perModuleEmail’ found in class ‘hudson.maven.MavenModuleSet’
hudson.maven.MavenModuleSet CI-QE-FTU-Regression MissingFieldException: No field ‘perModuleEmail’ found in class ‘hudson.maven.MavenModuleSet’
hudson.maven.MavenModuleSet US-Classic-E2E-C4-Regression MissingFieldException: No field ‘perModuleEmail’ found in class ‘hudson.maven.MavenModuleSet’
hudson.maven.MavenModuleSet CI-QE-IPD-Smoke MissingFieldException: No field ‘perModuleEmail’ found in class ‘hudson.maven.MavenModuleSet’
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Jenkins Upgrade and Solution!!!
Solution 3: Post upgrade, you will find under “Manage Jenkins” sections
It appears that your reverse proxy set up is broken.

If you see the error message “It appears that your reverse proxy set up is broken” in the “Manage Jenkins” page, here’s what’s happening.

For a reverse proxy to work correctly, it needs to rewrite both the request and the response. Request rewriting involves receiving an inbound HTTP call and then make a forwarding request to Jenkins (sometimes with some HTTP headers modified, sometimes not.) Failing to configure the request rewriting is easy to catch, because you just won’t see any pages at all.

But proper reverse proxying also involves rewriting response. The primary place where this needs to happen is the “Location” header in the response, which is used during redirects. Jenkins would send back “Location: actual.server:8080/jenkins/foobar ” and the reverse proxy needs to rewrite this to “Location: nice.name/jenkins/foobar “. Unfortunately, failing to configure this correctly is harder to catch.

So Jenkins has a proactive monitoring to make sure this is configured correctly. It uses XmlHttpRequest to request a specific URL in Jenkins (via relative path, so this will always get through provided the request is properly rewritten), which will then redirect the user to another page in Jenkins (this works correctly only if you got the reponse rewriting configured correctly), which then returns 200.

This error message indicates that this test is failing. The most likely cause is that you got the response rewriting incorrectly done. See Running Jenkins behind Apache for additional tips about reverse proxy. While the page talks primarily about Apache, it has some information that applies to other reverse proxies.

For further diagnosis, try wget –no-check-certificate –debug -O /dev/null your.reverse.proxy/jenkins/administrativ…oxySetupMonitor/test (assuming your Jenkins should be visible at your.reverse.proxy/jenkins/ )

or using cURL:

curl -iL your.reverse.proxy/jenkins/administrativ…oxySetupMonitor/test
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Solution for database disk image is malformed during jenkins install

rajeshkumar created the topic: Solution for database disk image is malformed during jenkins install
Error – database disk image is malformed

Sol
# yum clean dbcache
# yum update

and you are done.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Check to see if a build is running or not

rajeshkumar created the topic: Check to see if a build is running or not
All I need to do is check to see if a build is running or not. To do that I used curl and grep, like this:

curl http://myjenkins/job/myjob/lastBuild/api/json | grep –color result\”:null

If a build is in progress, a grep for result\”:null will return 0.
If a build is finished, a grep for result\”:null will return 1.
Not especially elegant, but it works well enough for my needs.

For example, I have a Bash script that starts a build, then waits for it to finish:

JOB_URL=http://jenkins.local/job/stevehhhbuild
JOB_STATUS_URL=${JOB_URL}/lastBuild/api/json

GREP_RETURN_CODE=0

# Start the build
curl $JOB_URL/build?delay=0sec

# Poll every thirty seconds until the build is finished
while [ $GREP_RETURN_CODE -eq 0 ]
do
sleep 30
# Grep will return 0 while the build is running:
curl --silent $JOB_STATUS_URL | grep result\":null > /dev/null
GREP_RETURN_CODE=$?
done

echo Build finished

Reference – serverfault.com/questions/309848/how-can…49988bb53ee820fe202a
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Script to check the build status of a Jenkins job

Using JSON & Curl

BUILD_STATUS=$(curl --user USER:TOKEN_VALUE --silent $BUILD_URLapi/json | jq -r '.result')
echo $BUILD_STATUS

Using jenkins Plugins
Plugins Name – Conditional Build Step

For Implementations, Please check here.
https://stackoverflow.com/questions/11125598/getting-the-build-status-in-post-build-script

Using Python & Json

</pre>
#!/usr/bin/python
#
# author: ajs
# license: bsd
# copyright: re2

import json
import sys
import urllib
import urllib2

jenkinsUrl = "https://jenkins.example.com/job/"

if len( sys.argv ) > 1 :
jobName = sys.argv[1]
jobNameURL = urllib.quote(jobName)
else :
sys.exit(1)

try:
jenkinsStream = urllib2.urlopen( jenkinsUrl + jobNameURL + "/lastBuild/api/json" )
except urllib2.HTTPError, e:
print "URL Error: " + str(e.code)
print " (job name [" + jobName + "] probably wrong)"
sys.exit(2)

try:
buildStatusJson = json.load( jenkinsStream )
except:
print "Failed to parse json"
sys.exit(3)

if buildStatusJson.has_key( "result" ):
print "[" + jobName + "] build status: " + buildStatusJson["result"]
if buildStatusJson["result"] != "SUCCESS" :
exit(4)
else:
sys.exit(5)

sys.exit(0)

Reference -
<a href="http://serverfault.com/questions/309848/how-can...49988bb53ee820fe202a">serverfault.com/questions/309848/how-can...49988bb53ee820fe202a</a>
<pre>
Tagged :