I followed the installation guide, but the Client controller fails to start

Article ID:360031057371
1 minute readKnowledge base

Issue

Jul 17, 2019 7:21:52 PM hudson.util.BootFailure publish
SEVERE: Failed to initialize Jenkins
hudson.util.AWTProblem: java.lang.NullPointerException

Description

I followed CloudBees Core on traditional platforms installation guide. The install process has completed successfully

Downloading packages:
cloudbees-core-cm-2.176.2.3-1.1.noarch.rpm                                                                                                                                                                             | 338 MB  00:00:33
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : cloudbees-core-cm-2.176.2.3-1.1.noarch                                                                                                                                                                                     1/1
  Verifying  : cloudbees-core-cm-2.176.2.3-1.1.noarch                                                                                                                                                                                     1/1
Installed:
  cloudbees-core-cm.noarch 0:2.176.2.3-1.1

Complete!

However, the Client controller fails to start. The log file /var/log/cloudbees-core-cm/cloudbees-core-cm.log reports the following error

INFO: Winstone Servlet Engine v4.0 running: controlPort=disabled
Jul 17, 2019 7:21:52 PM hudson.util.BootFailure publish
SEVERE: Failed to initialize Jenkins
hudson.util.AWTProblem: java.lang.NullPointerException
	at hudson.WebAppMain.contextInitialized(WebAppMain.java:193)
	at com.cloudbees.jenkins.ha.HAWebMain.promote(HAWebMain.java:87)
	at com.cloudbees.jenkins.ha.singleton.HASingleton.reactToPrimarySwitch(HASingleton.java:215)
	at com.cloudbees.jenkins.ha.singleton.HASingleton$3$1.run(HASingleton.java:135)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException

Resolution

You have already validated that java -version is installed on the host, and the output was similar to

java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

Most likely, the java-1.8.0-openjdk : OpenJDK Runtime Environment 8 is not installed on the host, and you are running the OpenJDK Headless Runtime Environment 8, i.e. java-1.8.0-openjdk-headless-1.8.0.212.b04-0.el7_6.x86_64. For a RHEL/CentOS flavour, run rpm -qa | grep java to confirm the OpenJDK Runtime Environment package is installed on the host. If you are on a Debian/Ubuntu distribution, the corresponding command would be dpkg -l | grep java.