哈德森无法从 git 存储库中获取

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8910848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:21:47  来源:igfitidea点击:

hudson cannot fetch from git repository

gittomcathudsontomcat6

提问by Luiz E.

I have a Hudson server, and a git repository, both running on our server (an ubuntu machine).
Whenever I try to build my app with hudson, he says the follwing

我有一个 Hudson 服务器和一个 git 存储库,它们都在我们的服务器(一台 ubuntu 机器)上运行。
每当我尝试与 hudson 构建我的应用程序时,他都会说以下

Iniciado pelo usuário anonymous
Checkout:workspace / /usr/share/tomcat6/.hudson/jobs/ECF/workspace - hudson.remoting.LocalChannel@176150c
Using strategy: Default
Checkout:workspace / /usr/share/tomcat6/.hudson/jobs/ECF/workspace - hudson.remoting.LocalChannel@176150c
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://[email protected]/git/germantech.git
ERROR: Problem fetching from servidor / servidor - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: git fetch -t ssh://[email protected]/git/germantech.git +refs/heads/*:refs/remotes/origin/*
Command "git fetch -t ssh://[email protected]/git/germantech.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: Host key verification failed.
fatal: The remote end hung up unexpectedly

ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository

what am i missing here? Ideas? thanks in advance

我在这里错过了什么?想法?提前致谢

EDIT

编辑

Ok, made it work!
first, i've logged with my hudson user (sudo su - -s /bin/bash tomcat6) and then, i've deleted my .ssh folder.
after this, i just followed thislink, and made a ssh login without password
now, hudson can do a fetch without have to especify a password

好的,成功了!
首先,我使用我的 hudson 用户 ( sudo su - -s /bin/bash tomcat6)登录,然后我删除了我的 .ssh 文件夹。
在此之后,我只是按照链接进行了 ssh 登录,
现在无需密码,hudson无需指定密码即可进行提取

回答by German Attanasio

You need to create an ssh relationship between hudson and git server.

您需要在 hudson 和 git 服务器之间创建 ssh 关系。

You only need to do this once.

您只需执行此操作一次。

Steps:

脚步:

  1. Log in in the hudson machine with the hudson user.

  2. create a ssh private and public key:

    ssh-keygen -t dsa
    Leave an empty passphase.
    Now you have 2 files in the hudson home under the .ssh folder: id_dsa and id_dsa.pub.

  3. Copy the key to your repo using:

    ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]

  4. Log out and verify you can now ssh without having to provide a password.

  1. 使用 hudson 用户登录 hudson 机器。

  2. 创建 ssh 私钥和公钥:

    ssh-keygen -t dsa
    留下一个空的passphase。
    现在您在 .ssh 文件夹下的 hudson home 中有 2 个文件:id_dsa 和 id_dsa.pub。

  3. 使用以下命令将密钥复制到您的仓库:

    ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]

  4. 注销并验证您现在无需提供密码即可 ssh。

Hudson should now be able to connect.

Hudson 现在应该可以连接了。

回答by Luiz E.

I deleted the .sshfolder inside tomcat6home folder (hudson runs with tomcat6 user here, because I use hudsons's war) and then, used thistutorial and it finally worked

我删除了.ssh文件夹里面tomcat6的主文件夹(在这里的tomcat6用户哈德森运行,因为我用哈德森的War),然后使用这个教程,它终于摸索