由于身份验证问题而陷于提取 [英] Stuck at fetch due to authentication issue

查看:203
本文介绍了由于身份验证问题而陷于提取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行在Windows 2012 R2 x64上的Jenkins(2.0 Beta-2)服务器,配置了一个新的内部版本以从TFS GIT(2013)获取源文件。我已经安装了Microsoft提供的Git for Windows版本 - 声称可以解决GIT CLI和TFS GIT之间的身份验证问题。



我的.gitconfig看起来像这样:

  [凭证] 
助手=经理
交互式=从不
验证=假
integrated = true

Jenkins在服务帐户下运行,没有交互式会话。此服务帐户是构建服务器上本地管理员组的成员,并且已妥善配置为TFS上的贡献者。这里的问题是,当Jenkins构建开始时,它会在以下命令期间挂起:

  git.exe -c core.askpass = true fetch --tags --progress http://my.tfs.server:8080 / tfs / collection / _git / MyProject + refs / heads / *:refs / remotes / origin / * 

对我来说,它似乎很明显是卡住了,要求提供凭据,尽管我已经将它设置为使用git-credential-manager 。我也尝试使用GCM中的store命令来存储服务帐户凭证,但它失败时出现了一个奇怪的错误(使用它的语法非常混乱,所以有可能我做错了一些事情试试吧)。

解决方案

对于我们来说,完全取消credential.helpergit config变量就是答案。从Git 2.5.0升级到2.8.4后,我们的工作挂在同一个地方,我们的Jenkins服务以本地系统的形式运行,因此执行以下操作取消设置变量:

  git config --global --unset credential.helper 
git config --system --unset credential.helper

不需要重新启动或卸载/重新安装。之后,从Git构建成功。

Jenkins Git Client插件似乎依赖 GIT_ASKPASS 变量被设置,根据证书助手文档是在没有定义证书助手的情况下使用的。


I have a Jenkins (2.0 Beta-2) server running on Windows 2012 R2 x64, with a new build configured to get source files from TFS GIT (2013). I have already installed the Git for Windows version provided by Microsoft - the one that claims to solve the authentication issue between GIT CLI and TFS GIT.

My .gitconfig looks like this:

[credential]
    helper = manager
    interactive = never
    validate = false
    integrated = true

Jenkins is running under a service account, with no interactive session. This service account is member of the local admin group on the build server, and is properly configured as a contributor on TFS. The issue here is that when the Jenkins build starts, it hangs during the following command:

git.exe -c core.askpass=true fetch --tags --progress http://my.tfs.server:8080/tfs/collection/_git/MyProject +refs/heads/*:refs/remotes/origin/*

To me, it seems clear that it is stuck, asking for credentials, even though I have set it to use the git-credential-manager. I have also tried to store the service account credentials, using the "store" command from the GCM, but it fails with an weird error (the syntax to use it is quite confusing, so it is possible that I'm doing something wrong while trying it).

解决方案

For us, unsetting the "credential.helper" git config variable entirely was the answer. Our jobs were hanging at the exact same spot after upgrading from Git 2.5.0 to 2.8.4, and our Jenkins service is running as Local System, so doing the following unset the variable:

git config --global --unset credential.helper
git config --system --unset credential.helper

No reboot or uninstall/reinstall was necessary. After that, builds from Git succeeded.

The Jenkins Git Client plugin appears to rely on the GIT_ASKPASS variable being set, which according to credential helper documentation is used when there are no credential helpers defined.

这篇关于由于身份验证问题而陷于提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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