Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

fatal: Authentication failed while using Git 2.19.1 #102

Open
aaneja opened this issue Oct 31, 2018 · 12 comments
Open

fatal: Authentication failed while using Git 2.19.1 #102

aaneja opened this issue Oct 31, 2018 · 12 comments

Comments

@aaneja
Copy link

aaneja commented Oct 31, 2018

I have a Ubuntu 18.10 machine

aaneja@anant-vm:~/Code/CustomMetricsSource$ git --version
git version 2.19.1

When I run
aaneja@anant-vm:~/Code/CustomMetricsSource$ GIT_TRACE=1 git pull origin master
I get a OAuth Web browser pop-up, sign in works without errors but the command fails

aaneja@anant-vm:~/Code/CustomMetricsSource$ GIT_TRACE=1 git pull origin master
11:41:55.604083 git.c:415               trace: built-in: git pull origin master
11:41:55.604907 run-command.c:637       trace: run_command: git fetch --update-head-ok origin master
11:41:55.605959 git.c:415               trace: built-in: git fetch --update-head-ok origin master
11:41:55.606180 run-command.c:637       trace: run_command: GIT_DIR=.git git-remote-https origin https://anantaneja.visualstudio.com/DefaultCollection/tatooine/_git/CustomMetricsSource
11:41:55.793951 run-command.c:637       trace: run_command: '/usr/lib/jvm/java-8-oracle/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=false -jar /home/linuxbrew/.linuxbrew/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar get'
Configuration::loadGitConfiguration
Configuration::ParseGitConfig
Configuration::ParseGitConfig
   branch.master.merge = refs/heads/master
   branch.master.remote = origin
   core.autocrlf = false
   core.bare = false
   core.filemode = true
   core.logallrefupdates = true
   core.repositoryformatversion = 0
   credential.helper = !/usr/lib/jvm/java-8-oracle/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=false -jar /home/linuxbrew/.linuxbrew/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar
   remote.origin.fetch = +refs/heads/*:refs/remotes/origin/*
   remote.origin.url = https://anantaneja.visualstudio.com/DefaultCollection/tatooine/_git/CustomMetricsSource
   user.name = Anant Aneja
Program::loadOperationArguments
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Program::EnableTraceLogging
Program::get
   targetUri = https://anantaneja.visualstudio.com/
Program::ComponentFactory::createSecureStore
gnome-keyring library loaded, creating a password SCHEMA
Try access gnome-keyring with dummy data to make sure it's accessible...
Getting a persistent token store that must be secure
Getting a persistent credential store that must be secure
Program::createAuthentication
   detecting authority type
BaseVsoAuthentication::getAuthentication
BaseVsoAuthentication::detectAuthority
   detected visualstudio.com, checking AAD vs MSA
   server has responded
   MSA authority detected
   authority is Microsoft Live
BaseVsoAuthentication::getCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
SecretStore::readCredentials
SecretCache::readCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
BaseSecureStore::readCredentials
Getting Credential for git:https://anantaneja.visualstudio.com
Could not retrieve secret from storage.
Return code: 9 description: No matching results
BaseVsoAuthentication::refreshCredentials
SecretCache::readToken
SecretCache::_getTargetName
Secret::uriToName
   target name = ada:https://anantaneja.visualstudio.com
SecretCache::readToken
SecretCache::_getTargetName
Secret::uriToName
   target name = registry:https://anantaneja.visualstudio.com
   failed to refresh credentials.
VsoMsaAuthentication::InteractiveLogon
AzureAuthority::acquireToken
   token acquisition succeeded.
   token successfully acquired.
BaseVsoAuthentication::storeRefreshToken
SecretCache::writeToken
SecretCache::_getTargetName
Secret::uriToName
   target name = ada:https://anantaneja.visualstudio.com
BaseVsoAuthentication::generatePersonalAccessToken
VsoAzureAuthority::generatePersonalAccessToken
   using token to acquire personal access token
VsoAzureAuthority::populateTokenTargetId
VsoAzureAuthority::createConnectionDataRequest
   validating token
   target identity is 64b9c7f9-09fd-46e9-a315-f580ac090645
   parsed identity service url: https://app.vssps.visualstudio.com/A64b9c7f9-09fd-46e9-a315-f580ac090645/
   creating access token scoped to 'vso.code_write' for '64b9c7f9-09fd-46e9-a315-f580ac090645'
   personal access token acquisition succeeded.
SecretStore::writeCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
BaseSecureStore::writeCredential
Adding a Credential for git:https://anantaneja.visualstudio.com
SecretCache::writeCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
BaseVsoAuthentication::getCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
SecretStore::readCredentials
SecretCache::readCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
   successfully retrieved stored credentials, updating credential cache
BaseVsoAuthentication::validateCredentials
VsoAzureAuthority::validateCredentials
   server returned: 200
   credentials found
11:42:23.770750 run-command.c:637       trace: run_command: '/usr/lib/jvm/java-8-oracle/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=false -jar /home/linuxbrew/.linuxbrew/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar erase'
Configuration::loadGitConfiguration
Configuration::ParseGitConfig
Configuration::ParseGitConfig
   branch.master.merge = refs/heads/master
   branch.master.remote = origin
   core.autocrlf = false
   core.bare = false
   core.filemode = true
   core.logallrefupdates = true
   core.repositoryformatversion = 0
   credential.helper = !/usr/lib/jvm/java-8-oracle/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=false -jar /home/linuxbrew/.linuxbrew/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar
   remote.origin.fetch = +refs/heads/*:refs/remotes/origin/*
   remote.origin.url = https://anantaneja.visualstudio.com/DefaultCollection/tatooine/_git/CustomMetricsSource
   user.name = Anant Aneja
Program::loadOperationArguments
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Program::EnableTraceLogging
Program::erase
   targetUri = https://anantaneja.visualstudio.com/
Program::ComponentFactory::createSecureStore
gnome-keyring library loaded, creating a password SCHEMA
Try access gnome-keyring with dummy data to make sure it's accessible...
Getting a persistent token store that must be secure
Getting a persistent credential store that must be secure
Program::createAuthentication
   detecting authority type
BaseVsoAuthentication::getAuthentication
BaseVsoAuthentication::detectAuthority
   detected visualstudio.com, checking AAD vs MSA
   server has responded
   MSA authority detected
   authority is Microsoft Live
BaseVsoAuthentication::deleteCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
SecretStore::readCredentials
SecretCache::readCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
BaseSecureStore::readCredentials
Getting Credential for git:https://anantaneja.visualstudio.com
SecretStore::deleteCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
BaseSecureStore::delete
Getting PersonalAccessToken for git:https://anantaneja.visualstudio.com
Could not retrieve secret from storage.
Return code: 9 description: No matching results
Getting Credential for git:https://anantaneja.visualstudio.com
Deleting Credential for git:https://anantaneja.visualstudio.com
SecretCache::deleteCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://anantaneja.visualstudio.com
fatal: Authentication failed for 'https://anantaneja.visualstudio.com/DefaultCollection/tatooine/_git/CustomMetricsSource/'

I also see that every time I run this command a new Personal Access Token is created on my profile
I was able to pull from the above repo before : I was on Ubuntu 18.04, Git version 2.17.1

@aaneja aaneja changed the title Fatal authenticate while using Git 2.19.1 fatal: Authentication failed while using Git 2.19.1 Oct 31, 2018
@bihe
Copy link

bihe commented Nov 2, 2018

Same for me - worked with openjdk10 on ubuntu 18.04 but stopped working with 18.10 openjdk11 and git 2.19.1

Seems not to be related with the java version. Tried with openjdk8, oraclejdk8 and openjdk11. Same result for all combinations.

Ubuntu 18.10 / Linux linux-ws 4.18.0-10-generic #11-Ubuntu SMP x86_64
git: 2.19.1
java: openjdk version "11.0.1" 2018-10-16

Debug-Info:
(I've replaced, tennant, project, guids, ...)

------------------------------------
OAuth 2.0 Device Flow authentication
------------------------------------
To complete the authentication process, please open a web browser and visit the following URI:
https://microsoft.com/devicelogin
When prompted, enter the following code:
<Device-Auth-Code>
Once authenticated and authorized, execution will continue.
   token acquisition succeeded.
   token successfully acquired.
BaseVsoAuthentication::storeRefreshToken
SecretCache::writeToken
SecretCache::_getTargetName
Secret::uriToName
   target name = ada:https://<my-tennant>.visualstudio.com
BaseVsoAuthentication::generatePersonalAccessToken
VsoAzureAuthority::generatePersonalAccessToken
   using token to acquire personal access token
VsoAzureAuthority::populateTokenTargetId
VsoAzureAuthority::createConnectionDataRequest
   validating token
   target identity is <identity-guid>
   parsed identity service url: https://app.vssps.visualstudio.com/A<identity-guid>/
   creating access token scoped to 'vso.code_write' for '<identity-guid>'
   personal access token acquisition succeeded.
SecretStore::writeCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
BaseSecureStore::writeCredential
Adding a Credential for git:https://<my-tennant>.visualstudio.com
SecretCache::writeCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
BaseVsoAuthentication::getCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
SecretStore::readCredentials
SecretCache::readCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
   successfully retrieved stored credentials, updating credential cache
BaseVsoAuthentication::validateCredentials
VsoAzureAuthority::validateCredentials
   server returned: 200
   credentials found
Configuration::loadGitConfiguration
Configuration::ParseGitConfig
Configuration::ParseGitConfig
   alias.up = pull --rebase --autostash
   branch.master.merge = refs/heads/master
   branch.master.remote = origin
   core.bare = false
   core.filemode = true
   core.logallrefupdates = true
   core.repositoryformatversion = 0
   credential.canFallBackToInsecureStore = true
   credential.helper = !java -Ddebug=true -Djava.net.useSystemProxies=true -jar /home/henrik/bin/git-credential-manager.jar
   remote.origin.fetch = +refs/heads/*:refs/remotes/origin/*
   remote.origin.url = https://<my-tennant>.visualstudio.com/DefaultCollection/<Project>/_git/<Git-Repo>
   user.email = <Email>
   user.name = Henrik Binggl
Program::loadOperationArguments
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
   canFallBackToInsecureStore = true
Program::EnableTraceLogging
Program::erase
   targetUri = https://<my-tennant>.visualstudio.com/
Program::ComponentFactory::createSecureStore
gnome-keyring library loaded, creating a password SCHEMA
Try access gnome-keyring with dummy data to make sure it's accessible...
Getting a persistent token store that could be secure
Getting a persistent credential store that could be secure
Program::createAuthentication
   detecting authority type
BaseVsoAuthentication::getAuthentication
BaseVsoAuthentication::detectAuthority
   detected visualstudio.com, checking AAD vs MSA
   server has responded
   AAD authority for tenant '<AAD-guid>' detected
   authority is Azure Directory
BaseVsoAuthentication::deleteCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
SecretStore::readCredentials
SecretCache::readCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
BaseSecureStore::readCredentials
Getting Credential for git:https://<my-tennant>.visualstudio.com
SecretStore::deleteCredentials
SecretStore::getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
BaseSecureStore::delete
Getting PersonalAccessToken for git:https://<my-tennant>.visualstudio.com
Could not retrieve secret from storage.
Return code: 9 description: No matching results
Getting Credential for git:https://<my-tennant>.visualstudio.com
Deleting Credential for git:https://<my-tennant>.visualstudio.com
SecretCache::deleteCredentials
SecretCache::_getTargetName
Secret::uriToName
   target name = git:https://<my-tennant>.visualstudio.com
fatal: Authentication failed for 'https://<my-tennant>.visualstudio.com/DefaultCollection/<Project>/_git/<Git-Repo>/'
error: Could not fetch origin

@JoseFMP
Copy link

JoseFMP commented Nov 14, 2018

Same here

1 similar comment
@srinivaskarteek
Copy link

Same here

@srinivaskarteek
Copy link

Any solution??

@ghost
Copy link

ghost commented Nov 16, 2018

Try to use SSH, or install GitKraken on your Ubuntu 18.10. I found that problem after updating ubuntu 18.04 to 18.10.

@JoseFMP
Copy link

JoseFMP commented Nov 19, 2018

For me same problem with SSH and using GitKraken, and other clients such as the one of Rider.

@ganesh-karewad
Copy link

same here, any solution?

@spmp
Copy link

spmp commented Nov 21, 2018

I upgraded from 14.04 today to Ubuntu 18.10 and have come across this issue. I tried building the latest git from ... git.. and earlier versions down to 2.1.4. None succeeded. I have ended up using SSH.
This suggests to me it may be a dependency or other library that is at fault. libssl versions 1.0 and 1.1 were tried with no effect.

@joejustesen
Copy link

I cannot get git 2.19.1 on Ubuntu 18.10 to work. I end up with the same error of "Authentication failed". This was working a few days ago before my fresh 18.10 install. I was running 18.04 until I did a fresh install yesterday.

Anybody find a work around?

@JoseFMP
Copy link

JoseFMP commented Dec 1, 2018

Same here. I tried with 2.19.1, 2.19.2, and some others.
Not working.

https://stackoverflow.com/questions/53106546/cannot-clone-git-from-azure-devops-using-pat

@congyiwu
Copy link

This is a known regression in curl 7.61.0, which ships with Ubuntu 18.10. The regression was fixed in curl 7.61.1, but Ubuntu 18.10 doesn't have this fix yet. See (and upvote) https://bugs.launchpad.net/ubuntu/+source/curl/+bug/1805203

@JoseFMP
Copy link

JoseFMP commented Jan 28, 2019

@congyiwu thank you so much. I will try that out.

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

8 participants