Score:0

Cannot Start Jenkins on Ubuntu 20.04

id flag

I had an old Jenkins running from the packages, and wanted to update to the latest version. According to https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-20-04, I executed:

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins

This went through well, but Jenkins wasn't able to start. Since the old Jenkins version was running on Java 8, and I needed Java 11, I updated /etc/init.d/jenkins (as described in https://stackoverflow.com/questions/39621263/jenkins-fails-when-running-service-start-jenkins):

JAVA=/usr/lib/jvm/java-11-openjdk-amd64/bin/java
#JAVA="/usr/lib/jvm/java-8-oracle/jre/bin/java"

But still, starting does not work:

sudo systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xe" for details.

Calling status returns the following:

sudo systemctl status jenkins.service
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/jenkins.service.d
             └─override.conf
     Active: failed (Result: exit-code) since Mon 2023-07-17 14:28:24 CEST; 20s ago
    Process: 125679 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
   Main PID: 125679 (code=exited, status=1/FAILURE)

Jul 17 14:28:24 irpsim.X.de systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 5.
Jul 17 14:28:24 irpsim.X.de systemd[1]: Stopped Jenkins Continuous Integration Server.
Jul 17 14:28:24 irpsim.X.de systemd[1]: jenkins.service: Start request repeated too quickly.
Jul 17 14:28:24 irpsim.X.de systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jul 17 14:28:24 irpsim.X.de systemd[1]: Failed to start Jenkins Continuous Integration Server.

As in the stackoverflow question, the journalctl didn`t really help:

Jul 17 14:28:24 X.uni-leipzig.de systemd[1]: jenkins.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit jenkins.service has entered the 'failed' state with result 'exit-code'.
Jul 17 14:28:24 X.uni-leipzig.de systemd[1]: Failed to start Jenkins Continuous Integration Server.
-- Subject: A start job for unit jenkins.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit jenkins.service has finished with a failure.
-- 
-- The job identifier is 48074 and the job result is failed.

I tried to su to jenkins, but its not allowed to start Jenkins there:

jenkins@irpsim:/home/dgr$ /etc/init.d/jenkins
The jenkins init script can only be run as root
jenkins@irpsim:/home/dgr$ exit
exit
root@irpsim:/home/dgr# /etc/init.d/jenkins start
Starting jenkins (via systemctl): jenkins.serviceJob for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xe" for details.

This seems to be an issue with the package and my configuration, but I cannot find another way to debug this. Is there maybe a known issue or some further way to further debug this?

EDIT: A similiar problem occured here (https://serverfault.com/questions/1051031/jenkins-installation-fails-on-ubuntu-20-04-with-dpkg-error-processing-package-j), but this could be fixed by updating Java. Since I have Java 11 installed and usable, I assume that this is not the problem.

cn flag
check `/var/log/jenkins/jenkins.log`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.