3

I need some help with an authentication issue I have encountered with Github/Jenkins.

Setup is as follows: Jenkins master is on windows Slave is running on OSX Jenkins can communicate fine with the slave

When trying to pull from our private git repo we see the following error, this error is not on either the master or other linux slaves and clones fine in OSX terminal.

Started by user xxxxxxxxxxxx
[EnvInject] - Loading node environment variables.
Building remotely on MAC01 in workspace /var/jenkins/workspace/xxxxxxxxxxxx
Checkout:NativeiOSSlots / /var/jenkins/workspace/xxxxxxxxxxxxx - hudson.remoting.Channel@166d8eb:MAC01
Using strategy: Default
Last Built Revision: Revision 7232678c31bf2c6f3c4bd5a66b349edf9288440c (origin/HEAD, origin/master)
Cloning the remote Git repository
Cloning repository <repo url>
git --version
git version 1.8.3.1
ERROR: Error cloning remote repo 'origin' : Could not clone <repo url>
hudson.plugins.git.GitException: Could not clone <repo url>
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:226)
    at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.clone(AbstractGitAPIImpl.java:57)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:33)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1012)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:948)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)
Caused by: hudson.plugins.git.GitException: Command "/Applications/GitHub.app/Contents/Resources/git/bin/git clone --progress -o origin <repo url> /var/jenkins/workspace/xxxxxxxxxx" returned status code 128:
stdout: Cloning into '/var/jenkins/workspace/xxxxxxxxxx'...

stderr: remote: Repository not found.
fatal: Authentication failed for '<repo url>'

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:790)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$100(CliGitAPIImpl.java:33)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:224)
    ... 14 more

Any Ideas?

dax
  • 10,779
  • 8
  • 51
  • 86
user2732625
  • 39
  • 1
  • 1
  • 2

4 Answers4

2

I was facing same problem. Jenkin was not able to clone my git repo to local PC.

Solution:

  1. Start services.msc
  2. goto Jenkins service and open it's property
  3. goto Logon tab and and give your a/c userName and password.
  4. restart the service.

These steps solved my problem, as I have given my enterprise login and password in there.

Syon
  • 7,205
  • 5
  • 36
  • 40
0

Most likely the user that the Jenkins slave runs as on your Mac isn't properly set up for github (doesn't have the proper certificate). On my Mac slave that's the user named jenkins. Log in as that user on your slave and see if you can do:

ssh -T git@github.com

If that's not working, make sure you have the proper certificate installed and that the machine can see the outside world.

Sven Delmas
  • 832
  • 5
  • 18
  • ssh -T git@github.com doesnt cause any problems, the command im using to confirm this works from the command line is git clone https://github.com/REPO/NAME and i do not get prompted for my username or pass as it is cached in the OSX Keychain - what im unsure of is if i am using HTTPS then i shouldnt need the ssh keys? – user2732625 Sep 02 '13 at 15:21
  • And you are sure the jenkins slave user is the one that you do your experiments with? What url are you using to clone? I do have my github certificate in ~/.ssh for the jenkins user (you may just want to try that). – Sven Delmas Sep 05 '13 at 03:59
-1

Does it really clone fine from the terminal when run as the user running jenkins ?

You probably haven't set up your SSH access properly. See this: Could not clone repository

Community
  • 1
  • 1
coffeebreaks
  • 3,787
  • 1
  • 26
  • 25
-1

I also had this issue. I ended up having to downgrade my Git Client plugin to 1.6.4. When I was running 1.8.0 I got this error for every repo I tried to clone. As soon as I rolled it back, it all started to work.

Kirk
  • 234
  • 3
  • 13