Jenkins主机无法连接到Subversion,但从机可以

uurv41yg  于 2023-01-01  发布在  Jenkins
关注(0)|答案(1)|浏览(115)

我在Jenkins中使用Subversion插件,我的主机(Windows)无法通过svn+ssh连接到SVN服务器(使用Apache Subversion v1.7),抛出异常

Running as SYSTEM
Building on master in workspace c:\Program Files (x86)\Jenkins\w4ManagerWorkspace
Updating svn+ssh://10.74.1.41/data/subversion/svn/tools/testComplete/trunk/W4Manager at revision '2022-12-01T10:31:08.582 +0100' --quiet
Using sole credentials arpc_ta/****** in realm ‘svn+ssh://10.74.1.41’
ERROR: Failed to update svn+ssh://10.74.1.41/data/subversion/svn/tools/testComplete/trunk/W4Manager
org.tmatesoft.svn.core.SVNException: svn: E210002: There was a problem while connecting to 10.74.1.41:22
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
    at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:145)
    at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:79)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1282)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVNRepositoryImpl.java:100)
    at org.tmatesoft.svn.core.io.SVNRepository.getRepositoryUUID(SVNRepository.java:268)
    at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.createRepository(SvnRepositoryAccess.java:103)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepository(SvnNgRepositoryAccess.java:211)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.updateInternal(SvnNgAbstractUpdate.java:210)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.update(SvnNgAbstractUpdate.java:115)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:40)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:18)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
    at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:311)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:291)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:387)
    at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:159)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:168)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:1064)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1040)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1013)
    at hudson.FilePath.act(FilePath.java:1172)
    at hudson.FilePath.act(FilePath.java:1155)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:960)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:883)
    at hudson.scm.SCM.checkout(SCM.java:505)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
    at hudson.model.Run.execute(Run.java:1888)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:99)
    at hudson.model.Executor.run(Executor.java:431)
Caused by: java.io.IOException: There was a problem while connecting to 10.74.1.41:22
    at com.trilead.ssh2.Connection.connect(Connection.java:781)
    at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openConnection(SshHost.java:225)
    at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openSession(SshHost.java:153)
    at org.tmatesoft.svn.core.internal.io.svn.ssh.SshSessionPool.openSession(SshSessionPool.java:85)
    at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:122)
    ... 35 more
Caused by: java.io.IOException: **Key exchange was not finished, connection is closed.**
    at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:95)
    at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:237)
    at com.trilead.ssh2.Connection.connect(Connection.java:732)
    ... 39 more
Caused by: java.io.IOException: **Fatal error during MAC startup!**
    at com.trilead.ssh2.transport.KexManager.finishKex(KexManager.java:298)
    at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:571)
    at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:790)
    at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502)
    at java.lang.Thread.run(Unknown Source)
ERROR: Subversion update failed
java.io.IOException: Fatal error during MAC startup!
    at com.trilead.ssh2.transport.KexManager.finishKex(KexManager.java:298)
    at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:571)
    at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:790)
    at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502)
    at java.lang.Thread.run(Unknown Source)
Caused: java.io.IOException: Key exchange was not finished, connection is closed.
    at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:95)
    at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:237)
    at com.trilead.ssh2.Connection.connect(Connection.java:732)
Caused: java.io.IOException: There was a problem while connecting to 10.74.1.41:22
    at com.trilead.ssh2.Connection.connect(Connection.java:781)
    at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openConnection(SshHost.java:225)
    at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openSession(SshHost.java:153)
    at org.tmatesoft.svn.core.internal.io.svn.ssh.SshSessionPool.openSession(SshSessionPool.java:85)
    at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:122)
Caused: org.tmatesoft.svn.core.SVNException: svn: E210002: There was a problem while connecting to 10.74.1.41:22
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
    at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:145)
    at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:79)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1282)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVNRepositoryImpl.java:100)
    at org.tmatesoft.svn.core.io.SVNRepository.getRepositoryUUID(SVNRepository.java:268)
    at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.createRepository(SvnRepositoryAccess.java:103)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepository(SvnNgRepositoryAccess.java:211)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.updateInternal(SvnNgAbstractUpdate.java:210)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.update(SvnNgAbstractUpdate.java:115)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:40)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:18)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
    at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:311)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:291)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:387)
    at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:159)
Caused: hudson.scm.subversion.UpdaterException: failed to perform svn update
Caused: java.io.IOException
    at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:214)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:168)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:1064)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1040)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1013)
    at hudson.FilePath.act(FilePath.java:1172)
    at hudson.FilePath.act(FilePath.java:1155)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:960)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:883)
    at hudson.scm.SCM.checkout(SCM.java:505)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
    at hudson.model.Run.execute(Run.java:1888)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:99)
    at hudson.model.Executor.run(Executor.java:431)
[Checks API] No suitable checks publisher found.
Finished: FAILURE

从从机运行的相同Jenkins项目是成功的。在我的从机上Jenkins作为Windows服务运行。

Running as SYSTEM
Building remotely on slaveMachine (slave_1) in workspace c:\Program Files (x86)\Jenkins\w4ManagerWorkspace
Updating svn+ssh://10.74.1.41/data/subversion/svn/tools/testComplete/trunk/W4Manager at revision '2022-12-01T12:30:51.663 +0100' --quiet
Using sole credentials arpc_ta/****** in realm ‘svn+ssh://10.74.1.41’
Using sole credentials arpc_ta/****** in realm ‘svn+ssh://10.74.1.41’
At revision 7401

在Jenkins的项目配置中,显示了一些不正常的情况,并显示消息“无法访问存储库”

但是,当我在从机上运行同一个项目时,连接成功,Jenkins没有显示任何错误. svn update命令成功完成.我的主机和从机都是Windows服务器VM,从TortoiseSVN连接到SVN是成功的,我可以 checkout 仓库.我使用SVN几年没有问题,Subversion插件刚刚安装到Jenkins.
发现类似问题,例如Jenkins主从:密钥交换没有完成,连接被关闭或https://support.tmatesoft.com/t/svn-e210002-svnkit-doesnt-connect-to-remote-repository/2480/13,解决方法是在svn服务器上编辑配置文件/etc/ssh/sshd_config,但我不认为这是问题所在,因为从机连接是成功的.我还检查了Java版本,它们在两个Windows服务器上是相同的.
还尝试了Jenkins [jenkinsUrl]/scm/SubversionSCM/enterCredential的scm控制台中的不同凭据类型、公钥身份验证和用户/pw,但仅从行**MAC启动过程中出现致命错误!**引发了相同的错误
编辑:在SVN服务器的/var/log/secure中,有来自我的主机(10.74.37.1)的连接关闭消息,没有其他错误或详细信息。从机(10.74.37.28)接受连接

Dec  5 14:47:11 xlcppt28 sshd[24808]: Connection closed by 10.74.37.1 port 57664 [preauth]
Dec  5 14:47:13 xlcppt28 sshd[24811]: Accepted password for arpc_ta from 10.74.37.28 port 57941 ssh2
Dec  5 14:47:13 xlcppt28 sshd[24811]: pam_unix(sshd:session): session opened for user arpc_ta by (uid=0)
knsnq2tg

knsnq2tg1#

问题是解决了更新Jenkins,然后在Jenkins每个插件(因为我的Jenkins服务器是离线的,这不是2点击..)我还更新了Java。

相关问题