timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-36931] Jenkins hangs on startup #3376

Closed timja closed 8 years ago

timja commented 8 years ago

Hi,

I created the following question on stack overflow and I can't find yet the problem to my jenkins installation. http://serverfault.com/questions/791848/jenkins-hangs-on-startup

If I use the command line

service jenkins start

after installing jenkins on ubuntu 14.0 4 using the jenkins debian repository I cannot start the service.
One interesting detail is that there is no jobs and no plugins yet. It is a vanilla install.

In the logs it often stops here:

Running from: /usr/share/jenkins/jenkins.war
Jul 25, 2016 6:38:05 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @385ms
Jul 25, 2016 6:38:05 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jul 25, 2016 6:38:05 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Jul 25, 2016 6:38:05 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
Jul 25, 2016 6:38:06 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Jenkins home directory: /var/lib/jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Jul 25, 2016 6:38:06 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@48795c6b{/,file:/var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
Jul 25, 2016 6:38:06 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started ServerConnector@14e1f904{HTTP/1.1}{0.0.0.0:8080}
Jul 25, 2016 6:38:06 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started @1528ms
Jul 25, 2016 6:38:06 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Jul 25, 2016 6:38:06 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Jul 25, 2016 6:38:06 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Jul 25, 2016 6:38:08 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Jul 25, 2016 6:38:08 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Jul 25, 2016 6:38:08 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Jul 25, 2016 6:38:08 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs

What is even more strange is that if I manually start the daemon using the following command

/usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080

Jenkins starts successfully.

How do I find out what is the error behind the scene when it is starting from the service?

Thanks
Dominick


Originally reported by drivard, imported from: Jenkins hangs on startup
  • status: Resolved
  • priority: Minor
  • resolution: Not A Defect
  • resolved: 2016-08-02T14:26:46+00:00
  • imported: 2022/01/10
timja commented 8 years ago

drivard:

I tried to start it by the normal service command and it took over 3.5hours to start, but it finally booted.

timja commented 8 years ago

drivard:

I was able to pull out the logs from jenkins to show how long it takes to starts. See I restarted the daemon around 2:30 and it came up at 3:15.

root@jenkins-02:~# service jenkins restart
 * Restarting Jenkins Continuous Integration Server jenkins    [ OK ]
root@jenkins-02:~#
root@jenkins-02:~# tail -f /var/log/jenkins/jenkins.log
Jul 26, 2016 2:32:50 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Jul 26, 2016 2:32:51 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Jul 26, 2016 2:32:51 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Jul 26, 2016 2:32:51 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Jul 26, 2016 2:32:52 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Jul 26, 2016 3:14:07 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Jul 26, 2016 3:14:07 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 6 ms
Jul 26, 2016 3:14:07 PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 57032
Jul 26, 2016 3:14:07 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Jul 26, 2016 3:14:07 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@10872d81: display name [Root WebApplicationContext]; startup date [Tue Jul 26 15:14:07 UTC 2016]; root of context hierarchy
Jul 26, 2016 3:14:07 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@10872d81]: org.springframework.beans.factory.support.DefaultListableBeanFactory@27206c02
Jul 26, 2016 3:14:07 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@27206c02: defining beans [authenticationManager]; root of factory hierarchy
Jul 26, 2016 3:14:07 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@2f8ee7e8: display name [Root WebApplicationContext]; startup date [Tue Jul 26 15:14:07 UTC 2016]; root of context hierarchy
Jul 26, 2016 3:14:07 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@2f8ee7e8]: org.springframework.beans.factory.support.DefaultListableBeanFactory@808d6cc
Jul 26, 2016 3:14:07 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@808d6cc: defining beans [filter,legacy]; root of factory hierarchy
Jul 26, 2016 3:14:07 PM jenkins.install.SetupWizard init
INFO:

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

b370076a67c341c68c785bb5406bdeae

This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

Jul 26, 2016 3:14:09 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Jul 26, 2016 3:14:09 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running
timja commented 8 years ago

danielbeck:

There's no obvious bug here.

To find out what Jenkins is doing during startup, especially when appearing to hang, follow these instructions:
https://wiki.jenkins-ci.org/display/JENKINS/Obtaining+a+thread+dump