错误:提取远程回购协议' origin'时出错. ,返回状态码-1: [英] ERROR: Error fetching remote repo 'origin' , returned status code -1:

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

问题描述

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

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)   

更改密码后开始出现此错误.
我创建了新的SSH密钥并将其添加到github存储库中.我能够克隆存储库并通过命令行构建.

    mvn clean install

解决方案

尝试使用git config --global --unset credential.helper禁用git凭据缓存的使用.如果已在系统配置文件中设置了git config --system --unset 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

这篇关于错误:提取远程回购协议&amp;#39; origin&amp;#39;时出错. ,返回状态码-1:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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