Score:2

Installing Jenkins, Service fails with result "timeout"

ca flag

I am trying to install jenkins on my raspberry pi running Ubuntu Server 22.04. I am following the directions from Digital Ocean but I am getting a timeout error when installing Jenkins

> apt install jenkins
...
Do you want to continue? [Y/n] y
(Reading database ... 144296 files and directories currently installed.)
Removing jenkins (2.375.1) ...
(Reading database ... 144287 files and directories currently installed.)
Purging configuration files for jenkins (2.375.1) ...
failed to remove jenkins system user
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

Selecting previously unselected package jenkins.
(Reading database ... 144282 files and directories currently installed.)
Preparing to unpack .../jenkins_2.375.1_all.deb ...
Unpacking jenkins (2.375.1) ...
Setting up jenkins (2.375.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /lib/systemd/system/jenkins.service.
Job for jenkins.service failed because a timeout was exceeded.
See "systemctl status jenkins.service" and "journalctl -xeu jenkins.service" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● 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: activating (auto-restart) (Result: timeout) since Fri 2022-12-09 10:27:08 UTC; 23ms ago
    Process: 28644 ExecStart=/usr/bin/jenkins (code=exited, status=143)
   Main PID: 28644 (code=exited, status=143)
     Status: "Jenkins stopped"
        CPU: 4min 30.555s
dpkg: error processing package jenkins (--configure):
 installed jenkins package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 jenkins
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is what I find in journaclctl. It will do this continuously.

> journalctl -u jenkins -f
Dec 09 10:17:45 fat-boi systemd[1]: Starting Jenkins Continuous Integration Server...
Dec 09 10:17:47 fat-boi jenkins[27383]: Running from: /usr/share/java/jenkins.war
Dec 09 10:17:48 fat-boi jenkins[27383]: 2022-12-09 10:17:48.016+0000 [id=1]        INFO        winstone.Logger#logInternal: Beginning extraction from war file
Dec 09 10:17:48 fat-boi jenkins[27383]: 2022-12-09 10:17:48.190+0000 [id=1]        WARNING        o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
Dec 09 10:17:48 fat-boi jenkins[27383]: 2022-12-09 10:17:48.484+0000 [id=1]        INFO        org.eclipse.jetty.server.Server#doStart: jetty-10.0.12; built: 2022-09-14T01:54:40.076Z; git: 408d0139887e27a57b54ed52e2d92a36731a7e88; jvm 11.0.17+8-post-Ubuntu-1ubuntu222.04
Dec 09 10:17:49 fat-boi jenkins[27383]: 2022-12-09 10:17:49.984+0000 [id=1]        INFO        o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Dec 09 10:17:50 fat-boi jenkins[27383]: 2022-12-09 10:17:50.344+0000 [id=1]        INFO        o.e.j.s.s.DefaultSessionIdManager#doStart: Session workerName=node0
Dec 09 10:17:53 fat-boi jenkins[27383]: 2022-12-09 10:17:53.123+0000 [id=1]        INFO        hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/lib/jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Dec 09 10:17:54 fat-boi jenkins[27383]: 2022-12-09 10:17:54.137+0000 [id=1]        INFO        o.e.j.s.handler.ContextHandler#doStart: Started w.@4642b71d{Jenkins v2.375.1,/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
Dec 09 10:17:54 fat-boi jenkins[27383]: 2022-12-09 10:17:54.199+0000 [id=1]        INFO        o.e.j.server.AbstractConnector#doStart: Started ServerConnector@707194ba{HTTP/1.1, (http/1.1)}{0.0.0.0:8989}
Dec 09 10:17:54 fat-boi jenkins[27383]: 2022-12-09 10:17:54.285+0000 [id=1]        INFO        org.eclipse.jetty.server.Server#doStart: Started Server@50caa560{STARTING}[10.0.12,sto=0] @8336ms
Dec 09 10:17:54 fat-boi jenkins[27383]: 2022-12-09 10:17:54.295+0000 [id=24]        INFO        winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
Dec 09 10:17:55 fat-boi jenkins[27383]: 2022-12-09 10:17:55.564+0000 [id=31]        INFO        jenkins.InitReactorRunner$1#onAttained: Started initialization
Dec 09 10:17:55 fat-boi jenkins[27383]: 2022-12-09 10:17:55.603+0000 [id=30]        INFO        jenkins.InitReactorRunner$1#onAttained: Listed all plugins
Dec 09 10:17:59 fat-boi jenkins[27383]: 2022-12-09 10:17:59.408+0000 [id=32]        INFO        jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
Dec 09 10:17:59 fat-boi jenkins[27383]: 2022-12-09 10:17:59.441+0000 [id=35]        INFO        jenkins.InitReactorRunner$1#onAttained: Started all plugins
Dec 09 10:17:59 fat-boi jenkins[27383]: 2022-12-09 10:17:59.512+0000 [id=32]        INFO        jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
Dec 09 10:18:00 fat-boi jenkins[27383]: 2022-12-09 10:18:00.798+0000 [id=37]        INFO        jenkins.InitReactorRunner$1#onAttained: System config loaded
Dec 09 10:18:00 fat-boi jenkins[27383]: 2022-12-09 10:18:00.806+0000 [id=29]        INFO        jenkins.InitReactorRunner$1#onAttained: System config adapted
Dec 09 10:18:00 fat-boi jenkins[27383]: 2022-12-09 10:18:00.812+0000 [id=29]        INFO        jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
Dec 09 10:18:00 fat-boi jenkins[27383]: 2022-12-09 10:18:00.821+0000 [id=37]        INFO        jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
Dec 09 10:18:01 fat-boi jenkins[27383]: 2022-12-09 10:18:01.035+0000 [id=51]        INFO        hudson.util.Retrier#start: Attempt #1 to do the action check updates server
Dec 09 10:18:01 fat-boi jenkins[27383]: WARNING: An illegal reflective access operation has occurred
Dec 09 10:18:01 fat-boi jenkins[27383]: WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/var/cache/jenkins/war/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
Dec 09 10:18:01 fat-boi jenkins[27383]: WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
Dec 09 10:18:01 fat-boi jenkins[27383]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
Dec 09 10:18:01 fat-boi jenkins[27383]: WARNING: All illegal access operations will be denied in a future release
Dec 09 10:18:01 fat-boi jenkins[27383]: 2022-12-09 10:18:01.994+0000 [id=32]        INFO        jenkins.install.SetupWizard#init:
Dec 09 10:18:01 fat-boi jenkins[27383]: *************************************************************
Dec 09 10:18:01 fat-boi jenkins[27383]: *************************************************************
Dec 09 10:18:01 fat-boi jenkins[27383]: *************************************************************
Dec 09 10:18:01 fat-boi jenkins[27383]: Jenkins initial setup is required. An admin user has been created and a password generated.
Dec 09 10:18:01 fat-boi jenkins[27383]: Please use the following password to proceed to installation:
Dec 09 10:18:01 fat-boi jenkins[27383]: hooplah
Dec 09 10:18:01 fat-boi jenkins[27383]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Dec 09 10:18:01 fat-boi jenkins[27383]: *************************************************************
Dec 09 10:18:01 fat-boi jenkins[27383]: *************************************************************
Dec 09 10:18:01 fat-boi jenkins[27383]: *************************************************************
Dec 09 10:19:15 fat-boi systemd[1]: jenkins.service: start operation timed out. Terminating.
Dec 09 10:19:15 fat-boi jenkins[27383]: 2022-12-09 10:19:15.936+0000 [id=25]        INFO        winstone.Logger#logInternal: JVM is terminating. Shutting down Jetty
Dec 09 10:19:15 fat-boi jenkins[27383]: 2022-12-09 10:19:15.941+0000 [id=25]        INFO        org.eclipse.jetty.server.Server#doStop: Stopped Server@50caa560{STOPPING}[10.0.12,sto=0]
Dec 09 10:19:16 fat-boi systemd[1]: jenkins.service: Failed with result 'timeout'.
Dec 09 10:19:16 fat-boi systemd[1]: Failed to start Jenkins Continuous Integration Server.
Dec 09 10:19:16 fat-boi systemd[1]: jenkins.service: Consumed 4min 37.771s CPU time.
Dec 09 10:19:16 fat-boi systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 3
Dec 09 10:23:50 fat-boi systemd[1]: Starting Jenkins Continuous Integration Server...
Dec 09 10:23:52 fat-boi jenkins[27850]: Running from: /usr/share/java/jenkins.war
...

Form online investigations I have seen that java versions can cause this error, but mine seems to be fine

openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode

Does anyone have experience in this issue? The timeout error is giving me little to nothing to work with.

Score:2
cg flag

The Jenkins service is taking time to start in the defined time. You can run the following command to check the configured TimeoutStartSec for the Jenkins service in SystemD.

$ sudo systemctl show jenkins | grep ^Timeout
TimeoutStartUSec=1min 30s
TimeoutStopUSec=infinity

You can increase the TimeoutStartSec in the /lib/systemd/system/jenkins.service file under [Service] section.

e.g.

[Service]
TimeoutStartSec=180
An Other avatar
jp flag
this solved same problem I faced with initial startup, which took more than 150 seconds on raspi 3 (command line mode)
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.