jenkins / hudson无法连接到github回购 [英] jenkins/hudson can't connect to github repo

查看:177
本文介绍了jenkins / hudson无法连接到github回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



<$ p

我在Ec2上使用基本的亚马逊ami linux-我已经安装了jenkins,但是当我从github上取回repo时,出现以下错误: $ p> 在工作区建立/ var / lib / jenkins / workspace / build社会
签出:build social / / var / lib / jenkins / workspace / build social - hudson.remoting.LocalChannel @ 5c7b21b
使用策略:默认
克隆远程Git存储库
克隆存储库源
错误:克隆远程回购源错误:无法克隆git@github.com:adulion / .git
hudson.plugins.git.GitException:无法克隆git@github.com:adulion / .git
在hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
at hudson.plugins.git.GitSCM $ 2.invoke(GitSCM.java:1117)
at hudson.plugins.git.GitSCM $ 2.invoke(GitSCM.java:1059)
at hudson.FilePath .act(FilePath.java:832)
at hudson.FilePath.act(FilePath.java:814)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
在hudson.m odel.AbstractProject.checkout(AbstractProject.java:1218)
at hudson.model.AbstractBuild $ AbstractRunner.checkout(AbstractBuild.java:581)
at hudson.model.AbstractBuild $ AbstractRunner.run(AbstractBuild。 java:470)
at hudson.model.Run.run(Run.java:1421)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model .ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
引起:hudson.plugins.git.GitException:命令git clone - -progress -o origin git@github.com:adulion / .git / var / lib / jenkins / workspace / build social返回状态码128:
stdout:克隆到/ var / lib / jenkins / workspace / build社交...

stderr:主机密钥验证失败。
致命:远程端意外挂起

我为当前用户生成了一个密钥谁安装了jenkins,并设法使用git命令行克隆回购,但jenkins不能。



我已将〜/ .ssh文件复制到/ var / lib / jenkins / .ssh



我已经将github添加到已知的主机,并且已经用尽了解决方案。任何人都知道我要去哪里错了?有没有办法让詹金斯显示它使用的公钥?我可以调试它是否使用了正确的公钥?

我删除了回购的名称因为它是一个私人回购

解决方案

错误似乎是:主机密钥验证失败。

您应该以Jenkins用户身份登录您的Jenkins主机并运行:

  ssh git@github.com 

然后回答yes以提示有关主机密钥。这只需要做一次。



或者,您可以将StrictHostKeyChecking no添加到〜jenkins / .ssh / config。


I am on Ec2 with the base amazon ami linux- I have installed jenkins but when I go to pull the repo from github I am given the following error:

Building in workspace /var/lib/jenkins/workspace/build social
Checkout:build social / /var/lib/jenkins/workspace/build social - hudson.remoting.LocalChannel@5c7b21b
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:adulion/.git
hudson.plugins.git.GitException: Could not clone git@github.com:adulion/.git
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1117)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
    at hudson.FilePath.act(FilePath.java:832)
    at hudson.FilePath.act(FilePath.java:814)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1421)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@github.com:adulion/.git /var/lib/jenkins/workspace/build social" returned status code 128:
stdout: Cloning into /var/lib/jenkins/workspace/build social...

stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly

I have generated a key for the current user who installed jenkins and have managed to clone the repo using the git command line but jenkins can not.

I have copied the ~/.ssh files into /var/lib/jenkins/.ssh

I have added github to the known hosts and I have run out of solutions to try. Anyone know where I am going wrong? Is there a way to get jenkins to show the public key it's using and I can debug if it's using the correct one?

I removed the name of the repo because its a private repo

解决方案

The error seems to be: host key verification failed.

You should log into your Jenkins host as the Jenkins user and run:

ssh git@github.com

Then answer yes to the prompt about the host key. This only needs to be done once.

Alternatively you could add "StrictHostKeyChecking no" to ~jenkins/.ssh/config.

这篇关于jenkins / hudson无法连接到github回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