Jenkins initialization thread/52 died

Hey,

I’ve got a freshly installed Ubuntu 24.04 with 21.0.2 openjdk.
Sys has 32gb ram, 16 core, 500 gb storage.
Tried to install Jenkins via ‘apt install jenkins’ but its failed at ~66%. Especially it is installed but could not started.

rerun the installation says:

root@jenkins:/home/jenkins# apt install jenkins
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
jenkins is already the newest version (2.440.2).

its also listening:

 x.x.x.x:8080/login?from=%2F
only printed:
'Please wait while Jenkins is getting ready to work ...'

but I could not start the service systemctl status says:

 root@jenkins:/home/jenkins# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; preset: enabled)
     Active: activating (start) since Thu 2024-04-04 15:13:20 UTC; 4min 7s ago
   Main PID: 28509 (java)
      Tasks: 102 (limit: 38470)
     Memory: 267.1M (peak: 268.9M)
        CPU: 11.536s
     CGroup: /system.slice/jenkins.service
             └─28509 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080
Apr 04 15:13:23 jenkins jenkins[28509]: *************************************************************
Apr 04 15:13:23 jenkins jenkins[28509]: *************************************************************
Apr 04 15:13:23 jenkins jenkins[28509]: *************************************************************
Apr 04 15:13:23 jenkins jenkins[28509]: Jenkins initial setup is required. An admin user has been created and a password generated.
Apr 04 15:13:23 jenkins jenkins[28509]: Please use the following password to proceed to installation:
Apr 04 15:13:23 jenkins jenkins[28509]: e4512fd73337478fa73f266adc7c7846
Apr 04 15:13:23 jenkins jenkins[28509]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Apr 04 15:13:23 jenkins jenkins[28509]: *************************************************************
Apr 04 15:13:23 jenkins jenkins[28509]: *************************************************************
Apr 04 15:13:23 jenkins jenkins[28509]: *************************************************************

start would not changing to running.

journalctl says:

