简体   繁体   中英

Jenkins failed to start in linux

go to run jenkins after doing an upgrade, and get the following:

start jenkins
start: Job failed to start

That's it...nothing shows up in jenkin's log...so it is difficult to debug to say the least. (and it isn't running already, or anything like that).

Is there another log somewhere that I should be looking at that would be helpful? (I am assuming answer to this problem will be somewhat iterative, so hopefully someone can start me on a path to debug this)

So, knowing it was a pre-start error allowed me to investigate more deeply.

Further digging allowed me to figure out that the exact line in the /etc/init/jenkins.conf file was one pointing to the /usr/share/jenkins/bin/maintain-plugins.sh

Looking at this location, I found it was not present (ie. no bin directory). This means that jenkins-common was no longer installed for some reason...odd indeed...going into apt-get and doing an install of this component again led to the error:

dpkg error processing /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb ...

having seen this error before and refreshing my memory via google gave the following solution:

dpkg -i --force-overwrite /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb

This allowed the installation of common to proceed as normal. After this, all I had to do was replace the /usr/share/jenkins/jenkins.war with my backed up copy (because ubuntu is far behind the latest release version), and I was able to start the server again.

I am not exactly sure what caused the problem to begin with, but it was likely during an apt-get upgrade/clean process...and because of the weirdness with jenkins conflicting with jenkins-common, it did not repopulate the /usr/share/jenkins directory properly.

regardless, am glad it is working again. :)

Instead, you can run the following before the install to properly clean up any conffiles left by the distro version:

sudo apt-get purge jenkins

Then install the correct version.

I went to see the jenkins logs tail -f /var/log/jenkins/jenkins.log

In my case it didn't start because I used incompatible java version. Update and make sure it sees correct java (In my case it should have been opened using JRE 1.7. To check, please use java -version command) and all should work

The following worked for me:

sudo rm /etc/init/jenkins.conf
sudo update-rc.d jenkins defaults
sudo service jenkins start

Then....

root@core:/# service jenkins start
* Starting Jenkins Continuous Integration Server jenkins                    [ OK ] 

Borrowed from: https://groups.google.com/forum/#!msg/jenkinsci-users/eW_yEWLojFc/tFhb8DKoRHUJ

Ubuntu 18.04 LTS use Java 9 as default java

Jenkins 2.107.2 still use Java 8

[Solution]

Install Java 8 before install Jenkins

sudo add-apt-repository ppa:webupd8team/java
sudo apt install oracle-java8-installer
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
sudo apt install jenkins

See https://stackoverflow.com/a/49937744/900684

I got from this link: https://serverfault.com/questions/710680/jenkins-not-starting-in-ubuntu

It might be caused by a full disk. To be really sure, try running it manually. Like this: /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM