13

After downloading a plugin, the Jenkins server cannot be accessed. I am using windows 7. I tried to start windows Jenkins service manually, but I get the following message:

"Windows could not start the Jenkins service on Local COmputer. Error 1067: The process terminated unexpectedly"

I also tried to run the jenkins.exe from the installation directory, but with no success. In the error logs I see the following:

INFO: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
Ιουν 06, 2014 11:31:46 ΠΜ hudson.model.DownloadService$Downloadable doPostBack
INFO: Obtained the updated data file for hudson.tools.JDKInstaller
Ιουν 06, 2014 11:32:18 ΠΜ hudson.model.UpdateCenter doSafeRestart
INFO: Scheduling Jenkins reboot
Ιουν 06, 2014 11:33:00 ΠΜ hudson.model.UpdateCenter$DownloadJob run
INFO: Starting the installation of FTP-Publisher Plugin on behalf of anonymous
Ιουν 06, 2014 11:33:15 ΠΜ hudson.model.UpdateCenter doRestart
INFO: Scheduling the core downgrade
Ιουν 06, 2014 11:33:25 ΠΜ hudson.model.UpdateCenter$UpdateCenterConfiguration download
INFO: Downloading FTP-Publisher Plugin
Ιουν 06, 2014 11:33:26 ΠΜ hudson.model.UpdateCenter$HudsonDowngradeJob run
INFO: Starting the downgrade of jenkins.war on behalf of anonymous
Ιουν 06, 2014 11:33:26 ΠΜ jenkins.model.Jenkins$24 run
INFO: Restart in 10 seconds
Ιουν 06, 2014 11:33:26 ΠΜ hudson.model.UpdateCenter$HudsonDowngradeJob run
INFO: Downgrading successful: jenkins.war
Ιουν 06, 2014 11:33:36 ΠΜ jenkins.model.Jenkins$24 run
SEVERE: Restarting VM as requested by anonymous
Error: Unable to access jarfile D:\Program Files (x86)\Jenkins\jenkins.war
Error: Unable to access jarfile D:\Program Files (x86)\Jenkins\jenkins.war
Error: Unable to access jarfile D:\Program Files (x86)\Jenkins\jenkins.war

Can anyone help? We are at release point, and I have nowhere to run my tests..

gandalf_the_cool
  • 659
  • 2
  • 9
  • 23
  • obvious question but is the path at the bottom relating the the jenkin.war accurate, do you have permissions and is it available? – n34_panda Jun 06 '14 at 09:00
  • First try to launch it using command line as user. If start without errors it's a problem related with user permissions. – F.Rosado Jun 06 '14 at 09:03
  • I tried `D:\Program Files (x86)\Jenkins>java -jar jenkins.war Error: Unable to access jarfile jenkins.war` Is there a way to reinstall Jenkins without losing configuration? – gandalf_the_cool Jun 06 '14 at 09:15
  • 2
    I just saw that jenkins.war file is missing from the directory – gandalf_the_cool Jun 06 '14 at 09:22
  • you can copy the full directory jenkins/jobs to save configuration of every jobs. However, you will have to reinstall all plugins and perform again main conf. – aorfevre Jun 06 '14 at 22:22
  • In my case I had to get rid of the new jenkins.war file and replace it with jenkins.war.bak – DJ van Wyk Nov 02 '17 at 13:34

15 Answers15

15

Rather than guess which answer might be appropriate, you can check the jenkins.err.log file in the installation directory.

In my case, Jenkins complained about an unsupported JRE after an update. The fix was to download the required JRE, and tell jenkins.exe to use it by configuring the path in the jenkins.xml file.

Andreas Haferburg
  • 5,189
  • 3
  • 37
  • 63
4

Check the jenkins.xml there should be something wrong in config. In my case changing -Xmx2048m to -Xmx1024m fixed. Since it is not supported the 2m heap size.

<arguments>-Xrs -Xmx1024m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=9090</arguments>
Mesut GUNES
  • 7,089
  • 2
  • 32
  • 49
3

thanks a lot for your comments. Apparently the configuration was corrupted (missing war file) because a restart was made, while a plugin was being installed. For my good luck, when i tried to uninstall jenkins (to install it again), i hit the repair button, and all the missing files and configuration was restored. I have to give this point to windows OS :)

gandalf_the_cool
  • 659
  • 2
  • 9
  • 23
2

Execute this by providing absolute path of the war file java -jar

Sreedhar GS
  • 2,694
  • 1
  • 24
  • 26
2
  1. Download jenkins.war at https://updates.jenkins-ci.org/download/war/

  2. Put jenkins.war to <jenkins root folder>

  3. Restart jenkins service

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
176coding
  • 2,933
  • 4
  • 17
  • 18
2

I am added --enable-future-java flag after path to Jenkins.war and it successfully starts

Julien
  • 2,544
  • 1
  • 20
  • 25
Restonov
  • 21
  • 3
1

This error usually shows, when you don't have Java on your machine. Jenkins relay on Java.

Follow these steps to fix the issue:

sudo yum install java-1.8.0-openjdk
systemctl enable jenkins
systemctl start jenkins
systemctl status jenkins

Hopefully it will help.

1

Go and check with an environment variable in _JAVA_OPTIONS value, if the value is more then -xmx256m or -xmx512m then change it to one of these value. it has worked for me

phwt
  • 1,356
  • 1
  • 22
  • 42
ravi pawar
  • 11
  • 2
  • I have changed the xmx in order to increase memory for Jenkins and encountered the same problem, works fine after a revert, that was the right thing to do...thanks a lot ! – Shessuky Jan 19 '21 at 09:31
0

If you have installed jenkins with msi (jenkins.msi), run the repair. That is run the file jenkins.msi again and choose to repair.

After the repair completes successfully it will start the service automatically.

Worked in my case! Had the same problem.

Jaydeep Ranipa
  • 421
  • 5
  • 16
0

I has a similar challenge today, on inspection of the Jenkins installation directory, I discovered a backup copy jenkins.war.bak. Therefore, I simply copied the file and renamed it to jenkins.war, and started jenkins and voila, everything worked normally.

Andreas Haferburg
  • 5,189
  • 3
  • 37
  • 63
SyCode
  • 1,077
  • 4
  • 22
  • 33
0

Please take a look of jenkins.err text file from the .jenkins folder for the actual error.

For me it was related to JVM. i had to change value from JAVA_OPTIONS, previous it was jdk path so i changed it to value -Xmx512M.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
atul parate
  • 760
  • 5
  • 5
0

Open your c and users and PC name. Delete the .jerkins folder and Restart the CMD Action again. IT will be work Dont worry.

Note : Suppose if you are work in IT Company, there is some port specialities were removed. So use the port number which is permit your office. For Example : java -jar jerkins.war --httpPort=3000

Enjoy...............

Vijay
  • 11
  • 2
0

I Installed JDK 8 instead of JDK 13, and, that is working well

Wang Liang
  • 4,244
  • 6
  • 22
  • 45
0

Currently, the java version should not be greater than 8 (Why?). (If it is, download from here and simply re-point your $JAVA_HOME to the current JRE.) (Refer: https://stackoverflow.com/a/26640589/3375356) enter image description here

Preferably install using WAR file instead of installing it as a Windows service as that would require that account that runs Jenkins to have permission to log in as a service.

  • cd to the path where jenkins.war file is kept and run java -jar jenkins.war.

Or

  • Change the JRE path, if installing using jenkins.msi enter image description here
AatmanKothari
  • 103
  • 2
  • 9
0

I was facing same issue due to the older 1.8 version of custom JDK, but got it resolved by changing the java path in jenkins.xml <executable>update here\jdk-11.0.16.1_windows-x64_bin\jdk-11.0.16.1\bin\java.exe</executable>