Windows Jenkins服务器在代理后无法到达插件中心。

问题描述 投票:0回答:1

概要

目前,我正试图在一个运行在代理服务器后面的windows Jenkins服务器上安装插件。目前,虽然代理设置已经设置好了,但当我点击插件管理器下高级选项卡底部的 "立即检查 "按钮时,我收到了一个403错误。

我尝试了什么

我尝试了几种修复方法。

  1. 添加了代理设置中的 插件管理器 高级选项卡。包括这个,"验证代理 "按钮返回一个错误。我无法从堆栈跟踪中找出任何有用的东西 (堆栈痕迹如下)
  2. 添加了代理设置在 jenkins.xml 文件,并重新启动了Jenkins服务。(添加到Jenkins文件中的参数如下所示)
  3. 我重新启动了服务器,并验证了我能够通过互联网浏览器和通过powershell到达同一个更新中心的URL。然而,尽管这些测试是在同一台机器上进行的,但jenkin的仍然得到一个403错误。(用于验证连接性的Powershell命令如下所示)

堆栈跟踪从 插件管理器>高级>验证代理服务器 与...对抗 https:/www.google.com

jenkins插件代理设置

java.lang.NullPointerException
    at hudson.util.Secret$1.convert(Secret.java:306)
    at hudson.util.Secret$1.convert(Secret.java:304)
    at org.kohsuke.stapler.AnnotationHandler.convert(AnnotationHandler.java:66)
    at org.kohsuke.stapler.QueryParameter$HandlerImpl.parse(QueryParameter.java:74)
    at org.kohsuke.stapler.QueryParameter$HandlerImpl.parse(QueryParameter.java:62)
    at org.kohsuke.stapler.AnnotationHandler.handle(AnnotationHandler.java:91)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:204)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
    at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
    at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:676)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
    at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
    at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:153)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.Server.handle(Server.java:500)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
    at java.lang.Thread.run(Unknown Source)

增加的数值 争论 科室 jenkins.xml 档案

-Djdk.http.auth.tunneling.disabledSchemes="" -Dhttp.proxyUser=EXAMPLE\user -Dhttp.proxyPassword=EXAMPLEPASS -Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=8080 -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8080 -Dhttp.auth.ntlm.domain=true -Dcom.sun.net.ssl.checkRevocation=false

用于成功验证互联网连接的Powershell命令。

Invoke-WebRequest -Uri https://www.google.com `
                  -Proxy http://proxy.example.com:8080 `
                  -ProxyCredential $(Get-Credential)

jenkins.err 日志文件

也可以增加一些更多的背景,以 403 错误。据我所知,403表明它是被禁止的,然而,如果我试图通过浏览器或powershell直接到达网站,我不会收到任何403错误。如果我故意输入错误的代理凭证,我会得到407,但我能够到达更新中心网站。https://updates.jenkins.io/update-center.json 通过浏览器和powershell安装插件,没有任何错误返回。

