linux - 无法将存储库克隆到 linux 上的 jenkins

标签 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)

最佳答案

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

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

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

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

关于linux - 无法将存储库克隆到 linux 上的 jenkins,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14767140/

相关文章:

c - GDB - 将串行输出(从 dmesg)重定向到文件,而不是 gdb 输出/TUI?

regex - 在一个文件中出现 Bash

php - 我如何在 ubuntu 上使守护进程崩溃

node.js - 在 Ubuntu 服务器上运行 selenium-standalone npm 包

bash - [Google Cloud][Compute Engine] 在启动脚本中找不到 Linux 基础命令

git - 如何自动验证所有提交者 PGP 签名他们的提交

github - 如何在 Visual Studio 代码中使用 .gitignore?

c - 最大线程和最佳线程

linux - 结束内核 panic - 不同步 : attempted to kill init! exitcode = 0x00007f00

git - 如何从git分支中删除文件