Fixed due to authentication

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

My.gitconfig looks like this:

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

Jenkins runs under a service account without an interactive session. This service account is a member of the local Administrators group on the build server and is correctly configured as a contributor to TFS. The problem here is that when the Jenkins build starts, it freezes 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/* 

It seems to me that it is stuck asking for credentials, although I installed it to use git-credential-manager. I also tried to save the service account credentials using the "store" command from GCM, but it fails with an unusual error (the syntax for use is rather confusing, so it's possible that I'm doing something wrong, but by trying it).

+6
source share
2 answers

For us, unsetting "credential.helper" git config was completely the answer. Our jobs hung in the same place after upgrading from git 2.5.0 to 2.8.4, and our Jenkins service works as a local system, so the following setting:

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

No reboot or removal / reinstallation required. After that builds from git.

The Jenkins git client plugin is believed to rely on the GIT_ASKPASS variable, which, according to the documentation of the helper helper, is used when credential helpers are not defined.

+35
source

After digging for a while, I found that I was not using the correct version of Git for Windows. It is known that the "standard" Git for Windows does not work very well with TFS GIT, mainly due to the lack of Kerberos support. I thought I was using the correct version, but I was not.

As part of setting up the build environment, I installed Visual Studio 2015. Along with this, it installs an incompatible version of Git for Windows that does not work with TFS Git (I really don't know why!). Even after installing Git Credential Manager for Windows, the installed version of Git remains incompatible.

In short: I had to manually uninstall both Git and GCM, and install only GCM, which would then install the correct version of the Git client during its installation.

After that, just restart the server and everything should work “magically”.

+2
source

All Articles