-->
🏠 🔍
SHAREOLITE

SOLVED Jenkins service not starting after install

Issue faced on a Linux platform , after installing Jenkins - when trying to start Jenkins service - service is not getting started and reporting an error.

[root@shareolite bin]# 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.


[root@shareolite bin]# systemctl status jenkins.service
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Tue 2022-08-09 00:30:44 IST; 4s ago
  Process: 20744 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
 Main PID: 20744 (code=exited, status=1/FAILURE)

Aug 09 00:30:44 shareolite systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Aug 09 00:30:44 shareolite systemd[1]: Failed to start Jenkins Continuous Integration Server.
Aug 09 00:30:44 shareolite systemd[1]: Unit jenkins.service entered failed state.
Aug 09 00:30:44 shareolite systemd[1]: jenkins.service failed.
Aug 09 00:30:44 shareolite systemd[1]: jenkins.service holdoff time over, scheduling restart.
Aug 09 00:30:44 shareolite systemd[1]: Stopped Jenkins Continuous Integration Server.
Aug 09 00:30:44 shareolite systemd[1]: start request repeated too quickly for jenkins.service
Aug 09 00:30:44 shareolite systemd[1]: Failed to start Jenkins Continuous Integration Server.
Aug 09 00:30:44 shareolite systemd[1]: Unit jenkins.service entered failed state.
Aug 09 00:30:44 shareolite systemd[1]: jenkins.service failed.


[root@shareolite bin]# journalctl -xe
--
-- Unit jenkins.service has begun starting up.
Aug 09 00:30:44 shareolite jenkins[20744]: jenkins: invalid Java version: java version "1.7.0_191"
Aug 09 00:30:44 shareolite jenkins[20744]: OpenJDK Runtime Environment (rhel-2.6.15.5.el7-x86_64 u191-b01)
Aug 09 00:30:44 shareolite jenkins[20744]: OpenJDK 64-Bit Server VM (build 24.191-b01, mixed mode)
Aug 09 00:30:44 shareolite systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Aug 09 00:30:44 shareolite systemd[1]: Failed to start Jenkins Continuous Integration Server.
-- Subject: Unit jenkins.service has failed
-- Defined-By: systemd
-- Unit jenkins.service has failed.
-- The result is failed.

SOLVED Jenkins service not starting after install


On review , it was observed multiple Java JDK versions were present and by default the older version was referred.

[root@shareolite bin]# rpm -qa |grep java
tzdata-java-2018e-3.el7.noarch
javassist-3.16.1-10.el7.noarch
javapackages-tools-3.4.1-11.el7.noarch
java-11-openjdk-11.0.ea.28-7.el7.x86_64
java-1.7.0-openjdk-1.7.0.191-2.6.15.5.el7.x86_64
java-11-openjdk-headless-11.0.ea.28-7.el7.x86_64
java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.5.el7.x86_64

Solution

On removing the older version , the new version was referred and Jenkins service got started

[root@shareolite bin]# rpm -e java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.5.el7.x86_64
[root@shareolite bin]# rpm -e java-1.7.0-openjdk-1.7.0.191-2.6.15.5.el7.x86_64
[root@shareolite ~]# /etc/init.d/jenkins start
Starting jenkins (via systemctl):
                                                           [  OK  ]
[root@shareolite ~]#

Alternately, by setting the JAVA_HOME and PATH variables to the latest JDK folder   , startup may be attempted

Hope this share may be useful to few. 

Comments

–>