Jenkins Git UnknownHostKey

时间:2013-03-14 18:45:10

标签: git jenkins

我一直和詹金斯发生一个奇怪的错误:

ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: git@127.0.0.1:healthtrustsoftware/hts_traditional.git: UnknownHostKey: 127.0.0.1. RSA key fingerprint is 1c:f9:59:92:ab:8f:f6:2a:c6:be:43:26:5c:e7:ba:b9
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:212)
    at hudson.plugins.git.GitAPI.fetch(GitAPI.java:230)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:793)
    at hudson.plugins.git.GitSCM.access$000(GitSCM.java:57)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:976)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
    at hudson.model.Run.execute(Run.java:1567)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:237)
Caused by: org.eclipse.jgit.api.errors.TransportException: git@127.0.0.1:healthtrustsoftware/hts_traditional.git: UnknownHostKey: 127.0.0.1. RSA key fingerprint is 1c:f9:59:92:ab:8f:f6:2a:c6:be:43:26:5c:e7:ba:b9
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:137)
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:208)
    ... 17 more
Caused by: org.eclipse.jgit.errors.TransportException: git@127.0.0.1:healthtrustsoftware/hts_traditional.git: UnknownHostKey: 127.0.0.1. RSA key fingerprint is 1c:f9:59:92:ab:8f:f6:2a:c6:be:43:26:5c:e7:ba:b9
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
    at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
    at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
    at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1104)
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
    ... 18 more
Caused by: com.jcraft.jsch.JSchException: UnknownHostKey: 127.0.0.1. RSA key fingerprint is 1c:f9:59:92:ab:8f:f6:2a:c6:be:43:26:5c:e7:ba:b9
    at com.jcraft.jsch.Session.checkHost(Session.java:718)
    at com.jcraft.jsch.Session.connect(Session.java:313)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    ... 25 more
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:981)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
    at hudson.model.Run.execute(Run.java:1567)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:237)

尝试运行构建时发生此错误。 git服务器在同一台机器上运行。我可以su给jenkins用户和ssh到git@127.0.0.1没有问题,但由于某种原因它会从jenkins抛出这个错误。这里的任何建议都会很棒。感谢

1 个答案:

答案 0 :(得分:4)

此问题有a bug,其中包含评论中的修复程序。 related issue还提到Git Plugin版本1.1.26不受影响。