2020-04-23 01:54:27.133+0000 [id=1] INFO    org.eclipse.jetty.util.log.Log#initialized: Logging initialized @578ms to org.eclipse.jetty.util.log.JavaUtilLog
2020-04-23 01:54:27.242+0000 [id=1] INFO    winstone.Logger#logInternal: Beginning extraction from war file
2020-04-23 01:54:27.273+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2020-04-23 01:54:27.336+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 1.8.0_144-b01
2020-04-23 01:54:27.820+0000 [id=1] INFO    o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2020-04-23 01:54:27.883+0000 [id=1] INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2020-04-23 01:54:27.883+0000 [id=1] INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2020-04-23 01:54:27.883+0000 [id=1] INFO    o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms
2020-04-23 01:54:28.273+0000 [id=1] INFO    hudson.WebAppMain#contextInitialized: Jenkins home directory: C:\Program Files (x86)\Jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2020-04-23 01:54:28.367+0000 [id=1] INFO    o.e.j.s.handler.ContextHandler#doStart: Started w.@2f59fa{Jenkins v2.222.1,/,file:///C:/Program%20Files%20(x86)/Jenkins/war/,AVAILABLE}{C:\Program Files (x86)\Jenkins\war}
2020-04-23 01:54:28.383+0000 [id=1] INFO    o.e.j.server.AbstractConnector#doStart: Started ServerConnector@bc464{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2020-04-23 01:54:28.383+0000 [id=1] INFO    org.eclipse.jetty.server.Server#doStart: Started @1827ms
2020-04-23 01:54:28.383+0000 [id=19]    INFO    winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2020-04-23 01:54:30.617+0000 [id=26]    INFO    jenkins.InitReactorRunner$1#onAttained: Started initialization
2020-04-23 01:54:30.648+0000 [id=25]    INFO    jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2020-04-23 01:54:31.851+0000 [id=27]    INFO    jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2020-04-23 01:54:31.851+0000 [id=27]    INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins
2020-04-23 01:54:31.867+0000 [id=26]    INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2020-04-23 01:54:32.070+0000 [id=26]    INFO    jenkins.InitReactorRunner$1#onAttained: System config loaded
2020-04-23 01:54:32.070+0000 [id=26]    INFO    jenkins.InitReactorRunner$1#onAttained: System config adapted
2020-04-23 01:54:32.070+0000 [id=26]    INFO    jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2020-04-23 01:54:32.070+0000 [id=24]    INFO    jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2020-04-23 01:54:32.086+0000 [id=40]    INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata
2020-04-23 01:54:32.101+0000 [id=40]    INFO    hudson.util.Retrier#start: Attempt #1 to do the action check updates server
2020-04-23 01:54:32.414+0000 [id=40]    INFO    hudson.util.Retrier#start: The attempt #1 to do the action check updates server failed with an allowed exception:
java.io.IOException: Server returned HTTP response code: 403 for URL: https://updates.jenkins.io/update-center.json?id=default&version=2.222.1
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at hudson.model.DownloadService.loadJSON(DownloadService.java:114)
    at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:208)
    at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:203)
    at hudson.PluginManager.checkUpdatesServer(PluginManager.java:1765)
    at hudson.util.Retrier.start(Retrier.java:63)
    at hudson.PluginManager.doCheckUpdatesServer(PluginManager.java:1736)
    at jenkins.DailyCheck.execute(DailyCheck.java:93)
    at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:100)
    at java.lang.Thread.run(Unknown Source)
2020-04-23 01:54:32.414+0000 [id=40]    INFO    hudson.util.Retrier#start: Calling the listener of the allowed exception 'Server returned HTTP response code: 403 for URL: https://updates.jenkins.io/update-center.json?id=default&version=2.222.1' at the attempt #1 to do the action check updates server
2020-04-23 01:54:32.414+0000 [id=40]    INFO    hudson.util.Retrier#start: Attempted the action check updates server for 1 time(s) with no success
2020-04-23 01:54:32.414+0000 [id=40]    SEVERE  hudson.PluginManager#doCheckUpdatesServer: Error checking update sites for 1 attempt(s). Last exception was: IOException: Server returned HTTP response code: 403 for URL: https://updates.jenkins.io/update-center.json?id=default&version=2.222.1
2020-04-23 01:54:32.414+0000 [id=40]    INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Download metadata. 328 ms
2020-04-23 01:54:32.430+0000 [id=27]    INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization
2020-04-23 01:54:32.445+0000 [id=18]    INFO    hudson.WebAppMain$3#run: Jenkins is fully up and running
java jenkins jenkins-plugins
1个回答
0
投票

我在新安装的Jenkins 2.222.1上也遇到了同样的问题。事实上,当点击 "提交 "按钮时,Jenkins能够检测到他们是一个较新版本的Jenkins,并安装了它(所以我认为代理配置是确定的)。在Jenkins 2.222.3版本中接受自动升级后,"验证代理 "按钮现在工作正常......

© www.soinside.com 2019 - 2024. All rights reserved.