Apr 04 15:08:20 jenkins systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 28.
Apr 04 15:08:20 jenkins systemd[1]: Starting jenkins.service - Jenkins Continuous Integration Server...
Apr 04 15:08:20 jenkins jenkins[28251]: Running from: /usr/share/java/jenkins.war
Apr 04 15:08:20 jenkins jenkins[28251]: 2024-04-04 15:08:20.536+0000 [id=1]        INFO        winstone.Logger#logInternal: Beginning extraction from war file
Apr 04 15:08:20 jenkins jenkins[28251]: 2024-04-04 15:08:20.622+0000 [id=1]        WARNING        o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
Apr 04 15:08:20 jenkins jenkins[28251]: 2024-04-04 15:08:20.689+0000 [id=1]        INFO        org.eclipse.jetty.server.Server#doStart: jetty-10.0.20; built: 2024-01-29T20:46:45.278Z; git: 3a745c71c23682146f262b99f4ddc4c1bc41630c; jvm 2>
Apr 04 15:08:20 jenkins jenkins[28251]: 2024-04-04 15:08:20.934+0000 [id=1]        INFO        o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Apr 04 15:08:20 jenkins jenkins[28251]: 2024-04-04 15:08:20.982+0000 [id=1]        INFO        o.e.j.s.s.DefaultSessionIdManager#doStart: Session workerName=node0
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.364+0000 [id=1]        INFO        hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/lib/jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.456+0000 [id=1]        INFO        o.e.j.s.handler.ContextHandler#doStart: Started w.@7d373bcf{Jenkins v2.440.2,/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/w>
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.466+0000 [id=1]        INFO        o.e.j.server.AbstractConnector#doStart: Started ServerConnector@45afc369{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.475+0000 [id=1]        INFO        org.eclipse.jetty.server.Server#doStart: Started Server@f0f2775{STARTING}[10.0.20,sto=0] @1363ms
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.476+0000 [id=55]        INFO        winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.717+0000 [id=64]        INFO        jenkins.InitReactorRunner$1#onAttained: Started initialization
Apr 04 15:08:21 jenkins jenkins[28251]: 2024-04-04 15:08:21.720+0000 [id=85]        INFO        jenkins.InitReactorRunner$1#onAttained: Listed all plugins
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.493+0000 [id=95]        INFO        jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.498+0000 [id=65]        INFO        jenkins.InitReactorRunner$1#onAttained: Started all plugins
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.503+0000 [id=80]        INFO        jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.708+0000 [id=92]        INFO        jenkins.InitReactorRunner$1#onAttained: System config loaded
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.709+0000 [id=88]        INFO        jenkins.InitReactorRunner$1#onAttained: System config adapted
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.709+0000 [id=88]        INFO        jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.711+0000 [id=70]        INFO        jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.732+0000 [id=109]        INFO        hudson.util.Retrier#start: Attempt #1 to do the action check updates server
Apr 04 15:08:22 jenkins jenkins[28251]: 2024-04-04 15:08:22.765+0000 [id=90]        INFO        jenkins.install.SetupWizard#init:
Apr 04 15:08:22 jenkins jenkins[28251]: *************************************************************
Apr 04 15:08:22 jenkins jenkins[28251]: *************************************************************
Apr 04 15:08:22 jenkins jenkins[28251]: *************************************************************
Apr 04 15:08:22 jenkins jenkins[28251]: Jenkins initial setup is required. An admin user has been created and a password generated.
Apr 04 15:08:22 jenkins jenkins[28251]: Please use the following password to proceed to installation:
Apr 04 15:08:22 jenkins jenkins[28251]: e4512fd73337478fa73f266adc7c7846
Apr 04 15:08:22 jenkins jenkins[28251]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Apr 04 15:08:22 jenkins jenkins[28251]: *************************************************************
Apr 04 15:08:22 jenkins jenkins[28251]: *************************************************************
Apr 04 15:08:22 jenkins jenkins[28251]: *************************************************************
Apr 04 15:13:20 jenkins systemd[1]: jenkins.service: start operation timed out. Terminating.
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.320+0000 [id=56]        INFO        winstone.Logger#logInternal: JVM is terminating. Shutting down Jetty
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.322+0000 [id=56]        INFO        org.eclipse.jetty.server.Server#doStop: Stopped Server@f0f2775{STOPPING}[10.0.20,sto=0]
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.326+0000 [id=56]        INFO        o.e.j.server.AbstractConnector#doStop: Stopped ServerConnector@45afc369{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.329+0000 [id=56]        INFO        hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.337+0000 [id=56]        INFO        jenkins.model.Jenkins$16#onAttained: Started termination
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.345+0000 [id=56]        INFO        jenkins.model.Jenkins$16#onAttained: Completed termination
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.346+0000 [id=56]        INFO        jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.350+0000 [id=56]        INFO        jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.350+0000 [id=56]        INFO        jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.362+0000 [id=56]        INFO        jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.362+0000 [id=56]        INFO        hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins stopped
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.363+0000 [id=56]        INFO        hudson.WebAppMain#contextDestroyed: Shutting down a Jenkins instance that was still starting up
Apr 04 15:13:20 jenkins jenkins[28251]: java.lang.Throwable: reason
Apr 04 15:13:20 jenkins jenkins[28251]:         at hudson.WebAppMain.contextDestroyed(WebAppMain.java:407)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.ContextHandler.callContextDestroyed(ContextHandler.java:1059)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:636)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.ContextHandler.contextDestroyed(ContextHandler.java:1016)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.servlet.ServletHandler.doStop(ServletHandler.java:306)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:182)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:205)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:97)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.security.SecurityHandler.doStop(SecurityHandler.java:412)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.security.ConstraintSecurityHandler.doStop(ConstraintSecurityHandler.java:413)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:182)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:205)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:97)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.session.SessionHandler.doStop(SessionHandler.java:497)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:182)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:205)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:97)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.ContextHandler.stopContext(ContextHandler.java:1039)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.servlet.ServletContextHandler.stopContext(ServletContextHandler.java:399)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.webapp.WebAppContext.stopContext(WebAppContext.java:1311)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:1087)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:312)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:182)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:205)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:97)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.server.Server.doStop(Server.java:517)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
Apr 04 15:13:20 jenkins jenkins[28251]:         at winstone.Launcher.shutdown(Launcher.java:442)
Apr 04 15:13:20 jenkins jenkins[28251]:         at winstone.ShutdownHook.run(ShutdownHook.java:28)
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.365+0000 [id=56]        INFO        o.e.j.s.handler.ContextHandler#doStop: Stopped w.@7d373bcf{Jenkins v2.440.2,/,null,STOPPED}{/var/cache/jenkins/war}
Apr 04 15:13:20 jenkins jenkins[28251]: 2024-04-04 15:13:20.365+0000 [id=52]        SEVERE        h.i.i.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler#uncaughtException: A thread (Jenkins initialization thread/52) died >
Apr 04 15:13:20 jenkins jenkins[28251]: java.lang.ClassNotFoundException: hudson.util.HudsonFailedToLoad
Apr 04 15:13:20 jenkins jenkins[28251]:         at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass(WebAppClassLoader.java:594)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource(WebAppClassLoader.java:567)
Apr 04 15:13:20 jenkins jenkins[28251]:         at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:502)
Apr 04 15:13:20 jenkins jenkins[28251]:         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
Apr 04 15:13:20 jenkins jenkins[28251]: Caused: java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad
Apr 04 15:13:20 jenkins jenkins[28251]:         at hudson.WebAppMain$3.run(WebAppMain.java:276)
Apr 04 15:13:20 jenkins systemd[1]: jenkins.service: Failed with result 'timeout'.
Apr 04 15:13:20 jenkins systemd[1]: Failed to start jenkins.service - Jenkins Continuous Integration Server.
Apr 04 15:13:20 jenkins systemd[1]: jenkins.service: Consumed 10.006s CPU time.
Apr 04 15:13:20 jenkins systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 29.

any idea how to make this work?
all ideas are appreciated.

Br,

I believe that message indicates that your computer is not completing the 10 second Jenkins startup timeout is reached.

I think that those messages may indicate that the computer is not fast enough (or lacks enough memory) to complete the Jenkins startup in the default 10 seconds. You can increase the timeout by using systemctl edit jenkins to include a value for the TimeoutStartSec directive that is described in

1 Like

Hello Mark,
Just increased the TimeoutStartSec=900.
Its hanging after 10 min…

think so this should be enough for memory purpose:

root@jenkins:/var/log/jenkins# free -m
               total        used        free      shared  buff/cache   available
Mem:           32093         930       30801           1         744       31162
Swap:              0           0           0
root@jenkins:/var/log/jenkins#
root@jenkins:/var/log/jenkins# mpstat
Linux 6.8.0-11-generic (jenkins)        04/05/24        _x86_64_        (16 CPU)

06:31:52     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
06:31:52     all    0.20    0.30    0.05    0.26    0.00    0.00    0.00    0.00    0.00   99.18

In the meantime, does the Jenkins UI show up?