Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hudson won't fetch from Git

I have been hitting this one for over a day now, it's driving me mad!

  • I have Git installed on a Win7 PC, and selected the PuttyGen option on install.
  • I have generated ssh keys using PuttyGen; I have added the ssh key to my Git account, and linked the private key in Pageant.
  • I have set up GIT_SSH to point to my putty plink.exe.
  • I've used Putty to connect to codaset & git to get them accepted as known hosts.

I can clone from the console, but hudson fails:

Fetching upstream changes from [email protected]:xxx/xxx.git
[workspace] $ "C:\Program Files\Git\bin\git.exe" fetch -t [email protected]: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
    ...

If I run the exact git command in a console, it works fine:

"C:\Program Files\Git\bin\git.exe" fetch -t [email protected]:xxx/xxx.git +refs/heads/*:refs/remotes/origin/*

I have tried running plink to connect directly to GitHub:

plink -agent -v [email protected]
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.

I then tried connecting to codaset:

plink -agent -v [email protected]
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

So, a slightly different response from codaset than from git. However, I think this may be a red herring, as I get the same error if I try to connect to a standard git project from hudson.

I also set up Go Server (CruiseControl as was), and get a similar error when attempting to connect to git from here:

ERROR: FATAL ERROR: Disconnected: No supported authentication methods available
ERROR: fatal: The remote end hung up unexpectedly

Which makes me think the problem must lie with the authentication, rather than the hudson details...?

As always, any help much appreciated!

like image 948
laura Avatar asked Nov 06 '22 04:11

laura


1 Answers

This might be a permissions issue. You can git clone on the same machine, but my guess is that you didn't do it as the same user running Hudson. su to that user, then try again. It may expose the problem.

like image 199
Ronen Botzer Avatar answered Nov 09 '22 11:11

Ronen Botzer