Issues with Jenkins and SVN proxy

2019-09-05 18:54发布

My Jenkins installation (1.442, upgrading is not an option because its a company managed central installation) needs to access an SVN repository (via https) behind a proxy. I configured the .subversion/servers file accordingly and also set the http_proxy and https_proxy environment variables.

The SVN connection fundamentally works:

  • I can checkout projects
  • I call poll the SVN repository for changes

But whenever a build is triggered because of a change in the repo (or if I manually trigger a build at a time when there are SVN updates that are not yet in the Jenkins workspace), the following error occurs. Builds work when Jenkins detects no changes in the SVN and thus does not try to build a change log.

It is expected that the Jenkins machine can not resolve the host name, but it should never try and rather use the proxy.

To me, this looks as if the Jenkins SVN plugin correctly uses the proxy configuration for polling and updating from SVN, but that the SVN change log builder ignores that configuration?!

Any hints how to fix this?

At revision 1324
hudson.util.IOException2: revision check failed on https://xxxxx/....
at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:170)
at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:112)
at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:555)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:702)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:568)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:457)
at hudson.model.Run.run(Run.java:1404)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Caused by: org.tmatesoft.svn.core.SVNException: svn: OPTIONS /..... failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:291)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:276)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:264)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:516)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1001)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:178)
at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482)
at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:873)
at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534)
at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:1019)
at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:894)
at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:826)
at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:158)
... 10 more
Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /....... failed
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:146)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:89)
... 24 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: OPTIONS request failed on '/.....'
svn: unknown host
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:644)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:285)
... 23 more
Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS request failed on '/....'
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:642)
... 24 more
Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: unknown host
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:397)
... 24 more
Caused by: java.net.UnknownHostException: XXXXXX
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:850)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1201)
at java.net.InetAddress.getAllByName0(InetAddress.java:1154)
at java.net.InetAddress.getAllByName(InetAddress.java:1084)
at java.net.InetAddress.getAllByName(InetAddress.java:1020)
at java.net.InetAddress.getByName(InetAddress.java:970)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createAddres(SVNSocketFactory.java:141)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createSSLSocket(SVNSocketFactory.java:72)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:186)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:342)
... 24 more

1条回答
霸刀☆藐视天下
2楼-- · 2019-09-05 19:47

I was finally able to resolve this issue.

It turns out that SVN polls and checkouts happen on the Jenkins slave to which the job is assigned, while the change log building step happens on the Jenkins master.

Sure enough we had the SVN proxy config only on the slave...

查看更多
登录 后发表回答