1

我能够克隆我为我在 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)
4

1 回答 1

0

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

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

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

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

于 2013-05-01T20:28:08.943 回答