Jenkins setup: 2.22
Till yesterday the Jenkins was working fine but now today the Jenkins page is not working. We have been using jenkins for more than a year now and have not faced any issue similar to this. Can anyone please help to resolve this? Or if anyone have faced similar issues please feel free to leave your solutions. Thanks in advance.
When the JENKINS_HOME directory is empty, Jenkins would do an initial setup.
So maybe the env var has changed or the directory was deleted or maybe the file system is not mounted properly.
Are you really using Jenkins 2.22? that is over 8 years old
Sorry it’s 2.479.1 actually. So how to fix it? I’m using a linux vm so I couldn’t find this JENKINS_HOME directory.
JENKINS_HOME is an environment variable usually. It depends on how you installed Jenkins. If via the package manage you will it in in the systemd service configuration of the service jenkins
Actually we have installed the jenkins inside a linux VM. Even I searched all the directories but couldn’t find this JENKINS_HOME variable. Should I try uninstalling and re-installing jenkins?
When you Jenkins is running, you can go to Manage Jenkins → System, you will see at the top the directory that is used.
When you say you installed Jenkins, how did you do that? Using your Linux package manager?
I’m not able to launch the Jenkins that is the issue here. Yes we installed directly from the jenkins website using wget command. Jenkins page is not landing so when I referred the logs inside linux vm it say’s to install jenkins from start, if we do so then the custom jobs which we have configured would be all gone. I check the jenkins_home folder and all the necessary directories are present there. Please guide on how to get back the Jenkins without any issues.
well so you didn’t really install Jenkins but just downloaded the war file I assume.
So the question is how do you run Jenkins, which command are you running. Probably just java -jar jenkins.war
or something like that. Maybe you created your own service. Without setting the env variable JENKINS_HOME
explicitly this will set the JENKINS_HOME to <user_home>/.jenkins
So obviously you now have a different directory for your Jenkins than you had before.
I can only guess what’s wrong on your side. Maybe you’ve run Jenkins as a different user or you have changed something else compared to before.
You might want to search for a file called identity.key.enc
on your system. That is specific to Jenkins.
I searched all the entries in service.jenkins file and everything is in place. I have also checked config.xml file which is also the same. I have that identity.key.enc inside var/lib/jenkins. What should I check there?
We run jenkins on the web. JENKINS_HOME variable is present inside service.jenkins and is pointing to the correct directory as well. So from the start the directory for Jenkins is the same and not different.
When you have /var/lib/jenkins
then this normally means that you have installed Jenkins via package manager and you start it with systemctl start jenkins
Have you done this?
Then you can check with journalctl -u jenkins
the output of the service.
/var/lib/jenkins
should be your JENKINS_HOME then normally.
This log is normal without any error. When I see the logs using var/lib/jenkins/jenkins.log it is showing as below
Running from: /usr/lib/jenkins/jenkins.war
2022-10-28 13:23:26.466+0000 [id=1] WARNING winstone.Logger#logInternal: Parameter handlerCountMax is now deprecated
2022-10-28 13:23:26.471+0000 [id=1] WARNING winstone.Logger#logInternal: Parameter handlerCountMaxIdle is now deprecated
2022-10-28 13:23:26.483+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @348ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-10-28 13:23:26.519+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file
2022-10-28 13:23:27.253+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2022-10-28 13:23:27.295+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.27.v20200227; built: 2020-02-27T18:37:21.340Z; git: a304fd9f351f337e7c0e2a7c28878dd536149c6c; jvm 11.0.17+8-LTS
2022-10-28 13:23:27.489+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2022-10-28 13:23:27.513+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2022-10-28 13:23:27.513+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2022-10-28 13:23:27.514+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms
2022-10-28 13:23:27.802+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/lib/jenkins found at: SystemProperties.getProperty(“JENKINS_HOME”)
2022-10-28 13:23:27.932+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started w.@3cd59ef5{Jenkins v2.222.3,/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
2022-10-28 13:23:27.943+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStop: Stopped ServerConnector@2c4d1ac{HTTP/1.1, (http/1.1)}{0.0.0.0:10020}
2022-10-28 13:23:27.943+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#stopScavenging: node0 Stopped scavenging
2022-10-28 13:23:27.945+0000 [id=1] INFO hudson.WebAppMain#contextDestroyed: Shutting down a Jenkins instance that was still starting up
java.lang.Throwable: reason
at hudson.WebAppMain.contextDestroyed(WebAppMain.java:388)
at org.eclipse.jetty.server.handler.ContextHandler.callContextDestroyed(ContextHandler.java:940)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:565)
at org.eclipse.jetty.server.handler.ContextHandler.stopContext(ContextHandler.java:908)
at org.eclipse.jetty.servlet.ServletContextHandler.stopContext(ServletContextHandler.java:367)
at org.eclipse.jetty.webapp.WebAppContext.stopWebapp(WebAppContext.java:1450)
at org.eclipse.jetty.webapp.WebAppContext.stopContext(WebAppContext.java:1415)
at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:983)
at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:284)
at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:547)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201)
at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108)
at org.eclipse.jetty.server.Server.doStop(Server.java:454)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93)
at winstone.Launcher.shutdown(Launcher.java:304)
at winstone.Launcher.(Launcher.java:195)
at winstone.Launcher.main(Launcher.java:355)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at Main._main(Main.java:375)
at Main.main(Main.java:151)
Exception in thread “Jenkins initialization thread” 2022-10-28 13:23:27.949+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStop: Stopped w.@3cd59ef5{Jenkins v2.222.3,/,null,UNAVAILABLE}{/var/cache/jenkins/war}
java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused by: java.lang.ClassNotFoundException: hudson.util.HudsonFailedToLoad
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:543)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
… 1 more
2022-10-28 13:23:27.956+0000 [id=1] INFO winstone.Logger#logInternal: Jetty shutdown successfully
java.io.IOException: Failed to start Jetty
at winstone.Launcher.(Launcher.java:184)
at winstone.Launcher.main(Launcher.java:355)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at Main._main(Main.java:375)
at Main.main(Main.java:151)
Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:10020
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.server.Server.doStart(Server.java:385)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at winstone.Launcher.(Launcher.java:182)
… 7 more
Caused by: java.net.BindException: Address already in use
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:459)
at java.base/sun.nio.ch.Net.bind(Net.java:448)
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)
… 14 more
2022-10-28 13:23:27.957+0000 [id=1] SEVERE winstone.Logger#logInternal: Container startup failed
java.net.BindException: Address already in use
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:459)
at java.base/sun.nio.ch.Net.bind(Net.java:448)
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)
Caused: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:10020
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.server.Server.doStart(Server.java:385)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at winstone.Launcher.(Launcher.java:182)
Caused: java.io.IOException: Failed to start Jetty
at winstone.Launcher.(Launcher.java:184)
at winstone.Launcher.main(Launcher.java:355)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at Main._main(Main.java:375)
at Main.main(Main.java:151)
Running from: /usr/lib/jenkins/jenkins.war
Running from: /usr/lib/jenkins/jenkins.war
2022-10-28 13:25:10.649+0000 [id=1] WARNING winstone.Logger#logInternal: Parameter handlerCountMax is now deprecated
2022-10-28 13:25:10.653+0000 [id=1] WARNING winstone.Logger#logInternal: Parameter handlerCountMaxIdle is now deprecated
2022-10-28 13:25:10.666+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @357ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-10-28 13:25:10.700+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file
2022-10-28 13:25:10.716+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2022-10-28 13:25:10.759+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.27.v20200227; built: 2020-02-27T18:37:21.340Z; git: a304fd9f351f337e7c0e2a7c28878dd536149c6c; jvm 11.0.17+8-LTS
2022-10-28 13:25:10.970+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2022-10-28 13:25:10.994+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2022-10-28 13:25:10.994+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2022-10-28 13:25:10.996+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms
2022-10-28 13:25:11.288+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/lib/jenkins found at: SystemProperties.getProperty(“JENKINS_HOME”)
2022-10-28 13:25:11.416+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started w.@76a82f33{Jenkins v2.222.3,/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
2022-10-28 13:25:11.436+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStart: Started ServerConnector@6591f517{HTTP/1.1, (http/1.1)}{0.0.0.0:10010}
2022-10-28 13:25:11.436+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: Started @1127ms
2022-10-28 13:25:11.439+0000 [id=24] INFO winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2022-10-28 13:25:11.679+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization
2022-10-28 13:25:11.702+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2022-10-28 13:25:12.507+0000 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2022-10-28 13:25:12.511+0000 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: Started all plugins
2022-10-28 13:25:12.522+0000 [id=35] INFO jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2022-10-28 13:25:13.001+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: System config loaded
2022-10-28 13:25:13.002+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: System config adapted
2022-10-28 13:25:13.002+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2022-10-28 13:25:13.012+0000 [id=32] INFO jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2022-10-28 13:25:13.051+0000 [id=49] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata
2022-10-28 13:25:13.073+0000 [id=49] INFO hudson.util.Retrier#start: Attempt #1 to do the action check updates server
2022-10-28 13:25:13.521+0000 [id=35] INFO o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@5061c5b0: display name [Root WebApplicationContext]; startup date [Fri Oct 28 13:25:13 UTC 2022]; root of context hierarchy
2022-10-28 13:25:13.521+0000 [id=35] INFO o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@5061c5b0]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1b8a8491
2022-10-28 13:25:13.528+0000 [id=35] INFO o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1b8a8491: defining beans [authenticationManager]; root of factory hierarchy
2022-10-28 13:25:13.634+0000 [id=35] INFO o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@9e9e407: display name [Root WebApplicationContext]; startup date [Fri Oct 28 13:25:13 UTC 2022]; root of context hierarchy
2022-10-28 13:25:13.634+0000 [id=35] INFO o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@9e9e407]: org.springframework.beans.factory.support.DefaultListableBeanFactory@261fbe85
2022-10-28 13:25:13.635+0000 [id=35] INFO o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@261fbe85: defining beans [filter,legacy]; root of factory hierarchy
2022-10-28 13:25:13.784+0000 [id=35] INFO jenkins.install.SetupWizard#init:
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
b0ea9817d8cf4c18a1497bbbaf8e2653
This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
That is 2 years old
I have no clue how you run Jenkins before