Failed to start LSB jenkins automation server

Hi All,

After Jenkins upgrade 2.289.3 to 2.319.3. We could see after upgrade the Jenkins automation service is not running. Existing java version: java-11-openjdk-11.0.14.0.9-1.el7_9.x86_64.

and in Jenkins portal we could see it is saying it doesn’t looks like JDK directory. !

Can someone suggest us on this issue we are unable to start the Jenkins automation service.

we tried to fix the issue, but it did not work. We tried many things to restart the Jenkins service, but it is not getting started. Below are our findings.

Current status of Jenkins service:

Steps followed in brief:

  1. Modified the parameter value ‘’ to false. After restarting VM and restarting Jenkins UI, the parameter change reflected in UI.
  2. But the Jenkins service status is shown as failed, it is not running. Restarting the service is not working.
  3. When we tried to reinstall java version, there is a newer patch release found. Existing java version: java-11-openjdk-11.0.14.0.9-1.el7_9.x86_64 Newer patch found: 1.11.0.14.1.1-1.e17_9 We didn’t proceed further with upgrading java version.
  4. Checking further under existing java versions, we found that as per below screenshot ‘+ & * are pointing to two different java versions’. So we didn’t proceed further with upgrading java version.

Final update/confirmation required: We need confirmation on proceeding further with installation of newer java patch. We also need help to get the existing/new java version pointed to a single entry [Currently ‘+ and * are pointing to two different java versions’]

Thanks in advance

What’s the Jenkins portal?

jenkins UI (frontend)

Okay I’m very confused. Your title says you can’t start Jenkins but your able to start Jenkins and access the UI?

are you saying your jobs arnt starting because they can’t find jdk? Or Jenkins isn’t starting?

Of it’s job, then I’m guessing either JAVA_HOME env variable isn’t set right for your job, or wrong java in your path

echo(env.JAVA_HOME)

sh(“which javac”)

Yes , we are able to access Jenkins UI. But Jenkins service is not in active state
While testing the build, getting below error.
Log:

The JAVA_HOME environment variable is not defined correctly
09:41:42 This environment variable is needed to run this program
09:41:42 NB: JAVA_HOME should point to a JDK not a JRE
09:41:42 make: *** [xbiz-mail_service_api-srv-java] Error 1

log from Linux VM:
jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2022-03-25 04:24:35 UTC; 1 day 1h ago
Docs: man:systemd-sysv-generator(8)
Process: 4160 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)
CGroup: /system.slice/jenkins.service
├─1160 runuser -s /bin/bash jenkins -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/lib/jvm/java-11-openjdk-11.0.14.0.9-1.el7_9.x86_64/bin/java -Djava…
├─1181 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/lib/jvm/java-11-openjdk-11.0.14.0.9-1.el7_9.x86_64/bin/java -Djava.awt.headless=true -Dhud…
└─1183 /usr/lib/jvm/java-11-openjdk-11.0.14.0.9-1.el7_9.x86_64/bin/java -Djava.awt.headless=true -Dhudson.security.csrf.GlobalCrumbIssuerConfig…
Starting LSB: Jenkins Automation Server…
pam_unix(runuser:session): session opened for user jenkins by (uid=0)
pam_unix(runuser:session): session closed for user jenkins
jenkins.service: control process exited, code=exited status=1
Starting Jenkins [FAILED]
Failed to start LSB: Jenkins Automation Server.
Unit jenkins.service entered failed state.
jenkins.service failed.

image

looking at java-11-openjdk-headless-11.0.8.10-1.el7.x86_64.rpm CentOS 7 Download i don’t see javac in it. According to https://linuxize.com/post/install-java-on-centos-7/ it seems like you want to install the -devel package.

So i think jenkins was right, JAVA_HOME isn’t pointed to a JDK but a JRE

Thanks.
We have updated the java with below:

Sudo yum install java-11-openjdk-devel

echo $JAVA_HOME

/usr/lib/jvm/java-11-openjdk-11.0.14.1.1-1.e17_9.x86_64

Now Javac is pointing to 11.0.14.1, previously it is 1.8.0.262.

Still builds are not successful at Jenkins UI, getting same error JAVA_HOME should point to a JDK not a JRE

Our observation:

system information is Java1.8 (path : manage Jenkins- Nodes- SCP Fiori Build Agent system information)

Also noticed as below

that says java.home is set to jre (can’t copy and paste the path from the image)

yep that java (1) is pointed at jre path

is there any way or file to update java 11 path for Fiori build agent?

i don’t know what fiori is. Seems like its some sort of SAP product?

In your update-alternative screenshot, if you have the third option set, it won’t be pointed at a jre.

https://vitux.com/how-to-setup-the-java_home-path-in-debian-10/ is probably more detailed

shall we proceed to remove java-1.8.0.262 ,so that *+ will point to java 11?

I’m sorry I’m not comfortable hand holding you on this part. I showed you the problem, and pointed to some docs, but I don’t want to be responsible nor liable for actions on your server. There should be lots of tutorials on how to properly setup jdk on your server.

Ok fine thanks for suggestion

After upgrading the new Patch version of java, still builds are not successful and find the below error log.
Please prioritize this issue as we are unable to proceed with deployments to production.

12:35:15 print $2 }’ mta.yaml
12:35:15 + mtaName=xbiz-mail_service_api
12:35:15 + mbt build --platform=cf
12:35:15 [2022-03-29 07:05:15] INFO Cloud MTA Build Tool version 1.0.12
12:35:15 [2022-03-29 07:05:15] INFO generating the “Makefile_20220329070515.mta” file…
12:35:15 [2022-03-29 07:05:15] INFO done
12:35:15 [2022-03-29 07:05:15] INFO executing the “make -f Makefile_20220329070515.mta p=cf mtar= strict=true mode=” command…
12:35:15 [2022-03-29 07:05:15] INFO validating the MTA project
12:35:15 [2022-03-29 07:05:15] INFO validating the MTA project
12:35:15 [2022-03-29 07:05:15] INFO building the “xbiz-mail_service_api-srv-java” module…
12:35:15 [2022-03-29 07:05:15] INFO executing the “mvn clean package -DskipTests=true” command…
12:35:15 The JAVA_HOME environment variable is not defined correctly
12:35:15 This environment variable is needed to run this program
12:35:15 NB: JAVA_HOME should point to a JDK not a JRE
12:35:15 [2022-03-29 07:05:15] ERROR could not build the “xbiz-mail_service_api-srv-java” module: could not execute the “mvn clean package -DskipTests=true” command: exit status 1
12:35:15 Error: could not build the MTA project: could not execute the “make -f Makefile_20220329070515.mta p=cf mtar= strict=true mode=” command: exit status 2
12:35:15 Build step ‘Execute shell’ marked build as failure
12:35:16 Archiving artifacts
12:35:16 Finished: FAILURE

And also please let us know ,how to correct the java that both *+ should point to latest patch version of java.

I’m going to recommend you reach out to a vendor and pay for support. We are all volunteers here and this sounds critical.

I know cloudbees has some free support hours, but any vendor should be able to help you through it.