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

fatal: Authentication failed for 'repoUrl' #886

Open
1 of 6 tasks
empz opened this issue Feb 12, 2020 · 3 comments
Open
1 of 6 tasks

fatal: Authentication failed for 'repoUrl' #886

empz opened this issue Feb 12, 2020 · 3 comments

Comments

@empz
Copy link

empz commented Feb 12, 2020

Which Version of GCM are you using ?
Git Credential Manager for Windows version 1.20.0

Which service are you trying to connect to

  • Azure DevOps
  • Azure DevOps Server (TFS 2018 on-prem)
  • GitHub
  • GitHub Enterprise
  • Bitbucket
  • Other? - please describe;

Expected behavior
I should be able to pull and pull from/to the origin repository.

Actual behavior
Error:
fatal: Authentication failed for 'http://mydomain.com:8181/tfs/Dev/_git/AP/'

I've deleted all credentials for that domain in the Windows Credential Manager as I did in the past expecting to get a challenge to enter them again, but this is not happening.

Set the env variables GCM_TRACE=1 and GIT_TRACE=1 and run your git command. Redact any private information and attach the log

14:40:07.458522 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
14:40:07.460540 git.c:419               trace: built-in: git push
14:40:07.461521 run-command.c:643       trace: run_command: GIT_DIR=.git git remote-http origin http://mydomain.com:8181/tfs/Dev/_git/AP/
14:40:07.471549 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:40:07.472551 git.c:676               trace: exec: git-remote-http origin http://mydomain.com:8181/tfs/Dev/_git/AP/
14:40:07.472551 run-command.c:643       trace: run_command: git-remote-http origin http://mydomain.com:8181/tfs/Dev/_git/AP/
14:40:07.486114 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:40:08.613539 run-command.c:643       trace: run_command: 'git credential-manager get'
14:40:08.683048 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:40:08.684077 git.c:676               trace: exec: git-credential-manager get
14:40:08.684077 run-command.c:643       trace: run_command: git-credential-manager get
14:40:08.759048 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.20.0) 'get'
14:40:08.824123 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
14:40:08.830143 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 74 entries.
14:40:08.886164 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://mydomain.com:8181/'.
14:40:08.898164 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://mydomain.com:8181/' is basic with NTLM=Auto.
14:40:08.898164 ...\Common.cs:765       trace: [QueryCredentials] querying 'Auto' for credentials.
14:40:09.403961 ...uthentication.cs:119 trace: [AcquireCredentials] 'http://mydomain.com:8181/' supports NTLM, sending NTLM credentials instead
14:40:09.403961 ...\Common.cs:780       trace: [QueryCredentials] credentials found.
14:40:09.860215 run-command.c:643       trace: run_command: 'git credential-manager erase'
14:40:09.917192 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:40:09.918155 git.c:676               trace: exec: git-credential-manager erase
14:40:09.918155 run-command.c:643       trace: run_command: git-credential-manager erase
14:40:09.985193 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.20.0) 'erase'
14:40:10.055154 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
14:40:10.061155 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 74 entries.
14:40:10.127184 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://mydomain.com:8181/'.
14:40:10.142186 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://mydomain.com:8181/' is basic with NTLM=Auto.
14:40:10.143182 ...\Common.cs:252       trace: [DeleteCredentials] deleting basic credentials for 'http://mydomain.com:8181/'.
14:40:10.146190 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:http://mydomain.com:8181'.
14:40:10.163154 run-command.c:643       trace: run_command: 'git credential-manager erase'
14:40:10.199190 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:40:10.200156 git.c:676               trace: exec: git-credential-manager erase
14:40:10.200156 run-command.c:643       trace: run_command: git-credential-manager erase
14:40:10.269191 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.20.0) 'erase'
14:40:10.330155 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
14:40:10.336154 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 74 entries.
14:40:10.381155 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://mydomain.com:8181/'.
14:40:10.395230 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://mydomain.com:8181/' is basic with NTLM=Auto.
14:40:10.395230 ...\Common.cs:252       trace: [DeleteCredentials] deleting basic credentials for 'http://mydomain.com:8181/'.
14:40:10.399156 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:http://mydomain.com:8181'.
14:40:10.415156 run-command.c:643       trace: run_command: 'git credential-manager erase'
14:40:10.449183 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:40:10.451155 git.c:676               trace: exec: git-credential-manager erase
14:40:10.451155 run-command.c:643       trace: run_command: git-credential-manager erase
14:40:10.522193 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.20.0) 'erase'
14:40:10.583191 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
14:40:10.588154 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 74 entries.
14:40:10.633190 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://mydomain.com:8181/'.
14:40:10.647196 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://mydomain.com:8181/' is basic with NTLM=Auto.
14:40:10.647196 ...\Common.cs:252       trace: [DeleteCredentials] deleting basic credentials for 'http://mydomain.com:8181/'.
14:40:10.652177 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:http://mydomain.com:8181'.
fatal: Authentication failed for 'http://mydomain.com:8181/tfs/Dev/_git/AP/'
@totollygeek
Copy link

I am having the same issue sporadically happening on different machines. It is the same as #879 . There I thought it was due to a Windows update, but now I am seeing it happening on other places. Tracing fails with the same line:
...aseSecureStore.cs:59 trace: [Delete] credentials not found for...

Please help us diagnose that issue. Happens on AzureDevOps OnPrem, also for me!

@totollygeek
Copy link

Interestingly, on some occasions the advice given in the other issue, to change the security channel helped on one of the machines. On the others there is no change in the behavior...

@totollygeek
Copy link

totollygeek commented Apr 1, 2020

So after digging a little it, I have found the following strange behavior.
On a both machines, when I call, for example git pull I am getting:

run-command.c:663       trace: run_command: 'git credential-manager get'

I believe this is GIT's trace. Then credential-manager's code (C#) is being invoked and succeeds with

...\Common.cs:780       trace: [QueryCredentials] credentials found.

This is where things differ. On the machine where things work, after this line, I get:

run-command.c:663       trace: run_command: 'git credential-manager store'

While on the machine where it fails, I get:

run-command.c:663       trace: run_command: 'git credential-manager erase'

I am still trying to figure out why it is trying to erase credentials there. After it tries that, it did not find them and fails.

If I add my credentials manually inside Windows Credentials Manager on the failing machine, this fixes it and I get the same log as in the working one.

So my question here is: Isn't Git Crednetials Manager supposed to add those credentials in the Windows Credentials Manager? At least it is doing it for other repositories. What is different here, which makes GIT invoke erase?

Any help from the maintainers here would be awesome.

Update

When I add the credentials manually in Windows Credential Manager I enter it like that:
Internet or network address: git:https://my-azure-devops-domain.com
User name: my-user-name
Password: my-password
Persistance: Enterprise (This one I did not set, I don't know how it is being set)

When I run git pull it succeeds and I get another credential in Windows Credential Manager, which looks like this:
Internet or network address: git:https://my-user-name@my-azure-devops-domain.com
User name: my-user-name
Password: my-password
Persistance: Local computer

If I delete the second one, it gets recreated when I call git pull. If I delete only the first one, that I have created manually, I get the same erroneous behavior, despite the fact that the second one is still there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants