3

我需要一些关于我在 Github/Jenkins 中遇到的身份验证问题的帮助。

设置如下: Jenkins master 在 windows Slave 在 OSX 上运行 Jenkins 可以和 slave 正常通信

当尝试从我们的私有 git 存储库中提取时,我们看到以下错误,此错误不在主服务器或其他 linux 从服务器上,并且在 OSX 终端中可以正常克隆。

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

有任何想法吗?

4

4 回答 4

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.

于 2013-09-19T12:36:41.997 回答
0

Jenkins slave 在您的 Mac 上运行的用户很可能没有为 github 正确设置(没有正确的证书)。在我的 Mac 从站上,用户名为 jenkins。在您的奴隶上以该用户身份登录,看看您是否可以执行以下操作:

ssh -T git@github.com

如果这不起作用,请确保您安装了正确的证书并且机器可以看到外部世界。

于 2013-08-31T01:27:30.950 回答
-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

于 2013-08-30T20:23:22.073 回答
-1

我也有这个问题。我最终不得不将我的 Git Client 插件降级到 1.6.4。当我运行 1.8.0 时,我尝试克隆的每个 repo 都会出现此错误。我一回滚它,一切就开始起作用了。

于 2014-04-24T20:25:47.903 回答