我刚刚建立了我的第一个詹金斯奴隶。我运行该版本,并且遇到了SSH密钥的问题。 Jenkins主服务器在用户'jenkins'下运行。我已经设置了SSH密钥,这样我就可以不需要密码就可以从主服务器连接到从服务器。詹金斯 - 无法从奴隶节点克隆克隆。 SSH密钥
例如来自主机:
[email protected]:~$ ssh slave
Last login: Tue Apr 17 10:30:22 2012 from masterjenkins.com
$ whoami
jenkins
因此,证明从节点也在'jenkins'用户下运行。 (我已经从jenkins @ slave将public ssh密钥复制到远程git服务器上)。而我能够从从手动发出git的克隆,但是当我揭开序幕,构建从主我得到这些类型的邮件:
ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:abc
hudson.plugins.git.GitException: Could not clone [email protected]:abc
Caused by: hudson.plugins.git.GitException: Error performing command: git clone --progress -o origin [email protected]:abc /var/lib/jenkins/workspace/abc_build
Command "git clone --progress -o origin [email protected]:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin [email protected]:abc /var/lib/jenkins/workspace/abc_build" returned status code 128: Initialized empty Git repository in /var/lib/jenkins/workspace/abc_build/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
所以还是暗示,我的SSH密钥未设置正确地。 任何人都可以告诉我哪些钥匙需要复制到哪里?
非常感谢, NS
主机密钥验证失败似乎表明您的Jenkins用户从未从未接受过该服务器,并且您还没有接受主机密钥,请尝试从CLI作为jenkins用户进行sshing以确保其正常工作,并接受主机密钥。 – Doon 2012-04-17 12:22:07
@Doon这可能最终成为问题。我原本以为你试图从詹金斯试图克隆的同一台机器上ssh。 – 2012-04-17 12:37:51
得到了混蛋!感谢您的输入。 我复制并粘贴命令詹金斯试图在奴隶上运行: git clone --progress -o origin git @ host:abc/var/lib/jenkins/workspace/abc 事实证明,我有一些违规的键在/root/.ssh/known_hosts 删除这些并再次连接到git repo后,它的工作! – nonshatter 2012-04-17 13:30:38