Hudson不会从Git中获取

lau*_*ura 5 git authentication ssh hudson

我已经打了一天超过一天了,这让我很生气!

  • 我在Win7 PC上安装了Git,并在安装时选择了PuttyGen选项.
  • 我使用PuttyGen生成了ssh密钥; 我已将ssh密钥添加到我的Git帐户,并在Pageant中链接了私钥.
  • 我已经设置GIT_SSH指向我的putty plink.exe.
  • 我已经使用Putty连接到codaset&git以使它们被接受为已知主机.

我可以从控制台克隆,但是哈德森失败了:

Fetching upstream changes from git@codaset.com:xxx/xxx.git
[workspace] $ "C:\Program Files\Git\bin\git.exe" fetch -t git@codaset.com:xxx/xxx.git +refs/heads/*:refs/remotes/origin/*
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    ...
Run Code Online (Sandbox Code Playgroud)

如果我在控制台中运行确切的git命令,它可以正常工作:

"C:\Program Files\Git\bin\git.exe" fetch -t git@codaset.com:xxx/xxx.git +refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)

我试过运行plink直接连接到GitHub:

plink -agent -v git@github.com
Looking up host "github.com"
...
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
Using username "git".
...
Authenticating with public key "rsa-key-20110121" from agent
...
Hi xxx! You've successfully authenticated, but GitHub does not provide
 shell access.
Run Code Online (Sandbox Code Playgroud)

然后我尝试连接到codaset:

plink -agent -v git@codaset.co
m
Looking up host "codaset.com"
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
Using username "git".
...
Authenticating with public key "rsa-key-20110121" from agent
...
Opened channel for session
Server refused to allocate pty
Started a shell/command
Error: Command is required.
...
Server sent command exit status 255
Disconnected: All channels closed
Run Code Online (Sandbox Code Playgroud)

因此,来自codaset的响应与来自git的响应略有不同.但是,我认为这可能是一个红色的鲱鱼,因为如果我尝试从hudson连接到标准的git项目,我会得到同样的错误.

我还设置了Go Server(CruiseControl),尝试从这里连接到git时出现类似的错误:

ERROR: FATAL ERROR: Disconnected: No supported authentication methods available
ERROR: fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

这让我觉得问题必然在于身份验证,而不是哈德森的细节......?

一如既往,任何帮助非常感谢!

Ron*_*zer 2

这可能是权限问题。 可以在同一台计算机上进行 git clone,但我的猜测是您没有以运行 Hudson 的同一用户身份执行此操作。su 到该用户,然后重试。可能会暴露问题。