设置Jenkins与git交谈时的身份验证错误

时间:2013-04-01 18:44:11

标签: git http ssh jenkins

我正在尝试在可以与远程Android git存储库通信的窗口上设置Jenkins。我但是,不断收到以下错误:

Using strategy: Default
Cloning the remote Git repository
Cloning repository https://github.com/***********`enter code here`
git --version
git version 1.7.4.msysgit.0.173.g83185.dirty
ERROR: Error cloning remote repo 'origin' : Could not clone https://github.com/*********
hudson.plugins.git.GitException: Could not clone https://github.com/*************
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:219)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1001)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1364)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:670)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:575)
    at hudson.model.Run.execute(Run.java:1575)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:237)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Jenkins\PortableGit-pre-alpha-64-bit\cmd\git.cmd clone --progress -o origin https://github.com/******************* <http://localhost:8080/job/*********%20SCM%20Change%20Build%20-%20JenkinsTest2/ws/"> returned status code 128:
stdout: Cloning into <http://localhost:8080/job/******%20Change%20Build%20-%20JenkinsTest2/ws/...>

stderr: fatal: Authentication failed

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:773)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:217)
    ... 14 more
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1013)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1364)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:670)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:575)
    at hudson.model.Run.execute(Run.java:1575)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:237)

我尝试使用以下方法设置ssh密钥:

https://help.github.com/articles/generating-ssh-keys

然而,当我走到这一步时:

  

ssh -T git@github.com

我收到以下错误:

  

权限被拒绝(公钥)

     

在这里输入代码

我不确定我做错了什么,如果我甚至需要设置ssh密钥,因为我正在尝试使用https网址

会欣赏任何指针

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,因为我在Jenkins中使用https URL而不是ssh url。一旦我更改了存储库部分中的url,它就像宣传的那样工作。