Jenkins在从gitHub克隆时给出错误 [英] Jenkins giving error while cloning from gitHub

查看:223
本文介绍了Jenkins在从gitHub克隆时给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Jenkins 的新手,我从 GitHub 中克隆存储库时遇到以下错误。



我试图在这里搜索所有相关的问题,但可以找到确切的stacktstrace和答案。



我想克隆要求用户名和密码,我在作业配置设置中提供 SSH:// repository-path。我还没有做任何.ssh相关的设置,因为这似乎与GIT存储库的安全问题不同。



我找不出Jenkins试图执行哪个注释,哪个文件/目录没有找到。



这是我从Jenkins工作中确切的堆栈跟踪: IOException:无法运行程序:错误尝试
确定git版本:执行命令时出错:--version
假设1.6
错误:克隆远程repo错误'myRE':无法克隆git @ github.com:myORG/RVL.myProj.git
hudson.plugins.git.GitException:无法在hudson.plugins.git中克隆git@github.com:myORG / RVL.myProj.git
。 GitAPI.clone(GitAPI.java:268)
at hudson.plugins.git.GitSCM $ 2.invoke(GitSCM.java:1122)
at hudson.plugins.git.GitSCM $ 2.invoke(GitSCM。
at hudson.FilePath.act(FilePath.java:842)
at hudson.FilePath.act(FilePath.java:824)
at hudson.plugins.git.GitSCM .checkout(GitSCM.java: 1064)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
at hudson.model.AbstractBuild $ AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
at jenkins.scm .SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:494)
at hudson.model.Run.execute(Run.java:1502 )
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor。运行(Executor.java:236)
导致:hudson.plugins.git.GitException:执行命令时出错:clone -o RVL.myProj git@github.com:myORG / RVL.myProj.git
/ var / lib / jenkins / jobs / myProj / workspace
at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:862)
at hudson.plugins.git.GitAPI.access $ 000(GitAPI .java:40)
at hudson.plugins.git.GitAPI $ 1.invoke(GitAPI.java:264)
at hudson.plugins.git.GitAPI $ 1.invoke(GitAPI.java:244)
at hudson.FilePath.act(
at hudson.FilePath.act(FilePath.java:824)
at hudson.plugins.git.GitAPI.clone(GitAPI.java:244)
.. 。13 more
引起:java.io.IOException:无法运行程序:error = 2,没有这样的文件或目录
在java.lang.ProcessBuilder.start (未知源)
at hudson.Proc $ LocalProc。(Proc.java:244)
at hudson.Proc $ LocalProc。(Proc.java:216)
at hudson.Launcher $ LocalLauncher .launch(Launcher.java:709)
at hudson.Launcher $ ProcStarter.start(Launcher.java:338)
at hudson.Launcher $ ProcStarter.join(Launcher.java:345)
at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:843)
... 19 more
引起:java.io.IOException:error = 2,没有这样的文件或目录
在java.lang.UNIXProcess.forkAndExec(Native方法)$ b $在java.lang.UNIXProcess。(未知源)
在java.lang.Pro



解决方案

我碰到并修复了同样的问题:)

配置git的路径:


  1. 关于Jenkins Master



    a 。进入Jenkins系统配置(Jenkins - >管理Jenkins - >配置系统)



    b。找到Git项并配置git安装(在Jenkins Master上指定git路径)

  2. b

    a。输入Jenkins Slave的配置



    b。检查工具位置复选框并在Jenkins从属设备上指定git的路径。

在我的情况中,没有权限访问Jenkins Master。所以我在Jenkins Slave上安装git并将它添加到Jenkins Slave的配置中。

I am new to Jenkins, I am getting following error while cloning repository from GitHub.

I tried to search all relevant issues here but could find exact stacktstrace with answers.

I am trying to clone repository which requires username and password, I am providing SSH:// repository-path in job configuration settings for my job. I have not done any .ssh related settings yet as this seems to be different problem than security issue with GIT repository.

I couldn't figure out what comment Jenkins is trying to execute, which file/directory it is not finding clueless.

Here is my exact stack trace from Jenkins job:

Caused by: java.io.IOException: Cannot run program: Error trying to determine the git version: Error performing command: --version Assuming 1.6 ERROR: Error cloning remote repo 'myRE' : Could not clone git@github.com:myORG/RVL.myProj.git hudson.plugins.git.GitException: Could not clone git@github.com:myORG/RVL.myProj.git at hudson.plugins.git.GitAPI.clone(GitAPI.java:268) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1122) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1064) at hudson.model.AbstractProject.checkout(AbstractProject.java:1256) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494) at hudson.model.Run.execute(Run.java:1502) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) Caused by: hudson.plugins.git.GitException: Error performing command: clone -o RVL.myProj git@github.com:myORG/RVL.myProj.git /var/lib/jenkins/jobs/myProj/workspace at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:862) at hudson.plugins.git.GitAPI.access$000(GitAPI.java:40) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:264) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:244) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.git.GitAPI.clone(GitAPI.java:244) ... 13 more Caused by: java.io.IOException: Cannot run program "": error=2, No such file or directory at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.(Proc.java:244) at hudson.Proc$LocalProc.(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:709) at hudson.Launcher$ProcStarter.start(Launcher.java:338) at hudson.Launcher$ProcStarter.join(Launcher.java:345) at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:843) ... 19 more Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(Unknown Source) at java.lang.Pro

解决方案

I encountered and fixed the same problem :)

There are two way to configure the path of git:

  1. On Jenkins Master

    a. Enter Jenkins System Configure (Jenkins -> Manage Jenkins -> Configure System )

    b. Find the Git item and Configure the git installation (specify the git path on Jenkins Master)

  2. On Jenkins Slave

    a. Enter Jenkins Slave's Configure

    b. Check the "Tool Locations" Checkbox and specify the path of git on the Jenkins Slave.

In my situation, I don't have the privilege to access the Jenkins Master. So I install the git on the Jenkins Slave and add it to Jenkins Slave's Configure.

这篇关于Jenkins在从gitHub克隆时给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