Jenkins service does not start on windows 2008

I am trying to install Jenkins as a service in Datacenter Windows Server 2008 (SP2). I can't seem to get it to work as a service, and I'm looking for ideas to help them with that.

When I try to install Jenkins with a native Windows package, I get "Error 1920. The Jenkins service did not start." in msiexec magazines.

I have completed the following steps for manual installation:

  • Installed java 32 bit
  • Jenkins started with java -jar jenkins.war
  • Left to manage Jenkins and configure it to run as a Windows service.
  • Jenkins said restarting himself as a service.

At this moment, Jenkins dies and does not return.

When I try to start Jenkins manually, I get error 1053 (the service did not respond). I cannot determine the log files or other information.

Any ideas or suggestions are welcome, I will also be interested to hear from anyone who received it on this O / S (or Windows 2003 server).

Many thanks

+4
source share
7 answers

Version 1.498 has a stronger defense that can break Jenkins' slavery as a service.

https://issues.jenkins-ci.org/browse/JENKINS-16273

Recommendations include:

  • Stop service
  • Delete the service if dos exists ( sc delete jenkinsslave-C__Jenkins )
  • Delete the old jenkins-slave.exe, slave.jar and jenkins-slave.xml
  • Launch the web client and let it install the service
  • Edit jenkins-slave.xml so it looks like this: the important part is jnlpCredentials <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpCredentials <user>:<password> -jnlpUrl http://<your server>/computer/<slave name>/slave-agent.jnlp</arguments>

I found that removing slave.jar and starting the web client when the user logged in worked better, you get the secret and don’t need to edit the XML.

If I do not delete slave.jar, then I found that editing jenkins-slave.xml and deleting secret in arguments works without any credentials at all (security hole?). See Jenkins-slave.err

 "-secret" is not a valid option 

<strong> jenkins-slave.xml

 ... <service> <id>jenkinsslave-D__Jenkins</id> <name>Jenkins Slave</name> ... <executable>C:\Program Files\Java\jre7\bin\java.exe</executable> <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl http://jenkins.domain/jenkins/computer/mycomputername/slave-agent.jnlp </arguments> <!-- -secret fafd7bf18fdcc48ffb17fe1ff0a072ce5d33b004769b351e9d633f875b63fb59 --> ... 
+4
source

I had similar problems on a Windows 2003 server. I already installed .net framwork 4.0, but jenkins (v1.4.60) does not work with this environment. After installing .net framework 2.0 (v2.0.50727) the problem was resolved.

+1
source

Suggestion: if you can avoid this at all, do not run Jenkins as a service on Windows - you may run into all the problems associated with permissions and running in the background. The disadvantage is that it does not start automatically when the machine restarts, but most often you can live with it. In my experience, Jenkins is very solid as far as this can be a problem. If you want to be more careful, write a wrapper that checks everything so often that Jenkins is alive (say, by trying to connect to it via HTTP) and restarts it if he died.

Attached Python script file that does this (no guarantees, obligations, etc.):

 '''Usage: hudson.py [<http-port>]''' # Script to start/revive Hudson/Jenkins # The script checks if Hudson is alive by trying to connect to its HTTP port # if connection fails - it tries to restart Hudson import sys import time import httplib import os HTTPTimeout = 10 CheckInterval = 300 DefaultHudsonPort = 8081 if (__name__ == '__main__'): if len(sys.argv) > 2: print __doc__ sys.exit(1) elif len(sys.argv) == 2: portNum = int(sys.argv[1]) else: portNum = DefaultHudsonPort httpConnection = None while True: if not httpConnection: httpConnection = httplib.HTTPConnection("127.0.0.1", portNum, timeout = HTTPTimeout) try: httpConnection.connect() httpConnection.close() except: print "(Re)Starting Hudson/Jenkins on port %d" % portNum os.system("java -jar hudson.war --httpPort=%d" % portNum) time.sleep(CheckInterval) 
0
source

I had the same problem, but for me it is a problem with the jenkins.xml configuration file. It was not valid XML, and therefore Jenkins could not load it correctly. I found that it was a configuration error by running jenkins.exe on the command line as an administrator, this gave me the correct error output.

0
source

I found the default setting for the Jenkins service to allow only 256 m HEAP. I think they expected that we would only encode "Hello World". I found this after random PermGen errors. But I found that I can not fix jenkins.xml with everyone,

 -Xrs -Xms<value> -Xmx<value> --XX:PermSize=<value> --XX:MaxPermSize=<value> 

I could only run Jenkins on setup,

 -Xrs -Xms<value> -XX:MaxPermSize=<value> 
0
source

I have the same problem and solved by setting the dir path for Java.

0
source

The answer provided by KCD is complete and highly relevant. But sometimes we encounter this problem due to a stupid mistake too.

I also had a similar problem when I received an error message when I initiated Jenkins from COMMAND PROMPT.

The team I joined was

 $: start jenkins.exe 

After I passed my own notes, I found the problem much easier. I used the command incorrectly. It should have been:

 $: jenkins.exe start/stop/restart 

With the correct input of commands, the problem is resolved.

-one
source

Source: https://habr.com/ru/post/1395230/


All Articles