Jenkinsがブラウザからアクセス不能となった

概要

Jenkinsへブラウザからアクセスできなくなりました。 sshは接続可能で、メモリやCPUも正常値です。 自動でJenkinsのバージョンがアップデートされた可能性があります。

$ curl --dump-header - http://{Jenkins Server IP}:8081/
curl: (7) Failed to connect to {Jenkins Server IP} port 8081: Operation timed out

環境

  • EC2
  • Java 1.8
  • Jenkins 2.58 ( Java1.8でないと動作しません )

ログの確認

/var/log/jenkins/jenkins.log のログは以下の通りです。

May 23, 2017 9:32:16 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
May 23, 2017 9:32:16 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @799ms
May 23, 2017 9:32:16 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
May 23, 2017 9:32:16 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
May 23, 2017 9:32:16 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
May 23, 2017 9:32:17 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: SystemProperties.getProperty("JENKINS_HOME")
May 23, 2017 9:32:18 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@31ea9581{/,file:/var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
May 23, 2017 9:32:18 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started ServerConnector@1972e513{HTTP/1.1}{0.0.0.0:8081}
May 23, 2017 9:32:18 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started @2684ms
May 23, 2017 9:32:18 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
May 23, 2017 9:32:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
May 23, 2017 9:32:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
May 23, 2017 9:32:26 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
May 23, 2017 9:32:26 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
May 23, 2017 9:32:28 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
INFO: Failed to instantiate optional component hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl; skipping
May 23, 2017 9:32:28 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
May 23, 2017 9:32:29 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
May 23, 2017 9:32:29 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
May 23, 2017 9:32:29 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 16 ms
May 23, 2017 9:32:29 PM jenkins.InitReactorRunner$1 onAttained
May 23, 2017 9:32:29 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
May 23, 2017 9:32:29 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@2d587310: display name [Root WebApplicationContext]; startup date [Tue May 23 21:32:29 JST 2017]; root of context hierarchy
May 23, 2017 9:32:29 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@2d587310]: org.springframework.beans.factory.support.DefaultListableBeanFactory@5a771792
May 23, 2017 9:32:29 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5a771792: defining beans [authenticationManager]; root of factory hierarchy
May 23, 2017 9:32:30 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@75d5e590: display name [Root WebApplicationContext]; startup date [Tue May 23 21:32:30 JST 2017]; root of context hierarchy
May 23, 2017 9:32:30 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@75d5e590]: org.springframework.beans.factory.support.DefaultListableBeanFactory@5a658fa1
May 23, 2017 9:32:30 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5a658fa1: defining beans [filter,legacy]; root of factory hierarchy
May 23, 2017 9:32:30 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running

対策

  • config.xml の修正 (アクセスできなくなる前に変更していないため、直る見込みは低い)
  • Jenkinsのアップグレード (関係あるのか不明な為、直る見込みは低い)
  • Jenkinsの再起動
  • EC2の再起動
  • ファイアウォールの再起動 (/etc/rc.d/init.d/iptables restart)

結論

EC2を 再起動 ではなく一旦 停止 後、 再開 することでブラウザからアクセスできるようになりました。