本文介绍了错误:错误获取远程回购'起源',返回的状态码-1:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在windows上运行Jenkins,当我试图通过jenkins构建我的项目时,发生以下错误:

  git.exe -c core.askpass = true fetch --tags --progress< url> Assist-Ops.git + refs / heads / *:refs / remotes / origin / * 
错误:10分钟后超时
> git.exe config --local --remove-section credential#timeout = 10
错误:获取远程回购'origin'出错
hudson.plugins.git.GitException:无法从< url>
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066)
at hudson.plugins .git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269 )


。在hudson.model.AbstractBuild $ AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
在jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
。在hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:529)
处hudson.model.FreeStyleBuild hudson.model.Run.execute(Run.java:1738)
。运行(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
引起:hudson.plugins.git.GitException:命令git.exe -c core.askpass = true fetch --tags --progress< URL> / Assist-Op s.git + refs / heads / *:refs / remotes / origin / *返回的状态码-1:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl .launchCommandIn(CliGitAPIImpl.java:1719)
。在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
。在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access $ 300( CliGitAPIImpl.java:63)
处hudson.plugins.git.GitSCM.fetchFrom org.jenkinsci.plugins.gitclient.CliGitAPIImpl $ 1.execute(CliGitAPIImpl.java:314)
(GitSCM.java:808 )

在我更改密码后开始发生此错误。

我已创建新的SSH密钥并将其添加到github存储库。我可以克隆存储库并通过命令行构建。

  mvn clean install 


解决方案

尝试使用禁用git凭证缓存使用git config --global - 启用credential.helper 。如果已经在系统配置文件中设置了,那么你可能还需要做 git config --system --unset credential.helper

I am running Jenkins on windows and when I am trying to build my project through jenkins, the following error occurs:

git.exe -c core.askpass=true fetch --tags --progress <url>Assist-Ops.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
 > git.exe config --local --remove-section credential # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from <url>
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)


at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true fetch --tags --progress <URL>/Assist-Ops.git +refs/heads/*:refs/remotes/origin/*" returned status code -1:
stdout:
stderr:
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:808)

Started getting this error after I changed my password.
I have created new SSH key and added it to github repository. I am able to clone the repository and build though command line.

    mvn clean install
解决方案

try to disable use of the git credential cache using git config --global --unset credential.helper. You may also need to do git config --system --unset credential.helper if this has been set in the system config file

这篇关于错误:错误获取远程回购'起源',返回的状态码-1:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 13:14