Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Git failed with a fatal error. Authentication failed #660

Closed
DigitalAssasin opened this issue Jun 15, 2018 · 35 comments
Closed

Git failed with a fatal error. Authentication failed #660

DigitalAssasin opened this issue Jun 15, 2018 · 35 comments
Labels
visual-studio Related to Microsoft Visual Studio (v15.0 or later) IDE.

Comments

@DigitalAssasin
Copy link

Hi gentlemen,

I browsed the issues of the credential manager repository but none of the tipps and solutions helped us so far.

We have an on-premise installation of TFS 2018 running. On all but one workspaces we can work fine with the TFS-Git repository. On one workplace there is an issue with authentication.

While cloning the repository from Visual Studio, Team Explorer shows this error:

Git failed with a fatal error.
Authentication failed for 'http://tfs-2018:8080/tfs/cadclickcollection/CADClick%20Projects/_git/ccCatalog/'

On the command line, cloning is working great.

I tried already to log during a clone process and I can see only one significant difference.

On my (working) computer credential manager creates and stores the correct authentication information.

git_working.log

On the other (not working computer) credential manager tries to erase them.

git_not_working.log

We already tried things like manual creation and clean sweeping of the credentials. We tried to uninstall and re-install both Git and Visual Studio. We also tried to set the authentication method by environment variable.

Currently we use the Git for Windows which is shipped by the Visual Studio Installer.

Any ideas what we can do to get deeper in the research what causes this error on our side?

Regards,

Christian

@whoisj
Copy link
Contributor

whoisj commented Jun 15, 2018

Which version of Visual Studio are you using?

I'm wondering if you're experiencing the same problem as described here (note I'm pointing to the comment, not the issue itself).

@whoisj whoisj added the visual-studio Related to Microsoft Visual Studio (v15.0 or later) IDE. label Jun 15, 2018
@DigitalAssasin
Copy link
Author

We are using Visual Studio Enterprise 2017 15.7.3 on all developer workstations.

@whoisj
Copy link
Contributor

whoisj commented Jun 15, 2018

15.7.3

Yup, we've found a bug in the Git for Windows package that we shipped in Visual Studio (VS does not use your installed Git, but instead contains its own Git package) that affects users using Secure Channel.

If you look at Visual Studio > Team Explorer > Settings > Global Settings, what does the Cryptographic network provider down-down menu show?

@DigitalAssasin
Copy link
Author

On both working and not working workstation the option is set to "Löschen / Delete(?)". We are working with the German version of Visual Studio.

@whoisj
Copy link
Contributor

whoisj commented Jun 15, 2018

"Delete"?! Maybe "Unset"? Hmm - wonder if we have a translation failure here.

If unset, it should be defaulting to OpenSSL. Why not try OpenSSL and/or Secure Channel and see if one unblocks you?

@rockit666
Copy link

Hi, I have the same issue here. VS 15.7.3 german version, Windows 10. I'm connected via VPN and also use a private server with http connection. I tried to repair VS, reinstall GIT, OpenSSL and secure Channel. Different configurations. Nothing works. (it works with browser) Every time the same message:

Fehler beim Abrufen: Git failed with a fatal error.
Authentication failed for 'http://lomoofsv09:8080/tfs/DefaultCollection/D4G/_git/D4G.WebApplication/'

@DigitalAssasin
Copy link
Author

A better german translation for "Unset" could be "Nicht festgelegt" or something like that...

But anyhow: We alread tried to switch the Cryptographic network provider settings as we found this as a common tip on stackoverflow. But this doesn't work either.

Any other ideas?

And one important thing: Thank you so much for your commitment and that you try to help us in this case!

@rockit666
Copy link

hmm.. I tried the same with Visual Studio Code and get the same message:
Is it a windows 10 / Git problem ?
Suchen nach Git in: C:\Program Files\Git\cmd\git.exe
Verwenden von Git 2.17.1.windows.2 von C:\Program Files\Git\cmd\git.exe

git rev-parse --show-toplevel
git config --get commit.template
Open repository: c:\Data\Projects\TFS\D4G\D4G.WebApplication
git status -z -u
git symbolic-ref --short HEAD
git show :src/app/core/services/app.service.ts
git check-ignore -z --stdin
git rev-parse develop
git rev-parse --symbolic-full-name develop@{u}
git rev-list --left-right develop...refs/remotes/origin/develop
git for-each-ref --format %(refname) %(objectname) --sort -committerdate
git remote --verbose
git check-ignore -z --stdin
git check-ignore -z --stdin
git pull --tags origin develop
git show :src/app/core/services/app.service.ts
fatal: Authentication failed for 'http://lomoofsv09:8080/tfs/DefaultCollection/D4G/_git/D4G.WebApplication/'

@rockit666
Copy link

rockit666 commented Jun 18, 2018

that's strange.. I tried different things..
I'm using now the IP address of the server and it works.

@DigitalAssasin : It's maybe also a solution for you ?

@DigitalAssasin
Copy link
Author

DigitalAssasin commented Jun 18, 2018

Ok... I think, this is a thing we haven't tried. We will try this and report.

Thanks!

Update

We tried this solution but it also doesn't work on our site.

@DigitalAssasin
Copy link
Author

Hi together,

this issue persists also with the latest Visual Studio 2017 Enterprise Release 15.7.4.

But an other interesting thing: It seems that the error is caused by anything around the user account. If we use other account information on the same workstation, the cloning works great.

Maybe this is more a TFS user account management related issue.

We will research further and report our future findings.

@DigitalAssasin
Copy link
Author

DigitalAssasin commented Jun 19, 2018

OK, we figured it out.

The cloning problems were cause by a special character in the domain account password of my colleague. His password contained a '#' character which prevented him from cloning the repository. We changed his password and now everything is working fine.

Do you think this behavior is relevant for the Windows Credential Manager? Or is it more a Git issue?

@whoisj
Copy link
Contributor

whoisj commented Jun 19, 2018

The cloning problems were cause by a special character in the domain account password of my colleague. His password contained a '#' character which prevented him from cloning the repository. We changed his password and now everything is working fine.

Um... whoa! THAT SHOULD NOT HAPPEN.

Do you think this behavior is relevant for the Windows Credential Manager? Or is it more a Git issue?

I'm guessing that this is a bug in libcurl (Git component). I think the real solution here is to ask your TFS admin to enable NTLM authentication to the server. This will avoid entering your username + password when accessing the server, and instead rely on NTLM to handle everything for you.

@rockit666
Copy link

Hi all,
well.. It's was necessary to change my password. Now I have the same problem again.
The authentication hell is back.

@whoisj
Copy link
Contributor

whoisj commented Jun 25, 2018

@rockit666 can you collect trace logs of the problem?

  1. Open Command Prompt.
  2. Run setx GIT_TRACE %UserProfile%\git.log.
  3. Run setx GCM_TRACE %UserProfile%\git.log.
  4. Restart Visual Studio.
  5. Reproduce your issue.

Once you have the logs, please share them here. Of course, please redact the logs for any private, secret, or personally identifiable information before sharing.

Git trace logs get large quickly, to stop the trace log collection

  1. Open Command Prompt.
  2. Run setx GIT_TRACE ""
  3. Run setx GCM_TRACE ""
  4. Restart Visual Studio.

@hjzech
Copy link

hjzech commented Jul 25, 2018

I solved the authentication issue by removing the GIT credentials from windows account manager (control panel). After this Windows asks for credentials during the next GIT session and stores them again in cedential manager.

@JohnyWS
Copy link

JohnyWS commented Aug 7, 2018

Not to tell too much about your password, but I'm pretty sure # isn't the issue but ¤ is on the other hand. I had to change password for the exact same reason... :-/

@pat1st
Copy link

pat1st commented Sep 4, 2018

thanks @hjzech this solved my issue!!
I was even able to edit my recently changed password directly inside of "Control Panel\Credential Manager"

@rmjoia
Copy link

rmjoia commented Sep 18, 2018

Same here! Thanks @hjzech!

Did it in Control Panel\Credential Manager => Windows Credentials

@glrcoder
Copy link

My problem, too. Thanks!

@htmlandreza
Copy link

It happened to me too, because I configured another git / github account and windows saved on the credentials, when I noticed the error I changed only in gitconfig but windows continued with the other stored account and this caused several conflicts in my VS2017.

After removing all credentials from git, VS ran normally.

@georgemakapane
Copy link

Removing my Git Credentials from Credential Manager solved my issue...

@RobertoBorges
Copy link
Member

The same thing to me, removing my Git Credentials but in French : Gestionnaire d'identification

@fabercs
Copy link

fabercs commented Oct 17, 2018

I solved the authentication issue by removing the GIT credentials from windows account manager (control panel). After this Windows asks for credentials during the next GIT session and stores them again in cedential manager.

Please somebody tell me what the cli equivalent of this resetting credentials, because in a company domain I have no permission to reach that panel.

@bmcdonnell-ionx
Copy link

I got the error message described in the OP today on git fetch from an http (not https) repo on our Windows domain. It took a while troubleshooting until my IT guy found this issue. Deleting my credentials for that repo from Windows Credential Manager as described by @hjzech resolved my problem for now.

Is there a way to add some feature to GCMW or Git for Windows to fix or workaround this automatically? Say to have it prompt for new credentials when the stored ones fail. That way future users (including myself when I forget) don't have to spend hours troubleshooting.

@Chazoo12
Copy link

Chazoo12 commented Mar 1, 2019

Fixed this issue with Windows Credential Manager (Control Panel). I found the entry for the GitLab I was trying to hit and deleted it. Next time I made a pull request it popped a login box.

@Nuck101
Copy link

Nuck101 commented Mar 14, 2019

Just wanted to add a +1 and thanks for this, as this (Windows Credential Manager in Control Panel) also fixed my issue with closing GIT repos in TFS.

@aridoaridokadotoji
Copy link

My problem too. Thanks @hjzech.

@kirill-d-lappo
Copy link

I hate the issue, really. This was one the points that made me move to linux.

It's madness. It works only at first time use! If you change your domain password - you're on tiny ice.

In my case I should GUESS on my own that I MUST NOT delete the record from Windows Credential Manager and just update it! Otherwise I would get into endless Authentication failed problem. Reinstallation doesn't help here.

I spent like hours of searching, trying, googling. I just lost my patient and make it use local file storage. It's not secure at all, but at least my butt will not burn after each password change!

@raghuk421
Copy link

use git bash it solves all problems

@tnquan
Copy link

tnquan commented Oct 25, 2019

I've met same issue. My solution is run Microsoft Visual Studio (Pro. version) as Administrator, then login your Git account in github.com website. Then clone again. Hope this help you. Thanks !

@amokhtari92
Copy link

amokhtari92 commented Nov 2, 2019

The problem has occurred to me too. As @Kira-Lappo mentioned, there is no way back when you remove your git credential from windows credentials manager. I did it and I couldn't reach the remote git server through visual studio, instead, direct access using cli worked for me.

Other Reports

  • All of the repositories were available from tfs web.
  • All Important permissions re-assigned.
  • 'helper' config updated both in global and system config files using 'manager', 'git credential manager path' and empty values (Non of them worked).

Finally
As @DigitalAssasin experienced, I changed my account's password (which didn't contain any special character) and it made Visual Studio to ask my password again which turned on the git operations again.

