查看日志,其实是连接updateserver超时导致的:
# vim /var/log/jenkins/jenkins.log 信息: The attempt #1 to do the action check updates server failed with an allowed exception: java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) …… 二月 14, 2019 11:01:15 下午 hudson.util.Retrier start 信息: Calling the listener of the allowed exception 'connect timed out' at the attempt #1 to do the action check updates server 二月 14, 2019 11:01:15 下午 hudson.util.Retrier start 信息: Attempted the action check updates server for 1 time(s) with no success 二月 14, 2019 11:01:15 下午 hudson.PluginManager doCheckUpdatesServer 严重: Error checking update sites for 1 attempt(s). Last exception was: SocketTimeoutException: connect timed out 二月 14, 2019 11:01:15 下午 hudson.model.AsyncPeriodicWork$1 run 信息: Finished Download metadata. 20,727 ms 二月 14, 2019 11:01:22 下午 hudson.model.UpdateCenter updateDefaultSite 警告: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail.
查看Jenkins关于updaterserver配置:
[root@localhost jenkins]# cat /var/lib/jenkins/hudson.model.UpdateCenter.xml <?xml version='1.1' encoding='UTF-8'?> <sites> <site> <id>default</id> <url>https://updates.jenkins.io/update-center.json</url> </site>
解决办法:
默认是通过https://updates.jenkins.io/update-center.json进行更新的。此处,将https改为http,重启Jenkins,重新打开页面,一切都正常了。
至于为何http可行,https不可行?