jenkins集成git,构建项目报错,做了ssh的 认证,还是提示 Host key verification failed

语言他浮夸 发布于 2017/01/16 08:30
阅读 11K+
收藏 1
08:24:42 Started by user Shishuaifeng
08:24:42 Building in workspace /var/lib/jenkins/workspace/impact_ide
08:24:42  > /usr/local/git/git-2.4.5/git rev-parse --is-inside-work-tree # timeout=10
08:24:42 Fetching changes from the remote Git repository
08:24:42  > /usr/local/git/git-2.4.5/git config remote.shuaifes.url ssh://shuaifes@gerrit.app.alcatel-lucent.com:29418/IMPACTIDC_CDE/IDC # timeout=10
08:24:42 Fetching upstream changes from ssh://shuaifes@gerrit.app.alcatel-lucent.com:29418/IMPACTIDC_CDE/IDC
08:24:42  > /usr/local/git/git-2.4.5/git --version # timeout=10
08:24:42 using GIT_ASKPASS to set credentials 
08:24:42  > /usr/local/git/git-2.4.5/git fetch --tags --progress ssh://shuaifes@gerrit.app.alcatel-lucent.com:29418/IMPACTIDC_CDE/IDC +refs/heads/*:refs/remotes/shuaifes/*
08:24:44 ERROR: Error fetching remote repo 'shuaifes'
08:24:44 hudson.plugins.git.GitException: Failed to fetch from ssh://shuaifes@gerrit.app.alcatel-lucent.com:29418/IMPACTIDC_CDE/IDC
08:24:44 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
08:24:44 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
08:24:44 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
08:24:44 at hudson.scm.SCM.checkout(SCM.java:495)
08:24:44 at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
08:24:44 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
08:24:44 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
08:24:44 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
08:24:44 at hudson.model.Run.execute(Run.java:1728)
08:24:44 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
08:24:44 at hudson.model.ResourceController.execute(ResourceController.java:98)
08:24:44 at hudson.model.Executor.run(Executor.java:404)
08:24:44 Caused by: hudson.plugins.git.GitException: Command "/usr/local/git/git-2.4.5/git fetch --tags --progress ssh://shuaifes@gerrit.app.alcatel-lucent.com:29418/IMPACTIDC_CDE/IDC +refs/heads/*:refs/remotes/shuaifes/*" returned status code 128:
08:24:44 stdout: 
08:24:44 stderr: Host key verification failed.
08:24:44 fatal: Could not read from remote repository.
08:24:44 
08:24:44 Please make sure you have the correct access rights
08:24:44 and the repository exists.
08:24:44 
08:24:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1772)
08:24:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1516)
08:24:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:67)
08:24:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:318)
08:24:44 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801)
08:24:44 ... 11 more
08:24:44 ERROR: null
08:24:44 Finished: FAILURE
加载中
0
专业酱油党
专业酱油党

8:24:44 fatal: Could not read from remote repository.
08:24:44 
08:24:44 Please make sure you have the correct access rights
08:24:44 and the repository exists.

以前在公司弄过的,希望能帮到你

https://my.oschina.net/u/2607587/blog/754766

语言他浮夸
语言他浮夸
@格式化悲伤 回复@格式化悲伤 : 恩恩,已经解决了,谢谢
专业酱油党
专业酱油党
回复 @史帅峰 : 证书的我没弄过哦,我们公司都是私有项目,用https的。也挺好用的
语言他浮夸
语言他浮夸
你好,git的项目地址怎么配呢, 例如这样一个,git clone ssh://shuaifes@gerrit.app.alcatel-lucent.com:29418/IMPACTIDC_CDE/IDC 我改怎么配置呢,还有下面那个证书,谢谢
语言他浮夸
语言他浮夸
谢谢,非常感谢,我看看去
0
7_0
7_0
ssh的key对么。要rsa里面的值
语言他浮夸
语言他浮夸
是的,是rsa_pub的值,我手动通过命令是可以从仓库pull,但是配置Jenkins就会报错。
0
语言他浮夸
语言他浮夸

经过努力,终于解决了这个问题。解决方法是,在Jenkins目录下的.ssh目录里面生成ssh的认证,

执行ssh-keygen ,然后将生成的 id_rsa.pub 添加到GitHub的ssh认证。然后构建项目时,配置ssh认证,添加证书,即用户名。

0
奮鬥徳菜鳥
奮鬥徳菜鳥

您好 我也遇到这种问题 如:https://www.oschina.net/question/2772034_2180172 想请问您是怎么解决的 谢谢

0
葫芦仙儿
葫芦仙儿

引用来自“语言他浮夸”的评论

经过努力,终于解决了这个问题。解决方法是,在Jenkins目录下的.ssh目录里面生成ssh的认证,

执行ssh-keygen ,然后将生成的 id_rsa.pub 添加到GitHub的ssh认证。然后构建项目时,配置ssh认证,添加证书,即用户名。

你这个是在Linux下的Jenkins能解决问题,应该用sudo su jenkins来生成ssh-keygen。但是Windows上的同样问题,应该怎么解决呢?请赐教!

0
Java小屌
Java小屌

再次遇到这个问题,一天过去了还没解决,太糟心啦~~~

哪位大神可以解决私聊一下呗

返回顶部
顶部