詹金斯 - 错误克隆远程回购'起源' [英] jenkins - Error cloning remote repo 'origin'

查看:245
本文介绍了詹金斯 - 错误克隆远程回购'起源'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的机器上本地安装了Jenkins服务器。
配置了一个Jenkins作业来克隆BitBucket存储库。还做了以下事情:
*最初生成的SSH-Key连接到BitBucket。稍后将其更改为使用用户名&在Jenkins的$ Credentials部分中配置的密码
*还在Jenkins作业的结果创建工作区的文件夹上执行了init。在我的例子中,它是C:\Jenkins\jobs\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ b

 错误:10分钟后超时
错误:克隆远程回购'origin'错误
hudson.plugins.git.GitException:命令C:\ Program Files \Git\bin\git.exe
fetch --tags --progress
https://< AccountName> @ bitbucket.org /< repositoryName> /< projectName> .git
+ refs / heads / *:refs / remotes / origin / *org.jenkinsci.plugins返回状态码-1
:stdout
:stderr:
。 (org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl。访问$ 300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl $ 1.execute(CliGitAPIImpl.java:315)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl $ 2.execut e(CliGitAPIImpl.java:512)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild $ AbstractBuildExecution .defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1720)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute( ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
错误:null


解决方案

我设法解决了这个问题。
我确定这是与git.exe路径有关的,我是对的。
当我在git bash中运行以下命令时,它为git.exe提供了一个不同的路径

  $ which git 
/ mingw64 / bin / git

在我之前的配置中,我指向git.exe在位置/ bin / git中。

I have setup Jenkins server running locally on my machine. Configured a Jenkins job to clone BitBucket repository. Also did the following: * Generated SSH-Key initially to connect to BitBucket. Later changed it to clone from HTTPS using username & password which have been configured in the "Credentials" section in Jenkins * Also did an init on the folder where the workspace is created as a result of the Jenkins jobs. In my case it is C:\Jenkins\jobs\\workspace.

Getting the following exception:

ERROR: Timeout after 10 minutes
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe     
fetch --tags --progress     
https://<AccountName>@bitbucket.org/<repositoryName>/<projectName>.git 
+refs/heads/*:refs/remotes/origin/*" returned status code -1
:stdout 
:stderr: 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1720)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
ERROR: null

解决方案

I managed to get around this problem. I was definitely sure that it was something to do with the git.exe path and I was correct. When I ran the following command in git bash, it gave a different path for git.exe

$which git
/mingw64/bin/git

In my earlier configuration, I pointed to git.exe in the location /bin/git.

这篇关于詹金斯 - 错误克隆远程回购'起源'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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