无法在Linux上将存储库克隆到jenkins

时间:2013-02-08 06:44:12

标签: linux ubuntu github jenkins jenkins-plugins

我能够克隆我为jenkins上的一个工作创建的存储库。克隆作为另一个存储库的分支的存储库时,在尝试构建它时会出现以下错误 - 有关可能出现问题的任何建议吗?

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/client1/workspace
Checkout:workspace / /var/lib/jenkins/jobs/client1/workspace - hudson.remoting.LocalChannel@1d5cac4
Using strategy: Default
Cloning the remote Git repository
Cloning repository https://..... (couldn't disclose the address link here)

    git --version
    git version 1.7.9.5
    ERROR: Error cloning remote repo 'origin' : Could not clone https://.....
    hudson.plugins.git.GitException: Could not clone https://......
        at hudson.plugins.git.GitAPI.clone(GitAPI.java:273)
        at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044)
        at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:986)
        at hudson.FilePath.act(FilePath.java:865)
        at hudson.FilePath.act(FilePath.java:838)
        at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:986)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1142)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1331)
        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:682)
        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:587)
        at hudson.model.Run.execute(Run.java:1557)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:236)

1 个答案:

答案 0 :(得分:0)

我的第一个猜测是用户jenkins正在运行,因为没有访问git repo的权限。

我会尝试登录服务器并运行

sudo su <jenkins_user_name>
git clone https://.....

如果已经设置了SSH密钥,您可能只需要将服务器添加到已知主机。