Git: "Authentication failed" after Password change

Created on 6 Feb 2019  路  11Comments  路  Source: git-for-windows/git

  • [x] I was not able to find an open or closed issue matching what I'm seeing
    I do see other issues with this error message, but so far those other fixes do not resolve my issue - as I describe below.

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
    64-bit
$ git --version --build-options
git version 2.20.1.windows.1
cpu: x86_64
built from commit: 7c9fbc07db0e2939b36095df45864b8cda19b64f
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
    Windows 7:
$ cmd.exe /c ver

Microsoft Windows [Version 6.1.7601]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
Editor Option: Notepad++
Custom Editor Path: 
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I changed my domain password a few days ago.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash.
I also use Visual Studio 2017.

Any git command but for example:

git clone http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname
  • What did you expect to occur after running these commands?

That the repo would be cloned as usual.

  • What actually happened instead?
fatal: Authentication failed for 'http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname/'
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Sorry, I can't. It's in my intranet, non accessible from the internet.

The Standard Credential Manager Fix does not work:

  • I already tried the standard fix for this error: I went into Control Panel -> Credential Manager and I removed all credentials for this repository. I expected that I would then be prompted for username and password the next time a git command was made. But git bash does not prompt me to enter username and password and still returns the "Authentication failed" error.

Partial Workaround

I can see that credential.helper is manager:

$ git config credential.helper
manager

And when I disable it:

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

I am now prompted for username and password every time I do a git command in Bash but at least it does work and git clone etc starts working again in Bash. HOWEVER, I still have the same error within Visual Studio...
Also, I'd prefer if the windows credential manager was working so I don't have to keep entering username and password.

I can re-enable the windows credential manager with the following command but then I am back to the original issue:

$ git config --system credential.helper manager

Other Info

Here is a trace log:

myusername@LTP-EU10865 MINGW64 /d/Common/myrepositoryname (master)
$ GIT_TRACE=1 GCM_TRACE=1 git clone http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname
17:04:41.459673 exec-cmd.c:236          trace: resolved executable dir: C:/Users/myusername/AppData/Local/Programs/Git/mingw64/bin
17:04:41.460673 git.c:418               trace: built-in: git clone http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname
Cloning into 'myrepositoryname'...
17:04:41.771704 run-command.c:643       trace: run_command: git remote-http origin http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname
17:04:41.827710 exec-cmd.c:236          trace: resolved executable dir: C:/Users/myusername/AppData/Local/Programs/Git/mingw64/libexec/git-core
17:04:41.850712 git.c:675               trace: exec: git-remote-http origin http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname
17:04:41.850712 run-command.c:643       trace: run_command: git-remote-http origin http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname
17:04:41.901717 exec-cmd.c:236          trace: resolved executable dir: C:/Users/myusername/AppData/Local/Programs/Git/mingw64/libexec/git-core
17:04:42.915818 run-command.c:643       trace: run_command: 'git credential-manager get'
17:04:43.266853 exec-cmd.c:236          trace: resolved executable dir: C:/Users/myusername/AppData/Local/Programs/Git/mingw64/libexec/git-core
17:04:43.293856 git.c:675               trace: exec: git-credential-manager get
17:04:43.293856 run-command.c:643       trace: run_command: git-credential-manager get
17:04:43.435870 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.18.3) 'get'
17:04:43.537881 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
17:04:43.604887 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 32 entries.
17:04:43.677895 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://tfs.myorgname.com:8080/'.
17:04:43.694896 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://tfs.myorgname.com:8080/' is basic with NTLM=Auto.
17:04:43.694896 ...\Common.cs:765       trace: [QueryCredentials] querying 'Auto' for credentials.
17:04:44.001927 ...uthentication.cs:119 trace: [AcquireCredentials] 'http://tfs.myorgname.com:8080/' supports NTLM, sending NTLM credentials instead
17:04:44.001927 ...\Common.cs:780       trace: [QueryCredentials] credentials found.
17:04:44.494976 run-command.c:643       trace: run_command: 'git credential-manager erase'
17:04:44.678995 exec-cmd.c:236          trace: resolved executable dir: C:/Users/myusername/AppData/Local/Programs/Git/mingw64/libexec/git-core
17:04:44.700997 git.c:675               trace: exec: git-credential-manager erase
17:04:44.700997 run-command.c:643       trace: run_command: git-credential-manager erase
17:04:44.816008 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.18.3) 'erase'
17:04:44.903017 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
17:04:44.972024 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 32 entries.
17:04:45.017028 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://tfs.myorgname.com:8080/'.
17:04:45.036030 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://tfs.myorgname.com:8080/' is basic with NTLM=Auto.
17:04:45.036030 ...\Common.cs:252       trace: [DeleteCredentials] deleting basic credentials for 'http://tfs.myorgname.com:8080/'.
17:04:45.041031 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:http://tfs.myorgname.com:8080'.
fatal: Authentication failed for 'http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname/'

