For some reason all of a sudden a few weeks ago, the credential manager started randomly "losing" my GitHub credentials. It could lose them a couple of times in an hour or it could last for days before they get lost again. And the strangest thing, is this only happens for some repositories (specifically my work repositories -- never ones that are on my personal "account" -- must be just trying to tell me something 😉). To be clear, I only have one GitHub account, it just also belongs to an organization -- and I only lose access to repo's that belong to the organization.
This can also happen between commands -- I might call git fetch and have it work to then call git push a few seconds later and have it fail with
remote: Repository not found.
fatal: repository 'https://github.com/{org}/{repo}.git/' not found
I've turned on logging, but I really don't see much -- and the strange thing is it doesn't even appear to fail. I ran:
> git fetch
remote: Repository not found.
fatal: repository 'https://github.com/{org}/{repo}.git/' not found
And here is the log:
14:02:44.807523 git.c:369 trace: built-in: git 'fetch'
14:02:44.815544 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/{org}/{repo}.git'
14:02:45.039640 run-command.c:369 trace: run_command: 'git credential-manager get'
14:02:45.058189 git.c:594 trace: exec: 'git-credential-manager' 'get'
14:02:45.058691 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
14:02:45.084259 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
14:02:45.126371 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
14:02:45.128877 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
14:02:45.129379 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
14:02:45.129880 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
14:02:45.143917 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
14:02:45.149432 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
14:02:45.149432 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
14:02:45.154445 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
14:02:45.154947 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
14:02:45.556015 ...\Authority.cs:213 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
14:02:45.561028 ...\Program.cs:483 trace: [QueryCredentials] credentials for 'https://github.com/' found.
14:02:45.561529 ...\Program.cs:358 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
14:02:45.642744 git.c:369 trace: built-in: git 'status' '--short' '--branch'
14:02:46.792803 git.c:369 trace: built-in: git 'status' '-z' '-u'
14:02:46.833411 git.c:369 trace: built-in: git 'symbolic-ref' '--short' 'HEAD'
14:02:46.858478 git.c:369 trace: built-in: git 'rev-parse' 'feature-publish-flow'
14:02:46.884547 git.c:369 trace: built-in: git 'rev-parse' '--symbolic-full-name' '--abbrev-ref' 'feature-publish-flow@{u}'
14:02:46.911619 git.c:369 trace: built-in: git 'rev-list' '--left-right' 'feature-publish-flow...origin/feature-publish-flow'
14:02:46.942702 git.c:369 trace: built-in: git 'for-each-ref' '--format' '%(refname) %(objectname)'
14:02:46.944206 git.c:369 trace: built-in: git 'remote' '--verbose'
14:02:53.780889 git.c:369 trace: built-in: git 'fetch'
14:02:53.788409 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/{org}/{repo}.git'
14:02:53.996463 run-command.c:369 trace: run_command: 'git credential-manager get'
14:02:54.018020 git.c:594 trace: exec: 'git-credential-manager' 'get'
14:02:54.018020 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
14:02:54.049604 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
14:02:54.095225 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
14:02:54.097732 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
14:02:54.098233 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
14:02:54.098734 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
14:02:54.111769 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
14:02:54.117785 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
14:02:54.117785 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
14:02:54.122799 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
14:02:54.122799 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
14:02:54.463206 ...\Authority.cs:213 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
14:02:54.468720 ...\Program.cs:483 trace: [QueryCredentials] credentials for 'https://github.com/' found.
14:02:54.469221 ...\Program.cs:358 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
Oddly enough, this all started after I switched around e-mail accounts on GitHub (I didn't remove or add anything, just changed which one was primary/public -- none of which should have had any impact on the organization.
Also a co-worker of mine has been experiencing the same issue on his Windows VM (and neither of us ever has trouble on our macOS or Linux machines).
My trouble started on 1.9.1, but I've since upgraded to 1.10 and still am experiencing the same issues.
I have been able to temporarily "fix" the issue using the clear command (for whatever reason the delete command never returns) -- once cleared the next command will prompt for creds and all will be fine for some random time period after that (anywhere from minutes to days -- more often hours to days).
Thanks for the detailed report.
have been able to temporarily "fix" the issue using the clear command
Good news.
for whatever reason the delete command never returns
The delete, like the erase command are designed not to return. They expect you to be Git or a git-like program which will communicate with them via a predefined stdin/out protocol.
Adding @shiftkey @Haacked as they've been maintaining the GitHub portion of the GCM since v1.4.0 (has it really been that long now?).
@eamodio do your Git logs contain any "git-credential-manager (v1.10.0) 'erase'" entries?
@whoisj I'm not at home today (with access to my Windows machine), but will check the logs tonight. I also should mention that over the weekend, my creds got "lost" again (actually a handful of times), but one time a clear did nothing to fix things -- I had to manually go and delete the github creds from Windows. And then the prompt came up and all was well again until the next time.
@eamodio it sounds like GitHubAuthority isn't deleting credentials - however, there is a possibility that Git is never requesting that they be deleted - which would be a problem.
@whoisj I've not seen any recent reports of this on our side. Some random musings follow.
@eamodio
To be clear, I only have one GitHub account, it just also belongs to an organization -- and I only lose access to repo's that belong to the organization
This is interesting - so repositories for your user account (including private repos) are fine, but organization repositories aren't? The GitHub signin flow creates a personal access token for the account, which _should_ have no trouble with org repos.
I've turned on logging, but I really don't see much -- and the strange thing is it doesn't even appear to fail.
Yeah, it can be really hard to catch the first invalid credential occurrence. As soon as Git considers the credentials invalid, it will turn around and try to remove them from the credential store.
With GIT_TRACE and GIT_CURL_VERBOSE enabled, do you see Git fetching credentials from the store and then failing? The fact that clear gets you back to a good state makes me curious whether something is up with how we're storing the credentials.
Oddly enough, this all started after I switched around e-mail accounts on GitHub (I didn't remove or add anything, just changed which one was primary/public -- none of which should have had any impact on the organization.
The credentials should be associated with your account name, not the email address. So I don't _think_ this is the root cause - especially since you have a colleague dealing with what seems like the same issue.
@shiftkey
so repositories for your user account (including private repos) are fine, but organization repositories aren't?
I don't have any personal private repos, but all my personal public ones work -- I haven't checked when this happens, if my public org ones still work or not (I rarely work in those)
With GIT_TRACE and GIT_CURL_VERBOSE enabled, do you see Git fetching credentials from the store and then failing?
I didn't have GIT_CURL_VERBOSE enabled (I've enabled it now), but from the logs I do have, I never see it fail -- even when it doesn't work, from the logs it looks like all is fine (at least to me). The log I posted above was a failed command, but it looks like it read everything fine.
The credentials should be associated with your account name, not the email address. So I don't think this is the root cause - especially since you have a colleague dealing with what seems like the same issue.
Yeah - I just mentioned it, because before that point everything had been working for many months with 0 issues, and within a day or two from me touching that e-mail stuff on the GH portal I started experiencing the issue. And my colleague had mentioned this same issue to me months ago on his Windows VM (which still happens for him), but he doesn't remember the trigger point.
I've also tried "resetting" everything -- deleting the Windows creds for GH, deleting the access token from GH, but nothing seems to make a lasting difference. Though I will say I've noticed that sometimes extra tokens appear on GH when things go awry but not always. And the times I've needed to actually kill the Windows creds for GH, usually happens when there is more than 1 access token on GH (that look like git: https://github.com/ on <MACHINE_NAME>).
Let me know if there is any other ways I can help on this -- I desperately want this resolved ;) Very happy to run any debug stuff, get more logs, screenshare, whatever.
@whoisj
I checked my logs again and I did find an occurrence from the other day -- I'm not exactly sure what happened, but this could have been one of the instances where I was in vscode, committed my changes, and attempted a git push via the built-in terminal and it failed
22:43:36.826228 git.c:369 trace: built-in: git 'push'
22:43:36.827230 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/{company}/{repo}.git'
22:43:37.065370 run-command.c:369 trace: run_command: 'git credential-manager get'
22:43:37.082918 git.c:594 trace: exec: 'git-credential-manager' 'get'
22:43:37.083920 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
22:43:37.110993 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
22:43:37.156113 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:43:37.159120 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:43:37.159120 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:43:37.160123 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:43:37.173660 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
22:43:37.179175 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
22:43:37.179175 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:43:37.207251 ...icationPrompts.cs:46 trace: [CredentialModalPrompt] prompting user for credentials for 'https://github.com/'.
22:44:12.014255 ...\Authority.cs:127 trace: [AcquireToken] server responded with Unauthorized.
22:44:12.015257 ...\Authority.cs:165 trace: [AcquireToken] two-factor app authentication code required for 'https://github.com/'.
22:44:12.017263 ...icationPrompts.cs:60 trace: [AuthenticationCodeModalPrompt] prompting user for authentication code for 'https://github.com/'.
22:44:28.172424 ...\Authority.cs:127 trace: [AcquireToken] server responded with Created.
22:44:28.194483 ...\Authority.cs:151 trace: [AcquireToken] authentication success: new personal acces token for 'https://github.com/' created.
22:44:28.195487 ...uthentication.cs:208 trace: [InteractiveLogon] token acquisition for 'https://github.com/' succeeded.
22:44:28.228588 ...seSecureStore.cs:210 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
22:44:28.508856 ...\Authority.cs:213 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
22:44:28.509357 ...\Program.cs:483 trace: [QueryCredentials] credentials for 'https://github.com/' found.
22:44:28.510360 ...\Program.cs:358 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
5 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:43:46.139671 ...icationPrompts.cs:46 trace: [CredentialModalPrompt] prompting user for credentials for 'https://github.com/'.
22:44:07.806942 ...uthentication.cs:228 trace: [InteractiveLogon] interactive logon for 'https://github.com/' failed.
22:44:07.806942 ...\Program.cs:488 trace: [QueryCredentials] credentials for 'https://github.com/' not found.
22:44:07.807945 ...\Program.cs:358 trace: [LogEvent] Failed to retrieve GitHub credentials for 'https://github.com/'.
22:44:07.809951 ...\Program.cs:92 trace: [_exitCallback] Logon failed, use ctrl+c to cancel basic credential prompt.
2:43:46.329181 run-command.c:1155 run_processes_parallel: preparing to run up to 1 tasks
22:43:46.329181 run-command.c:1187 run_processes_parallel: done
22:43:46.329181 run-command.c:369 trace: run_command: 'gc' '--auto'
22:43:46.335197 git.c:369 trace: built-in: git 'gc' '--auto'
22:43:46.363273 git.c:369 trace: built-in: git 'status' '-z' '-u'
22:43:46.400874 git.c:369 trace: built-in: git 'symbolic-ref' '--short' 'HEAD'
22:43:46.426443 git.c:369 trace: built-in: git 'rev-parse' 'master'
22:43:46.451510 git.c:369 trace: built-in: git 'rev-parse' '--symbolic-full-name' '--abbrev-ref' 'master@{u}'
22:43:46.481590 git.c:369 trace: built-in: git 'rev-list' '--left-right' 'master...origin/master'
22:43:46.514681 git.c:369 trace: built-in: git 'for-each-ref' '--format' '%(refname) %(objectname)'
22:43:46.515684 git.c:369 trace: built-in: git 'remote' '--verbose'
22:44:07.852565 run-command.c:369 trace: run_command: 'git credential-manager get'
22:44:07.867105 git.c:594 trace: exec: 'git-credential-manager' 'get'
22:44:07.867105 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
22:44:07.894178 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
22:44:07.944311 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:07.947822 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:07.948825 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:07.949326 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:07.964367 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
22:44:07.970383 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
22:44:07.970383 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:44:07.990436 ...icationPrompts.cs:46 trace: [CredentialModalPrompt] prompting user for credentials for 'https://github.com/'.
22:44:09.612801 ...uthentication.cs:228 trace: [InteractiveLogon] interactive logon for 'https://github.com/' failed.
22:44:09.612801 ...\Program.cs:488 trace: [QueryCredentials] credentials for 'https://github.com/' not found.
22:44:09.612801 ...\Program.cs:358 trace: [LogEvent] Failed to retrieve GitHub credentials for 'https://github.com/'.
22:44:09.613803 ...\Program.cs:92 trace: [_exitCallback] Logon failed, use ctrl+c to cancel basic credential prompt.
22:44:09.646892 run-command.c:369 trace: run_command: 'c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\git\out\askpass.sh' 'Username for '\''https://github.com'\'': '
22:44:09.822366 run-command.c:369 trace: run_command: 'c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\git\out\askpass.sh' 'Password for '\''https://github.com'\'': '
22:44:10.049978 run-command.c:369 trace: run_command: 'git credential-manager erase'
22:44:10.065019 git.c:594 trace: exec: 'git-credential-manager' 'erase'
22:44:10.065520 run-command.c:369 trace: run_command: 'git-credential-manager' 'erase'
22:44:10.092093 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'erase'
22:44:10.144231 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:10.148242 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:10.148242 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:10.149245 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:10.162281 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
22:44:10.168297 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
22:44:10.168799 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:44:10.168799 ...\Program.cs:859 trace: [DeleteCredentials] deleting GitHub credentials for 'https://github.com/'.
22:44:10.179329 run-command.c:369 trace: run_command: 'git credential-manager erase'
22:44:10.194369 git.c:594 trace: exec: 'git-credential-manager' 'erase'
22:44:10.194369 run-command.c:369 trace: run_command: 'git-credential-manager' 'erase'
22:44:10.219435 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'erase'
22:44:10.265559 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:10.268568 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:10.269570 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:10.269570 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:10.282606 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
22:44:10.289625 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
22:44:10.289625 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:44:10.289625 ...\Program.cs:859 trace: [DeleteCredentials] deleting GitHub credentials for 'https://github.com/'.
22:44:28.777085 run-command.c:369 trace: run_command: 'git credential-manager store'
22:44:28.793128 git.c:594 trace: exec: 'git-credential-manager' 'store'
22:44:28.793128 run-command.c:369 trace: run_command: 'git-credential-manager' 'store'
22:44:28.818698 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'store'
22:44:28.865324 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:28.868332 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:28.869334 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:28.869334 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:28.880364 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
22:44:28.887382 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
22:44:28.887382 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:44:28.887382 ...\Program.cs:406 trace: [Store] storing GitHub credentials for 'https://github.com/'.
22:44:28.896406 ...seSecureStore.cs:210 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
22:44:28.907437 run-command.c:369 trace: run_command: 'git credential-manager store'
22:44:28.923481 git.c:594 trace: exec: 'git-credential-manager' 'store'
22:44:28.923481 run-command.c:369 trace: run_command: 'git-credential-manager' 'store'
22:44:28.950553 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'store'
22:44:29.002692 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:29.006204 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:29.006705 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
22:44:29.007206 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
22:44:29.020742 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
22:44:29.025757 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
22:44:29.025757 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
22:44:29.026759 ...\Program.cs:406 trace: [Store] storing GitHub credentials for 'https://github.com/'.
22:44:29.036786 ...seSecureStore.cs:210 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
I as an aside -- I know that vscode run periodic git commands to keep up to date, and my GitLens extension for vscode can also make lots of calls into git -- so there can be lots of git calls happening regularly
@eamodio the ordering of those Git credential events is... strange.
It looks like there are pair of Git processes running, both for netops with github.com. Both fail the initial 'get' request. Git follows up both with an 'erase' request (this is normal following a failure).
Not the really weird part... both receive a 'store' request. Storing what?!
So here's a quick guess as to what is happening:
So what we're seeing is:
The net-net here is that the GCM is going in circles deleting and storing the same values, and you're being blocked half of the time.
If I am right, and I'm only guessing here, then GitHub needs a method to store multiple credentials for a single user. Probably using the
First thing you (@eamodio can do is run git config --list --show-origin and look for duplicate credential.helper = manager entries.
@whoisj
from the output of git config --list --show-origin, I see:
file:"C:\\Program Files\\Git\\mingw64/etc/gitconfig" credential.helper=manager
file:C:/Users/Eric/.gitconfig credential.helper=manager
I'm not sure where the first one came from -- just part of the git install?
I guess I'm also not too surprised that there are multiple git procs going on -- as I often run terminal commands, vscode runs git commands, and GitLens runs git commands
yeah, you likely omit the global configuration value. Yes, the machine or portable config value is coming from the Git for Windows installer.
I've seen a number of GCM issues started recently related to interactions with VSCode. This is getting more and more concerned that there's something VSCode is doing to interfere with GCM and causing user heartburn. 😒
FWIW, I checked with 2 of my colleagues (1 with the same issue and 1 without) both have that same "duplicate" credential.helper line.
From your assessment above, the real question (at least to me) is why would git be failing to authenticate. Network hiccup? GitHub issue? An intervention (telling me to sleep more) :wink: ?
Because I would hope that running many Git procs at the same time wouldn't cause issues. And I run the same code/repo/tools (vscode, gitlens, etc) on macOS and my colleague with the same issue runs it all on Linux without any issue at all.
@eamodio do you have more than one GitHub account? Perhaps a personal one and a work one?
The current credential manager design only supports one credential set per host.
@whoisj nope, only one.
OK it just failed again and I did a bit more digging. The failures ONLY happen on private repos from the organization (I don't have any personal private repos so I can't test that -- but my guess it they would fail too). Public repos from the org still work fine when in this non-working state.
Also here are some logs from the last failure.
From the terminal output:
> g pull
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
* Trying 192.30.253.113...
* TCP_NODELAY set
* Connected to github.com (192.30.253.113) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=Delaware; serialNumber=5157550; street=88 Colin P Kelly, Jr
Street; postalCode=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: Mar 10 00:00:00 2016 GMT
* expire date: May 17 12:00:00 2018 GMT
* subjectAltName: host "github.com" matched cert's "github.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
* SSL certificate verify ok.
> GET /{company}/{repo}.git/info/refs?service=git-upload-pack HTTP/1.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< Content-Length: 21
< WWW-Authenticate: Basic realm="GitHub"
< X-GitHub-Request-Id: FE99:4597:E15435:16299E7:591B1314
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the _netrc file; using defaults
* Found bundle for host github.com: 0x4baef20 [can pipeline]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.253.113) port 443 (#0)
* Server auth using Basic with user 'eamodio'
> GET /{company}/{repo}.git/info/refs?service=git-upload-pack HTTP/1.1
Host: github.com
Authorization: Basic {code-here}
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 404 Not Found
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< X-GitHub-Request-Id: FE99:4597:E154AF:16299F0:591B1314
< X-Frame-Options: DENY
< Connection: close
<
* Closing connection 0
remote: Repository not found.
fatal: repository 'https://github.com/{company}/{repo}.git/' not found
From the git log fine:
10:52:46.874081 git.c:369 trace: built-in: git 'fetch'
10:52:46.882604 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/{company}/{repo}.git'
10:52:47.122743 run-command.c:369 trace: run_command: 'git credential-manager get'
10:52:47.143297 git.c:594 trace: exec: 'git-credential-manager' 'get'
10:52:47.143798 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
10:52:47.170871 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
10:52:47.213484 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
10:52:47.215990 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
10:52:47.216993 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
10:52:47.217494 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
10:52:47.231031 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
10:52:47.237047 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
10:52:47.237047 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
10:52:47.242060 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
10:52:47.242060 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
10:52:47.609537 ...\Authority.cs:213 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
10:52:47.612545 ...\Program.cs:483 trace: [QueryCredentials] credentials for 'https://github.com/' found.
10:52:47.612545 ...\Program.cs:358 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
10:55:46.881794 git.c:369 trace: built-in: git 'fetch'
10:55:46.889815 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/{company}/{repo}.git'
10:55:47.105388 run-command.c:369 trace: run_command: 'git credential-manager get'
10:55:47.121933 git.c:594 trace: exec: 'git-credential-manager' 'get'
10:55:47.121933 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
10:55:47.147500 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
10:55:47.191116 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
10:55:47.193623 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
10:55:47.194125 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
10:55:47.194626 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
10:55:47.208663 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
10:55:47.214178 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
10:55:47.214178 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
10:55:47.219692 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
10:55:47.219692 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
10:55:47.738071 ...\Authority.cs:213 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
10:55:47.739575 ...\Program.cs:483 trace: [QueryCredentials] credentials for 'https://github.com/' found.
10:55:47.740080 ...\Program.cs:358 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
10:56:11.005453 git.c:369 trace: built-in: git 'status' '--short' '--branch'
10:56:12.161527 git.c:369 trace: built-in: git 'status' '-z' '-u'
10:56:12.214167 git.c:369 trace: built-in: git 'symbolic-ref' '--short' 'HEAD'
10:56:12.245751 git.c:369 trace: built-in: git 'rev-parse' 'develop'
10:56:12.277836 git.c:369 trace: built-in: git 'rev-parse' '--symbolic-full-name' '--abbrev-ref' 'develop@{u}'
10:56:12.309922 git.c:369 trace: built-in: git 'rev-list' '--left-right' 'develop...origin/develop'
10:56:12.343010 git.c:369 trace: built-in: git 'for-each-ref' '--format' '%(refname) %(objectname)'
10:56:12.343511 git.c:369 trace: built-in: git 'remote' '--verbose'
10:56:14.712814 git.c:369 trace: built-in: git 'show' 'HEAD:src/au/wwwroot/config.js'
10:56:14.868227 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '--no-merges' '--' 'config.js'
10:56:14.868227 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '--no-merges' '--' 'config.js'
10:56:14.940920 git.c:369 trace: built-in: git 'blame' '--root' '--incremental' '--' 'src/au/wwwroot/config.js'
10:56:14.944931 git.c:369 trace: built-in: git 'remote' '-v'
10:56:14.948440 git.c:369 trace: built-in: git 'ls-files' 'c:\Users\Eric\code\ion\faraday\src\au\wwwroot\config.js'
10:56:15.090317 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '-m' '9060b3ca106137631723aac0fbf3336910dd62a3' '--' 'src/au/wwwroot/config.js'
10:56:15.090317 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '-m' '9060b3ca106137631723aac0fbf3336910dd62a3' '--' 'src/au/wwwroot/config.js'
10:56:17.543847 git.c:369 trace: built-in: git 'checkout' '-q' '--' 'c:\Users\Eric\code\ion\faraday\src\au\wwwroot\config.js'
10:56:17.579943 git.c:369 trace: built-in: git 'status' '-z' '-u'
10:56:17.624562 git.c:369 trace: built-in: git 'symbolic-ref' '--short' 'HEAD'
10:56:17.650130 git.c:369 trace: built-in: git 'rev-parse' 'develop'
10:56:17.681714 git.c:369 trace: built-in: git 'rev-parse' '--symbolic-full-name' '--abbrev-ref' 'develop@{u}'
10:56:17.686226 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '--no-merges' '--' 'config.js'
10:56:17.715805 git.c:369 trace: built-in: git 'rev-list' '--left-right' 'develop...origin/develop'
10:56:17.731346 git.c:369 trace: built-in: git 'blame' '--root' '--incremental' '--' 'src/au/wwwroot/config.js'
10:56:17.752402 git.c:369 trace: built-in: git 'remote' '--verbose'
10:56:17.752903 git.c:369 trace: built-in: git 'for-each-ref' '--format' '%(refname) %(objectname)'
10:56:17.879239 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '-m' '9060b3ca106137631723aac0fbf3336910dd62a3' '--' 'src/au/wwwroot/config.js'
10:56:17.880743 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '-m' '9060b3ca106137631723aac0fbf3336910dd62a3' '--' 'src/au/wwwroot/config.js'
10:56:19.707107 git.c:369 trace: built-in: git 'pull'
10:56:19.735181 run-command.c:369 trace: run_command: 'merge-base' '--fork-point' 'refs/remotes/origin/develop' 'develop'
10:56:19.741699 git.c:369 trace: built-in: git 'merge-base' '--fork-point' 'refs/remotes/origin/develop' 'develop'
10:56:19.758744 run-command.c:369 trace: run_command: 'fetch' '--update-head-ok'
10:56:19.764760 git.c:369 trace: built-in: git 'fetch' '--update-head-ok'
10:56:19.772781 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/{company}/{repo}.git'
10:56:19.876557 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '--no-merges' '--' 'config.js'
10:56:19.916163 git.c:369 trace: built-in: git 'blame' '--root' '--incremental' '--' 'src/au/wwwroot/config.js'
10:56:20.019938 run-command.c:369 trace: run_command: 'git credential-manager get'
10:56:20.038989 git.c:594 trace: exec: 'git-credential-manager' 'get'
10:56:20.039490 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
10:56:20.049517 git.c:369 trace: built-in: git 'log' '--name-status' '--full-history' '-M' '--date=iso8601' '--format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ?' '--follow' '-n1' '-m' '9060b3ca106137631723aac0fbf3336910dd62a3' '--' 'src/au/wwwroot/config.js'
10:56:20.070072 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
10:56:20.117698 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
10:56:20.120205 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
10:56:20.121208 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
10:56:20.121709 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 66 entries.
10:56:20.140760 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
10:56:20.146776 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
10:56:20.146776 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
10:56:20.152291 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
10:56:20.152291 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
10:56:20.483673 ...\Authority.cs:213 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
10:56:20.490691 ...\Program.cs:483 trace: [QueryCredentials] credentials for 'https://github.com/' found.
10:56:20.492197 ...\Program.cs:358 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
10:56:20.643598 git.c:369 trace: built-in: git 'status' '--short' '--branch'
10:56:21.847799 git.c:369 trace: built-in: git 'status' '-z' '-u'
10:56:21.899437 git.c:369 trace: built-in: git 'symbolic-ref' '--short' 'HEAD'
10:56:21.930520 git.c:369 trace: built-in: git 'rev-parse' 'develop'
10:56:21.962103 git.c:369 trace: built-in: git 'rev-parse' '--symbolic-full-name' '--abbrev-ref' 'develop@{u}'
10:56:21.995693 git.c:369 trace: built-in: git 'rev-list' '--left-right' 'develop...origin/develop'
10:56:22.037303 git.c:369 trace: built-in: git 'remote' '--verbose'
10:56:22.037303 git.c:369 trace: built-in: git 'for-each-ref' '--format' '%(refname) %(objectname)'
10:56:29.713716 git.c:369 trace: built-in: git 'version'
10:56:29.838548 git.c:369 trace: built-in: git 'help' '-a'
10:56:33.056606 git.c:369 trace: built-in: git 'version'
10:56:33.071145 git.c:369 trace: built-in: git 'version'
Also here is the terminal output from a command that worked to a public repo (while my creds were borked)
> g clone https://github.com/ioninteractive/javascript-style-guide.git
Cloning into 'javascript-style-guide'...
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
* Trying 192.30.253.113...
* TCP_NODELAY set
* Connected to github.com (192.30.253.113) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictio
nST=Delaware; serialNumber=5157550; street=88 Colin P Kelly, Jr Street; postalCo
de=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: Mar 10 00:00:00 2016 GMT
* expire date: May 17 12:00:00 2018 GMT
* subjectAltName: host "github.com" matched cert's "github.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended
Validation Server CA
* SSL certificate verify ok.
> GET /ioninteractive/javascript-style-guide.git/info/refs?service=git-upload-pa
ck HTTP/1.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: GitHub Babel 2.0
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< X-GitHub-Request-Id: FF94:4597:E391D8:166212D:591B1618
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the _netrc file; using defaults
* Found bundle for host github.com: 0x523b210 [can pipeline]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.253.113) port 443 (#0)
> POST /ioninteractive/javascript-style-guide.git/git-upload-pack HTTP/1.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 851
* upload completely sent off: 851 out of 851 bytes
< HTTP/1.1 200 OK
< Server: GitHub Babel 2.0
< Content-Type: application/x-git-upload-pack-result
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< X-GitHub-Request-Id: FF94:4597:E391E0:1662136:591B1618
< X-Frame-Options: DENY
<
remote: Counting objects: 549, done.
* remote: Total 549 (delta 0), reused 0 (delta 0), pack-reused 549Connection #0
to host github.com left intact
Receiving objects: 100% (549/549), 177.01 KiB | 0 bytes/s, done.
Resolving deltas: 100% (155/155), done.
And here is the same thing to a private repo (while my creds were borked)
> git clone https://github.com/ioninteractive/{private-repo}.git
Cloning into '{private-repo}'...
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
* Trying 192.30.253.112...
* TCP_NODELAY set
* Connected to github.com (192.30.253.112) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictio
nST=Delaware; serialNumber=5157550; street=88 Colin P Kelly, Jr Street; postalCo
de=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: Mar 10 00:00:00 2016 GMT
* expire date: May 17 12:00:00 2018 GMT
* subjectAltName: host "github.com" matched cert's "github.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended
Validation Server CA
* SSL certificate verify ok.
> GET /ioninteractive/{private-repo}.git/info/refs?service=git-upload-pack HTTP/1
.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< Content-Length: 21
< WWW-Authenticate: Basic realm="GitHub"
< X-GitHub-Request-Id: FF95:4594:BACEC0:126A3DB:591B162C
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the _netrc file; using defaults
* Found bundle for host github.com: 0x534b1a0 [can pipeline]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.253.112) port 443 (#0)
* Server auth using Basic with user 'eamodio'
> GET /ioninteractive/{private-repo}.git/info/refs?service=git-upload-pack HTTP/1
.1
Host: github.com
Authorization: Basic {auth goes here}
jZGMz
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 404 Not Found
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< X-GitHub-Request-Id: FF95:4594:BACF1D:126A3DF:591B162C
< X-Frame-Options: DENY
< Connection: close
<
* Closing connection 0
remote: Repository not found.
fatal: repository 'https://github.com/ioninteractive/{private-repo}.git/' not found
Yep, so this is interesting.
...
* Server auth using Basic with user 'eamodio'
...
Authorization: Basic {code-here}
...
I know this is being obscured for privacy reason, but can you decode this Base64 string here and see if it makes sense? It should be of the format username:password or something (it should look like a token, which is fine).
Yeah, while I don't know if the token is meaningful/valid, but it looks like eamodio:{long token}
So I just reset things again -- to get it back working and I noticed that the auth is different:
> g pull
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
* Trying 192.30.253.112...
* TCP_NODELAY set
* Connected to github.com (192.30.253.112) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictio
nST=Delaware; serialNumber=5157550; street=88 Colin P Kelly, Jr Street; postalCo
de=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: Mar 10 00:00:00 2016 GMT
* expire date: May 17 12:00:00 2018 GMT
* subjectAltName: host "github.com" matched cert's "github.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended
Validation Server CA
* SSL certificate verify ok.
> GET /ioninteractive/{repo}.git/info/refs?service=git-upload-pack HTTP/1.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< Content-Length: 21
< WWW-Authenticate: Basic realm="GitHub"
< X-GitHub-Request-Id: CF63:32C2:427F61:695515:591BE1C3
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the _netrc file; using defaults
* Found bundle for host github.com: 0x564ba50 [can pipeline]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.253.112) port 443 (#0)
* Server auth using Basic with user 'Personal Access Token'
> GET /ioninteractive/{repo}.git/info/refs?service=git-upload-pack HTTP/1.1
Host: github.com
Authorization: Basic {code}
wODkzMzY2NmJlZTNiMDYxMjU=
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: GitHub Babel 2.0
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< X-GitHub-Request-Id: CF63:32C2:427FB1:695519:591BE1C3
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
And when I decode the auth, it is Personal Access Token:{long token}
And when I decode the auth, it is
Personal Access Token:{long token}
Yep, that's how it is on my machine. But I'm pretty sure we handle eamodio:{long token} fine, rather than as a username:password combination. Hrm.
So..... it hasn't been that long yet (but it was getting so bad that I would literally have to re-login up to 10 times a day) -- but since I installed the GitHub Desktop beta the other night, I haven't encountered a single case of my creds getting lost (and I haven't changed anything else -- still using the command line & vscode) -- the GitHub Desktop client hasn't even been opened since I played around with it that same night.
@shiftkey any idea how this could have effected things (assuming it actually has). I did see a new credential show up in the Windows Credential Manager (for api.github.com) but really didn't notice any other differences. Even the basic auth token in use seems to be the same Personal Access Token:{same-token-as-before}
So many more days have past and so far after installing the GitHub Desktop beta -- I haven't had a single case of my password being lost -- while I'm very happy about this it seems very odd that this would have changed things. Any ideas? Figuring this out could also help others experiencing similar issues.
@whoisj @shiftkey 😢
Aaaand its back. It's happened a couple of times now -- but I'm pretty sure what restarted it was when my internet went out for a short while (while I was updating my router) and vscode was open.
Here is the output from my log file for the last failure:
17:23:28.868579 git.c:369 trace: built-in: git 'fetch'
17:23:28.877102 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/ioninteractive/{repo}.git'
17:23:29.090169 run-command.c:369 trace: run_command: 'git credential-manager get'
17:23:29.104708 git.c:594 trace: exec: 'git-credential-manager' 'get'
17:23:29.104708 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
17:23:29.131779 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
17:23:29.176398 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.179406 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.179907 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.180409 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.193443 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
17:23:29.199459 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
17:23:29.199459 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
17:23:29.206478 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
17:23:29.206979 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
17:23:29.245081 ...\Program.cs:62 trace: [_dieExceptionCallback] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'api.github.com'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authority.<ValidateCredentials>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authentication.<ValidateCredentials>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<>c__DisplayClass84_4.<<QueryCredentials>b__4>d.MoveNext()
17:23:29.245081 ...\Program.cs:358 trace: [LogEvent] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'api.github.com'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authority.<ValidateCredentials>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authentication.<ValidateCredentials>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<>c__DisplayClass84_4.<<QueryCredentials>b__4>d.MoveNext()
17:23:29.247086 ...\Program.cs:80 trace: [_dieMessageCallback] fatal: HttpRequestException encountered.
An error occurred while sending the request.
17:23:29.266137 run-command.c:369 trace: run_command: 'git credential-manager get'
17:23:29.279171 git.c:594 trace: exec: 'git-credential-manager' 'get'
17:23:29.279673 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
17:23:29.303235 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
17:23:29.345849 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.348857 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.349359 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.349860 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.363396 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
17:23:29.368910 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
17:23:29.368910 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
17:23:29.374425 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
17:23:29.374425 ...uthentication.cs:163 trace: [GetCredentials] credentials for 'https://github.com/' found.
17:23:29.405006 ...\Program.cs:62 trace: [_dieExceptionCallback] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'api.github.com'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authority.<ValidateCredentials>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authentication.<ValidateCredentials>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<>c__DisplayClass84_4.<<QueryCredentials>b__4>d.MoveNext()
17:23:29.405006 ...\Program.cs:358 trace: [LogEvent] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'api.github.com'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authority.<ValidateCredentials>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Authentication.Authentication.<ValidateCredentials>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<>c__DisplayClass84_4.<<QueryCredentials>b__4>d.MoveNext()
17:23:29.406009 ...\Program.cs:80 trace: [_dieMessageCallback] fatal: HttpRequestException encountered.
An error occurred while sending the request.
17:23:29.414532 run-command.c:369 trace: run_command: 'c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\git\out\askpass.sh' 'Username for '\''https://github.com'\'': '
17:23:29.573956 run-command.c:369 trace: run_command: 'c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\git\out\askpass.sh' 'Password for '\''https://github.com'\'': '
17:23:29.743407 run-command.c:369 trace: run_command: 'git credential-manager erase'
17:23:29.756441 git.c:594 trace: exec: 'git-credential-manager' 'erase'
17:23:29.756943 run-command.c:369 trace: run_command: 'git-credential-manager' 'erase'
17:23:29.781007 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'erase'
17:23:29.823620 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.826127 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.827130 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.827130 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.839161 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
17:23:29.844676 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
17:23:29.845177 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
17:23:29.845177 ...\Program.cs:859 trace: [DeleteCredentials] deleting GitHub credentials for 'https://github.com/'.
17:23:29.847684 ...seSecureStore.cs:134 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
17:23:29.848687 ...aseSecureStore.cs:59 trace: [Delete] credentials for 'git:https://github.com' deleted from store.
17:23:29.849188 ...Authentication.cs:99 trace: [DeleteCredentials] credentials for 'https://github.com/' deleted
17:23:29.856708 run-command.c:369 trace: run_command: 'git credential-manager erase'
17:23:29.869743 git.c:594 trace: exec: 'git-credential-manager' 'erase'
17:23:29.870244 run-command.c:369 trace: run_command: 'git-credential-manager' 'erase'
17:23:29.892804 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'erase'
17:23:29.935919 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.938927 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.939429 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:23:29.939930 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:23:29.951460 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
17:23:29.957476 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
17:23:29.957476 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
17:23:29.957476 ...\Program.cs:859 trace: [DeleteCredentials] deleting GitHub credentials for 'https://github.com/'.
17:25:58.370915 git.c:369 trace: built-in: git 'fetch'
17:25:58.373923 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/eamodio/vscode-gitlens.git'
17:25:58.611555 run-command.c:369 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:25:58.617070 git.c:369 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:25:58.623588 run-command.c:369 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:25:58.629103 git.c:369 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:25:58.639129 run-command.c:1155 run_processes_parallel: preparing to run up to 1 tasks
17:25:58.639129 run-command.c:1187 run_processes_parallel: done
17:25:58.639129 run-command.c:369 trace: run_command: 'gc' '--auto'
17:25:58.644644 git.c:369 trace: built-in: git 'gc' '--auto'
17:25:58.668206 git.c:369 trace: built-in: git 'status' '-z' '-u'
17:25:58.694777 git.c:369 trace: built-in: git 'symbolic-ref' '--short' 'HEAD'
17:25:58.715332 git.c:369 trace: built-in: git 'rev-parse' 'develop'
17:25:58.736387 git.c:369 trace: built-in: git 'rev-parse' '--symbolic-full-name' '--abbrev-ref' 'develop@{u}'
17:25:58.759449 git.c:369 trace: built-in: git 'rev-list' '--left-right' 'develop...origin/develop'
17:25:58.784015 git.c:369 trace: built-in: git 'for-each-ref' '--format' '%(refname) %(objectname)'
17:26:28.870065 git.c:369 trace: built-in: git 'fetch'
17:26:28.878086 run-command.c:369 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/ioninteractive/{repo}.git'
17:26:29.081628 run-command.c:369 trace: run_command: 'git credential-manager get'
17:26:29.098673 git.c:594 trace: exec: 'git-credential-manager' 'get'
17:26:29.098673 run-command.c:369 trace: run_command: 'git-credential-manager' 'get'
17:26:29.128252 ...\Program.cs:895 trace: [Main] git-credential-manager (v1.10.0) 'get'
17:26:29.170865 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:26:29.173372 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:26:29.174375 ...\Where.cs:232 trace: [FindGitInstallations] found 1 Git installation(s).
17:26:29.174876 ...Configuration.cs:403 trace: [LoadGitConfiguration] git All config read, 72 entries.
17:26:29.187911 ...\Program.cs:732 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
17:26:29.193425 ...uthentication.cs:134 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
17:26:29.193425 ...\Program.cs:796 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
17:26:29.214983 ...icationPrompts.cs:46 trace: [CredentialModalPrompt] prompting user for credentials for 'https://github.com/'.
Here is the output from vscode's git channel for this same failure (since it was vscode that caused this case):
git fetch
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
* Trying 192.30.253.112...
* TCP_NODELAY set
* Connected to github.com (192.30.253.112) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=Delaware; serialNumber=5157550; street=88 Colin P Kelly, Jr Street; postalCode=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: Mar 10 00:00:00 2016 GMT
* expire date: May 17 12:00:00 2018 GMT
* subjectAltName: host "github.com" matched cert's "github.com"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
* SSL certificate verify ok.
> GET /ioninteractive/{repo}.git/info/refs?service=git-upload-pack HTTP/1.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< Content-Length: 21
< WWW-Authenticate: Basic realm="GitHub"
< X-GitHub-Request-Id: D3DC:2E0EC:FCD2B8:17810BE:59289CD1
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
fatal: HttpRequestException encountered.
An error occurred while sending the request.
fatal: HttpRequestException encountered.
An error occurred while sending the request.
Missing or invalid credentials.
Skip fetch commands
Missing or invalid credentials.
Skip fetch commands
* Couldn't find host github.com in the _netrc file; using defaults
* Found bundle for host github.com: 0xef8d80 [can pipeline]
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.253.112) port 443 (#0)
> GET /ioninteractive/{repo}.git/info/refs?service=git-upload-pack HTTP/1.1
Host: github.com
User-Agent: git/2.13.0.windows.1
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 401 Authorization Required
< Server: GitHub Babel 2.0
< Content-Type: text/plain
< Content-Length: 21
< WWW-Authenticate: Basic realm="GitHub"
< X-GitHub-Request-Id: D3DC:2E0EC:FCD330:17810C4:59289CD1
< X-Frame-Options: DENY
<
* Connection #0 to host github.com left intact
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/ioninteractive/{repo}.git/'
I should also note that when I looked in the Windows Credential Manger, the GitHub - https//api.github.com/eamodio one was still there, but the other one git:https//github.com was gone.
@shiftkey @Haacked is this something GitHub will have bandwidth to look into? The issue is in the GitHub authority, if not I can assign myself, but I'm current swamped with issues on Developer Community and won't likely have time to address this for a couple of weeks 😞
@whoisj apologies for missing this. I'll skim the issue and see if there's enough for me to dive into what's happening.
@whoisj has something changed here? About the only way I've largely avoided this was to turn off auto-fetch in vscode (which I guess dramatically reduces the chances of running a fetch during a network blip/outage). IMO, it still seems like something needs to be fixed here.
@eamodio I'm happy to re-open. Just 30+ days of no activity and I start consider closing the issue.
@shiftkey what are you thoughts?
I am having this problem as well. I formatted some time ago and had to reinstall (a newer version of) Git for Windows with Git Credential Manager, and I have had problems since.
The last couple of days I have tried Git for Windows 2.14.0.2 and then downgrading to 2.12 something. Both have problems.
I do not know exactly when it happens, but here's what I do:
@PaulWebSec
a) All of the repositories I am working with are either mine or I have administrator rights over the repos.
b) I disagree, there is no sign that my account is compromised.
c) Nope
as for the other points, I have no reason to believe that someone is intercepting traffic between GitHub and my computer. I think it simply is a bug in the Git Credential Manager for Windows.
@oledid the @PaulWebSec account generally spams Git and Git utility with nonsensical jibberish. Might be an AI, and an improving one as it has been more and more on topic - still however, it generally doesn't give useful advise. :unamused:
This sounds like an issue with the GitHub authority, @shiftkey to investigate and/or reassign internally.
Another thing that might be relevant. As I was uninstalling Git for Windows again to try to downgrade further, I noticed that I had A LOT of duplicate processes running (git.exe, git-credential-manager, git-remote-https etc). Had to kill them to uninstall.
Sounds like a git.exe got killed, leaving it's child procs stranded. That could very much be an issue.
How do you normally use Git? Command Prompt, Powershell, Git-bash, other?
Most of my git commands are run with powershell via cmder. I usually have two tabs open at the same time, switching between them if I have got long running tasks. I also have Visual Studio 2017 and Visual Studio Code open at all times, they probably do things in the background. But I have disabled automatic git fetch in VSCode.
The error happened again just now. But this time there were no rogue git-processes running.
EDIT: I also use posh-git for powershell, which probably also calls git in the background.
Alright, your setup sounds fairly normal.
Can you add a couple of environment variable to collect logs. Those will help me diagnose the issue.
setx GIT_TRACE %userprofile%\git.logsetx GCM_TRACE %userprofile%\git.logI have tried to reproduce the issue now, and have found out that the issue happens every time I use npm install. (My npm version is 5.2.0). Npm install also calls jspm install in my package.json so the issue might be in jspm as well.
We can attach files to github issues. Just drag and drop them to the input field. Here's a redacted log:
git.log.txt
The only possibly interesting thing I have found in the log is on line 492:
11:08:50.645112 ...seSecureStore.cs:210 trace: [WriteCredential] credentials for 'git:https://g11:08:50.713629 ...\Where.cs:239 trace: [FindGitInstallations] found 1 Git installation(s).
It looks like the log begins to write 'git:https://github.com [...] and then just crashes after "https://g" and continues with the next line's timestamp without even including a newline.
I replaced my github username and token with USERNAME:TOKEN. The token was the same every single time.
Additional tests:
git pull
jspm install
git pull # fails
# removed jspm install from package.json postinstall
git pull
npm install
git pull # succeeds
So there's something that jspm does that crashes something. jspm version is 0.16.48 - an old version that has worked for me before without any problems.
Updated to jspm 0.16.53: the problem is still there.
Problem possibly solved for my case: I believe jspm saves its github api token into the credential store, overriding my actual git credentials. "Solved" by giving more rights to the jspm api token. Will create an issue in jspm-cli.
Problem possibly solved for my case: I believe jspm saves its github api token into the credential store, overriding my actual git credentials. "Solved" by giving more rights to the jspm api token. Will create an issue in jspm-cli.
This is terrifying as the GCM uses it's own namespace for this "git:" to avoid these kinds of collisions. The Jspm tooling should use "jspm:" or "jspm-git:" for their tokens.
Thank you @oledid for debugging this. I am very sorry this issue came up in the first place.
Hey @whoisj ,
Please see https://github.com/jspm/jspm-cli/issues/2355#issuecomment-323958781
Any ideas where this task belongs?
[duplicating my comment on the Jspm issue tracker]
Ok this is rather odd, the log provided show everything working but the pattern is wrong (or at least unexpected).
The expected pattern is as follows:
What we're seeing here is the 'get' portion being skipped and skipping immediately to the 'store' command. This means that, for unknown reasons, Git is overwriting the credentials again-and-again. We do not know what values Git is writing, but potentially it is overwriting valid credentials with invalid ones.
Is it because the credentials are embedded in the actual url? https://{USERNAME}:{TOKEN}@github.com/[...]
If the git credential-manager get is not needed because the username and token are provided in the request url, I would suggest that git credential-manager store should be skipped as well.
If the git credential-manager get is not needed because the username and token are provided in the request url, I would suggest that git credential-manager store should be skipped as well.
That would be a suggestion to make the maintainers of Git. The GCM is invoked by Git, and performs the requested action without knowledge of why or how the credentials were obtained.
Alright, I will create a task in Git for Windows. I have looked through @eamodio 's logs above though, and we don't seem to have the exact same problem.
This is happening to me as well. I'm not using vscode; I'm using Sourcetree for my git interactions, plus command-line stuff from the Windows 10 Linux subsystem. If I log in from the credential manager window (involving getting my phone out to get the password and 2FA key) I'm lucky if it lasts an hour.
Is there no way to make the experience as seamless as it is on macOS, where I just `cat ~/.ssh/id_rsa.pub | pbcopy' and paste the result into Github's key settings, then everything Just Works? I'm starting to really hate the fact that my employer insists on Windows…
Is there no way to make the experience as seamless as it is on macOS, where I just `cat ~/.ssh/id_rsa.pub | pbcopy' and paste the result into Github's key settings, then everything Just Works? I'm starting to really hate the fact that my employer insists on Windows
@toto-jy does your host support SSH? Git for Windows does. The disdain for Windows is misplaced, SSH for Git works wonder on Windows. As for losing your credentials, the GCM likely doesn't run from the Windows Subsystem for Linux and if it does, the results are... well, I've no idea as I've never tried and the GCM isn't designed to be used from Linux.
As for SourceTree, I believe they ship their own custom build of the GCM and override any config you have specifying the GCM for their version of it.
Finally, the GCM supports git config --global credential.preserve true which instructs the GCM to ignore any erase request from Git.
@whoisj Yes, it's just Github. I resolved the problem by uninstalling Git for Windows and reinstalling it without the credential manager (would be nice if the modify button in the apps list wasn't greyed out, though, but I suspect that's an issue for another repo :)
Most helpful comment
@whoisj apologies for missing this. I'll skim the issue and see if there's enough for me to dive into what's happening.