由于身份验证问题卡在获取 [英] Stuck at fetch due to authentication issue

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

问题描述

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

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.

我的 .gitconfig 看起来像这样:

My .gitconfig looks like this:

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

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

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/*

对我来说,即使我已将其设置为使用 git-credential-manager,它似乎也很明显卡住了,要求提供凭据.我还尝试使用 GCM 中的store"命令存储服务帐户凭据,但它失败并出现奇怪的错误(使用它的语法非常混乱,因此我可能在做错事时试试看).

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).

推荐答案

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

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

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

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

Jenkins Git 客户端插件似乎依赖于 GIT_ASKPASS 变量被设置,根据凭证助手 documentation 使用当没有定义凭证助手时.

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天全站免登陆