Jenkins Fails to Start After running VM install script

Hi KodeKloud!

I am just starting the DevSecOps course and I’ve hit a snag with Jenkins being installed from: https://github.com/Nathan-G-Rogers/kubernetes-devops-security/blob/main/setup/vm-install-script/install-script.sh

After the script finishes, Jenkins is in a failed state. See the Systemctl errors below:

root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
   Active: failed (Result: protocol) since Sun 2022-09-11 22:43:22 UTC; 1min 8s ago
  Process: 23830 ExecStart=/usr/bin/jenkins (code=exited, status=0/SUCCESS)
 Main PID: 23830 (code=exited, status=0/SUCCESS)

Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Service hold-off time over, scheduling restart.
Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 10.
Sep 11 22:43:22 devsecops-cloud systemd[1]: Stopped Jenkins Continuous Integration Server.
Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Start request repeated too quickly.
Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Failed with result 'protocol'.
Sep 11 22:43:22 devsecops-cloud systemd[1]: Failed to start Jenkins Continuous Integration Server.
root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script# systemctl reset-failed jenkins
root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sun 2022-09-11 22:43:22 UTC; 2min 40s ago
  Process: 23830 ExecStart=/usr/bin/jenkins (code=exited, status=0/SUCCESS)
 Main PID: 23830 (code=exited, status=0/SUCCESS)

Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Service hold-off time over, scheduling restart.
Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 10.
Sep 11 22:43:22 devsecops-cloud systemd[1]: Stopped Jenkins Continuous Integration Server.
Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Start request repeated too quickly.
Sep 11 22:43:22 devsecops-cloud systemd[1]: jenkins.service: Failed with result 'protocol'.
Sep 11 22:43:22 devsecops-cloud systemd[1]: Failed to start Jenkins Continuous Integration Server.
root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script# systemctl start jenkins
Job for jenkins.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status jenkins.service" and "journalctl -xe" for details.
root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
   Active: failed (Result: protocol) since Sun 2022-09-11 22:46:21 UTC; 12s ago
  Process: 25367 ExecStart=/usr/bin/jenkins (code=exited, status=0/SUCCESS)
 Main PID: 25367 (code=exited, status=0/SUCCESS)

Sep 11 22:46:21 devsecops-cloud systemd[1]: jenkins.service: Service hold-off time over, scheduling restart.
Sep 11 22:46:21 devsecops-cloud systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 5.
Sep 11 22:46:21 devsecops-cloud systemd[1]: Stopped Jenkins Continuous Integration Server.
Sep 11 22:46:21 devsecops-cloud systemd[1]: jenkins.service: Start request repeated too quickly.
Sep 11 22:46:21 devsecops-cloud systemd[1]: jenkins.service: Failed with result 'protocol'.
Sep 11 22:46:21 devsecops-cloud systemd[1]: Failed to start Jenkins Continuous Integration Server.
root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script#

I am running as root. ubuntu-1804-bionic-v20220901 VM on GCP. I’ve tried to restart the service manually and same error message.


root@devsecops-cloud:~/kubernetes-devops-security/setup/vm-install-script# journalctl -xe
-- Subject: Unit jenkins.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit jenkins.service has finished shutting down.
Sep 11 22:46:21 devsecops-cloud systemd[1]: jenkins.service: Start request repeated too quickly.
Sep 11 22:46:21 devsecops-cloud systemd[1]: jenkins.service: Failed with result 'protocol'.
Sep 11 22:46:21 devsecops-cloud systemd[1]: Failed to start Jenkins Continuous Integration Server.
-- Subject: Unit jenkins.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit jenkins.service has failed.
--
-- The result is RESULT.
Sep 11 22:51:47 devsecops-cloud systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Sep 11 22:51:47 devsecops-cloud systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is RESULT.

Any help would be great, I am sure I am not the only one running into this.

Ah, I needed to install openjdk-11 for jenkins to function. The prereq script installs 8.

1 Like

Hi @11.21xxx ,
Is this GitHub repo part of the lab? and please share the lab URL.

Regards,