jenkins集成git,构建项目报错,做了ssh的 认证,还是提示 Host ?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

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

爱吃鱼的程序员 2020-06-08 18:03:19 66

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

jenkins 网络安全 持续交付 开发工具 git
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-08 18:03:31

    8:24:44fatal:Couldnotreadfromremoterepository.
    08:24:44 
    08:24:44Pleasemakesureyouhavethecorrectaccessrights
    08:24:44andtherepositoryexists.

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

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

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

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

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

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

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

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

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

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

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

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题