The interesting section
When I returned to credentials manager of windows, the git url path was just contain git:http://+hostname:+port of TFS server while It has been a full absolute path of repository before.

My Comment
It seems that Visual Studio is caching credentials in its own way and does not fully rely on windows credential manager or git configuration.

@Bugzuki
Copy link

Bugzuki commented Jul 8, 2020

I had an issue because I had a space character in my Windows password. Once I changed my password I had to remove the Windows Credential and then it allowed me to log in again.

This is very disappointing because I like typing sentences into my passwords, now I am back to old dumb ones.

@Leon-Africa
Copy link

Anyone else finding themselves here - take note if you may be on a corporate proxy.

Steps to resolve (On windows):

  1. Go to Windows Credentials Helper and delete all git credentials
  2. Go to .gitconfig (found in ~/) add
[credential]
        helper = wincred
[http]
        proxy = proxyurl:port

Ensure correct Username and Email is specified in [user]

  1. Now attempt to clone the repository - you will be prompted to enter credentials - these credentials will then be stored in Windows Credential Helper for future use.

Documentation References:
https://git-scm.com/docs/gitcredentials
https://gist.github.com/evantoli/f8c23a37eb3558ab8765
https://git-scm.com/docs/git-config

@dscho
Copy link
Member

dscho commented Oct 20, 2020

helper = wincred

You're basically saying: don't use Git Credential Manager for Windows. I agree. But then you say: "use wincred" despite the fact that it is unmaintained. I would say: use Git Credential Manager Core instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
visual-studio Related to Microsoft Visual Studio (v15.0 or later) IDE.
Projects
None yet
Development

No branches or pull requests