Git获取失败 [英] Git Fetch Fails

查看:761
本文介绍了Git获取失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是詹金斯的新手.我只是在Windows 2016服务器上设置了詹金斯.我正在创建将git用于scm的新作业.当我去建立工作时,它会创建文件夹和git.它卡在git fetch上.它超时.我已经将詹金斯设置为服务.我使用本地管理员帐户登录服务器,以尝试消除权限问题.从git fetch日志中显示的错误是GitException,然后返回状态代码-1073741510.我搜索了,找不到任何地方的错误号.如果我打开命令窗口并转到使用完全相同的用户登录的完全相同的文件夹,然后发出完全相同的访存命令,它将正常工作.谁能帮我弄清楚从这里去哪里可以解决这个问题?

I am brand new to jenkins. i just set up jenkins on a windows 2016 server. i am creating a new job that will use git for scm. when i go to build the job it creates the folders and inits git. it gets stuck on the git fetch. it times out. i have jenkins set up as a service. i have it use a local administrator account to log in to the server to try to eliminate permissions problems. the error shown in the log from the git fetch is GitException then returned status code -1073741510. i searched and can't find that error number anywhere. if i open a command window and go to the exact same folder being logged in with the exact same user and issue the exact same fetch command it works fine. can anyone help me figure out where to go from here to figure this out?

这是构建日志.

我抽象了事物的名称:

13:01:51 Started by user Admin
13:01:51 Building in workspace D:\Jenkins\workspace\MyProject - Staging
13:01:51 Cloning the remote Git repository
13:01:51 Cloning repository ssh://myserver.com/git/Software.git
13:01:51 > git.exe init D:\Jenkins\workspace\MyProject - Staging # timeout=10
13:01:51 Fetching upstream changes from ssh://myserver.com/git/Software.git
13:01:51 > git.exe --version # timeout=10
13:01:52 using GIT_ASKPASS to set credentials
13:01:52 > git.exe fetch --tags --progress ssh://myserver.com/git/Software.git +refs/heads/:refs/remotes/origin/ # timeout=5
13:06:52 ERROR: Timeout after 5 minutes
13:06:52 ERROR: Error cloning remote repo 'origin'
13:06:52 hudson.plugins.git.GitException: Command "git.exe fetch --tags --progress ssh://myserver.com/git/Software.git +refs/heads/:refs/remotes/origin/" returned status code -1073741510:
13:06:52 stdout:
13:06:52 stderr:
13:06:52 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
13:06:52 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)
13:06:52 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72)
13:06:52 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:442)
13:06:52 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:655)
13:06:52 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
13:06:52 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
13:06:52 at hudson.scm.SCM.checkout(SCM.java:504)
13:06:52 at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
13:06:52 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
13:06:52 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
13:06:52 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
13:06:52 at hudson.model.Run.execute(Run.java:1810)
13:06:52 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
13:06:52 at hudson.model.ResourceController.execute(ResourceController.java:97)
13:06:52 at hudson.model.Executor.run(Executor.java:429)
13:06:52 ERROR: Error cloning remote repo 'origin'
13:06:52 Finished: FAILURE

当我在同一文件夹中的命令行中手动执行git fetch时,它可以正常工作,并且不到2分钟.

When I manually do the git fetch at a command line in the same folder it works fine and takes less than 2 minutes.

推荐答案

我发现了一个与您的问题非常相似的问题.

I found a problem very similar to yours.

简而言之,快速解决方案之一是卸载/重新安装git-for-window,并确保在安装过程中禁用启用Git凭据管理器"选项.

In short one of quickly solution is Uninstall/Re-install git-for-window and ensure to disable the option "Enable Git Credential Manager" during the installation.

此选项默认情况下处于启用状态,并在系统级别设置git属性credential.helper.这将迫使git客户端使用Windows的Git凭据管理器,而不是Jenkins提供的本地配置.因此,它会使您的构建挂起(如果以系统帐户身份运行节点)或失败(如果以本地用户身份运行节点).

This option is enabled by default and set the git property credential.helper at a system level. This forces the git client to use the Git Credentials Manager for Windows instead of the local configuration provided by Jenkins. Consequently it makes your build either hang (if running the node as an System Account) or fail (if running the node as a local User).

Git for Windows安装程序屏幕截图

此链接上还有其他两种解决方案.

Other two solutions available on this link.

https://support.cloudbees.com/hc/en-us/articles/221046888-Build-Hang-or-Fail-with-Git-for-Windows

这篇关于Git获取失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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