Any other ideas?

Most helpful comment

Reverting to git version 2.18.0.windows.1 resolves the issue. From my testing, it appears to have been introduced in release 2.19.0

I have tested with multiple versions now:
git version 2.21.0.windows.1.4.gda5a923050 (latest snapshot at time of writing)
git version 2.21.0.windows.1
git version 2.20.1.windows.1
git version 2.19.1.windows.1
git version 2.19.0.windows.1
git version 2.18.0.windows.1

Only 2.18.0 prompted me for updated credentials and then worked as expected, all later versions instead did not prompt me for updated credentials and threw the error I originally reported:

fatal: Authentication failed for 'http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname/'

But 2.18 works normally as expected. And when I then install the latest release 2.21, it now works OK too! I guess I won't have a problem now until my domain password expires again and I am forced to change password. But at least I know now that I can revert to 2.18 to update credentials.

Possibly you might be able to recreate this bug by going into Windows Credential Manager and deleting the credentials for a TFS repository and check does the current git version prompt you to enter them again (we use TFS 2017).

All 11 comments

+1, also seeing this with 2.20.1
(Reverted to 2.18 which is working correctly)

Does this bug still exist in the latest snapshot?

Yes, it still exists for me.

I had installed the latest version: git version 2.21.0.windows.1
but that didn't fix it

And I have also tried the latest snapshot: git version 2.21.0.windows.1.4.gda5a923050
but the bug is still happening

Reverting to git version 2.18.0.windows.1 resolves the issue. From my testing, it appears to have been introduced in release 2.19.0

I have tested with multiple versions now:
git version 2.21.0.windows.1.4.gda5a923050 (latest snapshot at time of writing)
git version 2.21.0.windows.1
git version 2.20.1.windows.1
git version 2.19.1.windows.1
git version 2.19.0.windows.1
git version 2.18.0.windows.1

Only 2.18.0 prompted me for updated credentials and then worked as expected, all later versions instead did not prompt me for updated credentials and threw the error I originally reported:

fatal: Authentication failed for 'http://tfs.myorgname.com:8080/tfs/SDACollection/_git/myrepositoryname/'

But 2.18 works normally as expected. And when I then install the latest release 2.21, it now works OK too! I guess I won't have a problem now until my domain password expires again and I am forced to change password. But at least I know now that I can revert to 2.18 to update credentials.

Possibly you might be able to recreate this bug by going into Windows Credential Manager and deleting the credentials for a TFS repository and check does the current git version prompt you to enter them again (we use TFS 2017).

If I were you, I'd try to test different Git Credential Manager versions. It is quite possible that you found a regression in the latest version.

For easier testing, I'd download the .zip files from https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases, unpack them, and use absolute paths to the respective version's git-credential-manager.exe as my credential.helper setting (that can be set in ~/.gitconfig, no need to meddle with the system config).

Thank you for pointing that out

I have just experienced the same issue after changing my active directory password. Git version 2.23.0.windows.1. Credential Manager entry is already removed, but still got the authentication error and no prompt to enter new password.

Following @gtcgary 's lead that git 2.18.0 doesn't have this problem, and @dscho 's lead that the problem may be in Git Credential Manager, I tried older versions of GCM around the release date of Git 2.18.0. I can confirm that GCM 1.17.0 onward have this problem. GCM 1.16.2 is fine.

So current workaround is install latest version of Git, and then install GCM 1.16.2.

Hey!
I had the same prob. with Windows 10 Pro and Git-2.23.0-64-bit, after I had to change my Gitlab password. For me, the following worked out:
Remove git including the respective folders on C:
and
Install git anew without(!) enabling the Git Credential Manager option in the configuration steps

Afterwards, when I tried to push my rep., the credential manager asked for my credentials one time. Now everything is ok again.

Could you try again after installing GCM Core? I ask because GCM Core is likely to replace GCM for Windows at some stage, and it might have this bug fixed already.

I had a similar problem with GitLab in Visual Studio after changing my GitLab password ' Authentication failed pushing to remote repository xxxxx .git '

All I had to do was

1.) delete _all_ the GitLab credentials out of windows credential manager
2.) restart visual studio
3.) reclone the repo
4.) make a tiny change to master readme, stage, push
5.) it then popped up with an odd windows credential prompt, never seen that before on GitLab repo
6.) Enter gitlab creds
7.) I'm back baby

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vocaviking picture vocaviking  路  5Comments

tldzyx picture tldzyx  路  3Comments

Jarmos-san picture Jarmos-san  路  3Comments

dlk-pavan picture dlk-pavan  路  4Comments

daxelrod picture daxelrod  路  4Comments