Cannot start Jenkins service in Windows after updates

22,290

Solution 1

I had the same problem. It appeared that the java runtime enviromment had been updated. In the jenkins installation folder there is as jenkins.wrapper.log. This contains logging from the jenkins.exe service wrapper. In my case it tried to start java from c:\Program Files\Java\jre1.8.0_144\bin. This folder did not exist, instead, java was installed in c:\Program Files\Java\jre1.8.0_161\bin.

In the jenkins installation folder there is also a jenkins.xml. This contains the reference to the java installation in the tag. Change it to your current java installation and it will start again.

Solution 2

I also had this problem after each java update. But there is a version-independent absolute path, that can be used to start the java run-time: C:\ProgramData\Oracle\Java\javapath\java.exe.

I changed jenkins-slave.xml to use this path:

<executable>C:\ProgramData\Oracle\Java\javapath\java.exe</executable>

Solution 3

if your java path is correct, disable RunawayProcessKiller in jenkins.xml

extension enabled="**false**" className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension"

Solution 4

If the java.exe path is setup correctly in the jenkins.xml/jenkins-slave.xml file and the problem persists, then try to delete the jenkins_agent.pid file and restart the service.

Solution 5

In my case this happened after I installed some updates on my machine. After some research (jenkins.err.log) it turned out that some other application grabbed the port 8080 that was used by Jenkins up to this point.

I managed to identify the app (with TcpView) and disabled it.

Problem solved.

Share:
22,290

Related videos on Youtube

koxta
Author by

koxta

Updated on July 09, 2022

Comments

  • koxta
    koxta almost 2 years

    I have Jenkins running on Windows as a service. Normally, it starts when machine starts.

    After a Windows recommended update this afternoon, and a machine restart, my Jenkins just stopped working.

    I start the service but it stops and shows the following warning:

    "The Jenkins service on Local Computer started and then stopped. Some 
    services stop automatically if they are not in use by other services or 
    programs."
    

    There is no "jenkins.err.log" file and if I start Jenkins with "java jenkins.war" It works fine.

    Any tip whats going on? How to fix this? Please help.

    Thank you very much.

    • Chandra Sekhar Y
      Chandra Sekhar Y over 6 years
      Start the Services Manually and change the Open to Manually which default is Automatic in Services on Windows.
  • DaveyDaveDave
    DaveyDaveDave over 5 years
    The question says "I start the service but it stops and shows the following warning"
  • koxta
    koxta over 5 years
    Hello Ajit, sorry but this wont work. The question says "I start the service but it stops" so restart/start wont work because the service was starting with the wrong java version. Already solved. Thanks for the contribution.
  • David
    David over 4 years
    My issue was also a runaway path related to the jenkins.pid. Instead of disabling the process killer, you can find the offending hung process or reboot your server.
  • Bisneto
    Bisneto about 3 years
    Amazing! Great!
  • Amol Thakurdware
    Amol Thakurdware almost 2 years
    This video will also help you: youtu.be/0q_iZ9a3HJE