Open mesbahamin opened 6 years ago
I suspect this might be related to #705
@mesbahamin do you know what this is for?
15:56:30.832112 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
With interactive = 'never'
you should not be prompted at all. Additionally, how certain are you that these prompts are coming from Git and not Git-Lfs? It looks like Git-Lfs is referring to bitbucket.org as www.bitbucket.org, and those are different credential sets (from Git's point-of-view).
OK so let's break this down.
built-in: git clone https://www.bitbucket.org/myorganization/myrepo.git
run_command: git-credential-manager get
[CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
(alert here as www.bitbucket.org != bitbucket.org -- how did this happen?!)[Get] Logon failed, use ctrl+c to cancel basic credential prompt.
(yeah, kind of expected at this point)run_command: 'git credential-manager get'
run_command: git-credential-manager get
(wait what?!)[CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
(whoa! still the wrong host!!!)[LoadOperationArguments] interactive = 'never'.
[Get] Logon failed, use ctrl+c to cancel basic credential prompt.
(not surprised)run_command: 'git credential-manager store'
(wait what?! 'store' is only called after credentials are used successfully)run_command: git-credential-manager store
(twice? back to back?!)[CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
(well, this is different)run_command: 'git credential-manager store'
(AGAIN?! how successful were these credentials?!)[CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
(O... K...)git-lfs: creds: git credential fill ("https", "www.bitbucket.org", "")
(Oh..?)run_command: git-credential-manager get
[CreateAuthentication] detecting authority type for 'https://www.bitbucket.org/'.
[Get] Logon failed, use ctrl+c to cancel basic credential prompt.
(starting to see a pattern here...)First, when you have a remote for a bitbucket repository you're expected to include the user-info for said remote. It appears like at least part of your remote information lacks this.
Second, I'd hazard a guess that you have multiple clones happening in parallel. Perhaps some of this is noise caused by Git-Lfs doing its thing, I'm not sure.
Third, despite the authentication routine reporting failure (and not sending credentials back to Git), Git is providing credentials to the helper to store -- this is very unexpected. Worse, I do not think that the Bitbucket authority honors the 'store' request as it expects that it just produce them itself anyways AND the round trip is lossy.
/CC @foda
@whoisj Thank you for the detailed response! Hopefully the information in this comment clears out some of the noise. Please let me know if there are any more questions I can answer or things that I can clarify.
interactive = 'never'
@mesbahamin do you know what this is for?
15:56:30.832112 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
Yes. That option is set as per these recommendations.
As it happens, this issue is taking place on a build agent. I have configured
interactive = 'never'
to prevent modal windows from popping up during builds,
and to ensure that we get a line in the build logs like this, rather than the
build agent silently hanging:
Logon failed, use ctrl+c to cancel basic credential prompt.
It should be noted that all the logs I am supplying in this issue are captured from my own interactive sessions while logged into the build agent, and not from the automated build agent processes.
Additionally, how certain are you that these prompts are coming from Git and not Git-Lfs?
Here's what a fresh clone looks like when git-lfs is told to not download the lfs files (detailed log included at the end of this comment):
$ $Env:GIT_LFS_SKIP_SMUDGE = 1
$ git clone https://www.bitbucket.org/myorganization/myrepo.git
Cloning into 'myrepo'...
Logon failed, use ctrl+c to cancel basic credential prompt.
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://bitbucket.org': my@email.com
Password for 'https://my@email.com@bitbucket.org':
warning: redirecting to https://bitbucket.org/myorganization/myrepo.git/
remote: Counting objects: 1114, done.
Receiving objects: 100% (1114/1114), 123.65 MiB | 1.40 MiB/s, done. 99% (1113/1114), 122.72 MiB | 2.28 MiB/s
Resolving deltas: 100% (519/519), done.
Checking out files: 100% (135/135), done.
I only need to enter my credentials once. This suggests that the other 2 promptings in my previous logs were indeed coming from git-lfs, and not git itself.
Note that the state of Windows credentials, both before and after running the above, was:
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://my@email.com@bitbucket.org
Type: Generic
User: my@email.com
Local machine persistence
So it seems that the problem we are considering here is this:
Even with git credentials stored in Windows Credential Manager, I still must enter them once every time I clone my repo.
12:17:42.910003 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:17:42.912002 git.c:415 trace: built-in: git clone https://www.bitbucket.org/myorganization/myrepo.git
12:17:43.181014 run-command.c:637 trace: run_command: git remote-https origin https://www.bitbucket.org/myorganization/myrepo.git
12:17:43.255017 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:17:43.258018 git.c:654 trace: exec: git-remote-https origin https://www.bitbucket.org/myorganization/myrepo.git
12:17:43.258018 run-command.c:637 trace: run_command: git-remote-https origin https://www.bitbucket.org/myorganization/myrepo.git
12:17:43.723038 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:17:45.868130 run-command.c:637 trace: run_command: 'git credential-manager get'
12:17:46.362184 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:17:46.365153 git.c:654 trace: exec: git-credential-manager get
12:17:46.365153 run-command.c:637 trace: run_command: git-credential-manager get
12:17:47.029182 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
12:17:47.172189 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
12:17:47.180190 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 19 entries.
12:17:47.189190 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
12:17:47.291194 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
12:17:48.121231 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:17:48.122232 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
12:17:48.145233 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
12:17:48.148232 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
12:17:48.181234 run-command.c:637 trace: run_command: 'git credential-manager get'
12:17:48.320240 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:17:48.323239 git.c:654 trace: exec: git-credential-manager get
12:17:48.323239 run-command.c:637 trace: run_command: git-credential-manager get
12:17:48.517248 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
12:17:48.661254 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
12:17:48.670254 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 19 entries.
12:17:48.679255 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
12:17:48.796260 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
12:17:52.322416 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:17:52.322416 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
12:17:52.344418 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
12:17:52.347417 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
12:17:52.379418 run-command.c:637 trace: run_command: bash -c 'test "a$SHELL" '\!'= "a${SHELL%.exe}" || exit 127; cat >/dev/tty && read -r line </dev/tty && echo "$line"'
12:18:02.639864 run-command.c:637 trace: run_command: bash -c 'test "a$SHELL" '\!'= "a${SHELL%.exe}" || exit 127; cat >/dev/tty && read -r -s line </dev/tty && echo "$line" && echo >/dev/tty'
12:18:07.762056 run-command.c:637 trace: run_command: 'git credential-manager store'
12:18:07.934063 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:18:07.937064 git.c:654 trace: exec: git-credential-manager store
12:18:07.937064 run-command.c:637 trace: run_command: git-credential-manager store
12:18:08.154074 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
12:18:08.331081 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
12:18:08.341082 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 19 entries.
12:18:08.351082 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
12:18:08.429086 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
12:18:08.988111 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:18:08.988111 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
12:18:08.988111 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
12:18:09.019111 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
12:18:09.059114 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
12:18:09.085113 run-command.c:637 trace: run_command: 'git credential-manager store'
12:18:09.221119 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:18:09.225132 git.c:654 trace: exec: git-credential-manager store
12:18:09.225132 run-command.c:637 trace: run_command: git-credential-manager store
12:18:09.399128 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
12:18:09.565134 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
12:18:09.574136 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 19 entries.
12:18:09.585136 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
12:18:09.656153 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
12:18:10.619182 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:18:10.620184 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
12:18:10.620184 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
12:18:10.649183 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my@email.com@bitbucket.org' read from store.
12:18:10.650183 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
12:18:10.655184 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
12:18:10.700186 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
12:18:10.755188 run-command.c:637 trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning https://bitbucket.org/myorganization/myrepo.git/
12:18:10.814188 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:18:10.818190 git.c:415 trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning https://bitbucket.org/myorganization/myrepo.git/
12:18:11.265210 run-command.c:637 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 880 on DESKTOP-FPDEUCP' --check-self-contained-and-connected --pack_header=2,1114
12:18:11.365214 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:18:11.369214 git.c:415 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 880 on DESKTOP-FPDEUCP' --check-self-contained-and-connected --pack_header=2,1114
12:19:41.088734 run-command.c:637 trace: run_command: git rev-list --objects --stdin --not --all --quiet '--progress=Checking connectivity'
12:19:41.170739 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:19:41.174739 git.c:415 trace: built-in: git rev-list --objects --stdin --not --all --quiet '--progress=Checking connectivity'
12:19:41.290743 run-command.c:637 trace: run_command: 'git-lfs filter-process'
12:19:41.880769 trace git-lfs: exec: git 'version'
12:19:42.312789 trace git-lfs: exec: git 'config' '-l'
12:19:42.445795 trace git-lfs: Install hook: pre-push, force=false, path=C:\Users\myusername\myrepo\.git\hooks\pre-push
12:19:42.453794 trace git-lfs: Install hook: post-checkout, force=false, path=C:\Users\myusername\myrepo\.git\hooks\post-checkout
12:19:42.460795 trace git-lfs: Install hook: post-commit, force=false, path=C:\Users\myusername\myrepo\.git\hooks\post-commit
12:19:42.468795 trace git-lfs: Install hook: post-merge, force=false, path=C:\Users\myusername\myrepo\.git\hooks\post-merge
12:19:42.477796 trace git-lfs: Initialize filter-process
12:19:42.477796 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
12:19:42.547511 trace git-lfs: tq: running as batched queue, batch size of 100
[...] REDACTED: Many lines like these, which git-lfs still runs even though it won't download anything:
15:55:37.115218 trace git-lfs: filepathfilter: rejecting "some_dir/some_file.txt" via []
15:55:37.115218 trace git-lfs: filepathfilter: accepting "some_dir/some_file.txt"
[...]
Perhaps this is #704 and #710 arising from the depths even after #720 ?
Let me say this, before anything else: this is wonderfully crafted ticket - thank you very much for taking the time to do it right. ππββοΈ
OK let's look at these failures individually.
12:17:47.029182 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
12:17:47.172189 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
12:17:47.180190 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 19 entries.
12:17:47.189190 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
12:17:47.291194 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
12:17:48.121231 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:17:48.122232 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
12:17:48.145233 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
12:17:48.148232 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
These ones looks like you simply do not have any cached credentials for bitbucket.org, and since interactive = 'never'
the GCM cannot prompt.
12:18:08.154074 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
12:18:08.331081 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
12:18:08.341082 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 19 entries.
12:18:08.351082 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
12:18:08.429086 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
12:18:08.988111 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:18:08.988111 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
12:18:08.988111 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
12:18:09.019111 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
12:18:09.059114 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
These ones appears to have succeeded, most likely because you've correctly setup your remote URL with {username}@bitbucket.org
, which is expected by the Bitbucket authority.
So I'd hazard a guess that you have remote URL set. One with the username value in the URL (expected by Bitbucket) and one without. Updating the one without will likely resolve the issue for you.
thank you very much for taking the time to do it right.
@whoisj And thank you for taking the time to help me get to the bottom of this :). This comment is a lot of text, but hopefully will contribute.
I did some more tests to try and clarify what's happening and remove even more irrelevant variables. I wanted to find out whether this issue was unique to Bitbucket repos, so I made sure to go through my test procedure (see below) with a private GitHub repo as well. I found that behavior with the Bitbucket repo was different depending on whether or not my git configuration included:
[credential]
interactive = never
My findings are summarized in this table:
Test # | Host | interactive = never |
# Relevant Items in WCM After Cred Prompt | Subsequent Clone Prompted for Credentials |
---|---|---|---|---|
1 | Bitbucket | true | 1 | true |
2 | Bitbucket | false | 2 | false |
3 | GitHub | true | 1 | false |
4 | GitHub | false | 1 | false |
The logs for each of these tests are included at the end of this comment.
Note that when credential.interactive = never
isn't present, I'm prompted by a gui
window to enter my credentials. When it is present, I get a text prompt. This is, of
course, expected.
We can see that GitHub behaves consistently regardless of the
credential.interactive
setting. One GitHub credential ends up being stored in
WCM after I enter my creds, whether I enter them through the GUI prompt window
or through the textual terminal prompt. When I clone a second time, that
credential is retrieved and used automatically. I don't have to enter my creds
a second time. This behavior is what I expect.
Bitbucket, however, behaves inconsistently. When I enter my creds through the GUI prompt, 2 Bitbucket credentials are stored in WCM. When I enter them through the text prompt, only 1 is stored, and it seems inadequate because my subsequent clone requires me to re-enter my creds. This behavior is unexpected.
You mentioned:
These ones looks like you simply do not have any cached credentials for bitbucket.org, and since
interactive = 'never'
the GCM cannot prompt.
Even with interactive = never
, I am prompted by (I think) Git Credential
Manager for Windows, just textually rather than with a GUI. So I'm confused that
the results are different.
You also mentioned:
These ones appears to have succeeded, most likely because you've correctly setup your remote URL with
{username}@bitbucket.org
, which is expected by the Bitbucket authority.
I was confused when I read this because I'm using the same URL with each
invocation of git clone
. Which remote URL are you referring to? Is it the URL
stored with the credential in WCM?
Yet another thing I noticed is that WCM credentials end up having slight
differences in the User:
field depending on whether interactive = never
is
present in the git config. This is true even with GitHub (see the logs for tests
3 and 4 below). Not sure whether this is not relevant.
@whoisj Thank you again for your help with this issue.
(Bitbucket, text cred prompt, unexpected behavior)
$ cmdkey.exe /list
Currently stored credentials:
* NONE *
14:45:03.730187 git.c:344 trace: built-in: git 'clone' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:45:03.765093 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:45:03.777063 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:45:03.777063 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:45:04.835575 run-command.c:626 trace: run_command: 'git credential-manager get'
14:45:04.868486 git.c:576 trace: exec: 'git-credential-manager' 'get'
14:45:04.868486 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
14:45:04.921345 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:45:04.989163 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:45:04.993154 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:45:04.997142 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:45:05.038061 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:45:05.467022 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:45:05.467022 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:45:05.474977 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
14:45:05.475975 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
14:45:05.501905 run-command.c:626 trace: run_command: 'git credential-manager get'
14:45:05.533844 git.c:576 trace: exec: 'git-credential-manager' 'get'
14:45:05.533844 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
14:45:05.584684 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:45:05.637574 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:45:05.641534 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:45:05.644524 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:45:05.686440 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:45:06.101344 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:45:06.101344 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:45:06.109324 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
14:45:06.110321 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
14:45:06.136250 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r line </dev/tty && echo "$line"'
14:45:21.959835 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r -s line </dev/tty && echo "$line" && echo >/dev/tty'
14:45:26.187412 run-command.c:626 trace: run_command: 'git credential-manager store'
14:45:26.221322 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:45:26.221322 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:45:26.277173 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:45:26.331029 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:45:26.335018 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:45:26.338010 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:45:26.365935 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
14:45:26.793053 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:45:26.793053 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
14:45:26.793053 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
14:45:26.803026 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
14:45:26.809010 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
14:45:26.833944 run-command.c:626 trace: run_command: 'git credential-manager store'
14:45:26.861869 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:45:26.862867 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:45:26.914729 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:45:26.971575 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:45:26.975582 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:45:26.978578 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:45:27.007479 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
14:45:27.414429 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:45:27.414429 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
14:45:27.414429 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
14:45:27.427422 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my@email.com@bitbucket.org' read from store.
14:45:27.428392 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:45:27.429389 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
14:45:27.436399 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
14:45:27.463298 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:45:27.475267 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:45:27.959088 run-command.c:626 trace: run_command: 'unpack-objects' '--pack_header=2,29'
14:45:27.972053 git.c:344 trace: built-in: git 'unpack-objects' '--pack_header=2,29'
14:45:28.100709 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
14:45:28.112678 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://my@email.com@bitbucket.org
Type: Generic
User: my@email.com
Local machine persistence
14:47:01.215159 git.c:344 trace: built-in: git 'clone' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:47:01.249069 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:47:01.261036 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:47:01.261036 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:47:02.348370 run-command.c:626 trace: run_command: 'git credential-manager get'
14:47:02.380280 git.c:576 trace: exec: 'git-credential-manager' 'get'
14:47:02.380280 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
14:47:02.434164 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:47:02.487016 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:47:02.490984 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:47:02.493997 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:47:02.536861 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:47:02.987680 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:47:02.987680 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:47:02.995635 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
14:47:02.996632 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
14:47:03.012588 run-command.c:626 trace: run_command: 'git credential-manager get'
14:47:03.042510 git.c:576 trace: exec: 'git-credential-manager' 'get'
14:47:03.043506 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
14:47:03.095368 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:47:03.149247 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:47:03.153213 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:47:03.156205 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:47:03.198093 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:47:03.616145 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:47:03.616145 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:47:03.623129 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
14:47:03.624095 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
14:47:03.649028 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r line </dev/tty && echo "$line"'
14:47:14.200185 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r -s line </dev/tty && echo "$line" && echo >/dev/tty'
14:47:19.250702 run-command.c:626 trace: run_command: 'git credential-manager store'
14:47:19.324504 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:47:19.324504 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:47:19.377389 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:47:19.432216 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:47:19.435208 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:47:19.439197 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:47:19.471112 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
14:47:19.938130 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:47:19.939127 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
14:47:19.939127 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
14:47:19.947108 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my@email.com@bitbucket.org' read from store.
14:47:19.947108 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:47:19.949101 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
14:47:19.955085 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
14:47:19.981016 run-command.c:626 trace: run_command: 'git credential-manager store'
14:47:20.010936 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:47:20.010936 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:47:20.063824 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:47:20.121640 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:47:20.125656 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
14:47:20.128653 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:47:20.156548 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
14:47:20.570566 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:47:20.570566 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
14:47:20.570566 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
14:47:20.583520 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my@email.com@bitbucket.org' read from store.
14:47:20.584516 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:47:20.586511 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
14:47:20.592494 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
14:47:20.627408 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:47:20.639391 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:47:20.993443 run-command.c:626 trace: run_command: 'unpack-objects' '--pack_header=2,29'
14:47:21.008399 git.c:344 trace: built-in: git 'unpack-objects' '--pack_header=2,29'
14:47:21.145034 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
14:47:21.155008 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
14:47:21.207867 run-command.c:626 trace: run_command: 'C:\dev\myorganization\asgard\myrepo\githooks/post-checkout' '0000000000000000000000000000000000000000' 'eeffd209d4c70954cf0ee53d5b279dc9f8dfced4' '1'
14:47:21.259727 git.c:576 trace: exec: 'git-lfs' 'post-checkout' '0000000000000000000000000000000000000000' 'eeffd209d4c70954cf0ee53d5b279dc9f8dfced4' '1'
14:47:21.259727 run-command.c:626 trace: run_command: 'git-lfs' 'post-checkout' '0000000000000000000000000000000000000000' 'eeffd209d4c70954cf0ee53d5b279dc9f8dfced4' '1'
14:47:21.286655 trace git-lfs: run_command: 'git' version
14:47:21.358546 trace git-lfs: run_command: 'git' config -l
(Bitbucket, gui cred prompt, expected behavior)
$ cmdkey.exe /list
Currently stored credentials:
* NONE *
14:35:29.638397 git.c:344 trace: built-in: git 'clone' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:35:29.674301 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:35:29.686269 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:35:29.687267 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:35:30.648505 run-command.c:626 trace: run_command: 'git credential-manager get'
14:35:30.683412 git.c:576 trace: exec: 'git-credential-manager' 'get'
14:35:30.684409 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
14:35:30.740287 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:35:30.794115 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:35:30.798117 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:35:30.843982 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:35:31.284087 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:35:31.284087 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:35:31.337943 ...icationPrompts.cs:96 trace: [CredentialModalPrompt] prompting user for credentials.
14:35:45.392243 ...\RestClient.cs:35 trace: [TryGetUser] server responded with OK.
14:35:45.392243 ...\RestClient.cs:42 trace: [TryGetUser] authentication success: new password token created.
14:35:45.393240 ...\RestClient.cs:80 trace: [FindUsername] Found username [my_bitbucket_username_that_is_not_an_email_address]
14:35:45.393240 ...hAuthenticator.cs:31 trace: [GetAuthAsync] remote username [my_bitbucket_username_that_is_not_an_email_address] != [my@email.com] supplied username
14:35:45.393240 ...uthentication.cs:360 trace: [InteractiveLogon] token acquisition succeeded
14:35:45.396232 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username_that_is_not_an_email_address at https://bitbucket.org/
14:35:45.396232 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username_that_is_not_an_email_address at https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/
14:35:45.404211 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' written to store.
14:35:45.411210 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://bitbucket.org' written to store.
14:35:45.416179 ...\Authority.cs:214 trace: [ValidateCredentials] authentication type = 'Credential'.
14:35:45.728500 ...\RestClient.cs:35 trace: [TryGetUser] server responded with OK.
14:35:45.728500 ...\RestClient.cs:42 trace: [TryGetUser] authentication success: new password token created.
14:35:45.728500 ...\RestClient.cs:80 trace: [FindUsername] Found username [my_bitbucket_username_that_is_not_an_email_address]
14:35:45.728500 ...\Authority.cs:221 trace: [ValidateCredentials] credential validation succeeded
14:35:45.728500 ...\Common.cs:828 trace: [QueryCredentials] credentials for 'https://bitbucket.org/' found.
14:35:45.728500 ...\Common.cs:642 trace: [LogEvent] Bitbucket credentials for 'https://bitbucket.org/' successfully retrieved.
14:35:46.411771 run-command.c:626 trace: run_command: 'git credential-manager store'
14:35:46.443684 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:35:46.443684 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:35:46.499566 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:35:46.555413 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:35:46.559376 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:35:46.589296 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:35:47.102191 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:35:47.102191 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/' is Bitbucket.
14:35:47.102191 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:35:47.116182 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' read from store.
14:35:47.117179 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:35:47.119146 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username_that_is_not_an_email_address at https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/
14:35:47.126165 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' written to store.
14:35:47.153055 run-command.c:626 trace: run_command: 'git credential-manager store'
14:35:47.183972 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:35:47.183972 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:35:47.235834 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:35:47.289690 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:35:47.294676 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:35:47.325593 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:35:47.897865 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:35:47.897865 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/' is Bitbucket.
14:35:47.897865 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:35:47.910831 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' read from store.
14:35:47.911828 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:35:47.913823 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username_that_is_not_an_email_address at https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/
14:35:47.920804 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' written to store.
14:35:47.947732 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:35:47.960698 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:35:48.390104 run-command.c:626 trace: run_command: 'unpack-objects' '--pack_header=2,29'
14:35:48.407056 git.c:344 trace: built-in: git 'unpack-objects' '--pack_header=2,29'
14:35:48.542693 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
14:35:48.553663 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://bitbucket.org
Type: Generic
User: my_bitbucket_username_that_is_not_an_email_address
Local machine persistence
Target: LegacyGeneric:target=git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org
Type: Generic
User: my_bitbucket_username_that_is_not_an_email_address
Local machine persistence
14:38:10.284076 git.c:344 trace: built-in: git 'clone' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:38:10.317985 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:38:10.329954 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:38:10.329954 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.bitbucket.org/myorganization/myrepo.git'
14:38:11.295132 run-command.c:626 trace: run_command: 'git credential-manager get'
14:38:11.328044 git.c:576 trace: exec: 'git-credential-manager' 'get'
14:38:11.328044 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
14:38:11.398882 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:38:11.451713 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:38:11.455702 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:38:11.501579 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:38:11.962542 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:38:11.962542 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:38:11.969524 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://bitbucket.org' read from store.
14:38:11.969524 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:38:11.975507 ...\Authority.cs:214 trace: [ValidateCredentials] authentication type = 'Credential'.
14:38:12.462807 ...\RestClient.cs:35 trace: [TryGetUser] server responded with OK.
14:38:12.462807 ...\RestClient.cs:42 trace: [TryGetUser] authentication success: new password token created.
14:38:12.463807 ...\RestClient.cs:80 trace: [FindUsername] Found username [my_bitbucket_username_that_is_not_an_email_address]
14:38:12.464804 ...\Authority.cs:221 trace: [ValidateCredentials] credential validation succeeded
14:38:12.464804 ...\Common.cs:828 trace: [QueryCredentials] credentials for 'https://bitbucket.org/' found.
14:38:12.464804 ...\Common.cs:642 trace: [LogEvent] Bitbucket credentials for 'https://bitbucket.org/' successfully retrieved.
14:38:12.623401 run-command.c:626 trace: run_command: 'git credential-manager store'
14:38:12.655443 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:38:12.655443 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:38:12.709328 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:38:12.762186 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:38:12.766167 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:38:12.796094 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:38:13.226178 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:38:13.226178 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/' is Bitbucket.
14:38:13.226178 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:38:13.235154 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' read from store.
14:38:13.235154 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:38:13.237149 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username_that_is_not_an_email_address at https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/
14:38:13.246125 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' written to store.
14:38:13.271082 run-command.c:626 trace: run_command: 'git credential-manager store'
14:38:13.300005 git.c:576 trace: exec: 'git-credential-manager' 'store'
14:38:13.300005 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
14:38:13.353837 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:38:13.407692 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:38:13.410712 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:38:13.442599 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:38:13.859683 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:38:13.859683 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/' is Bitbucket.
14:38:13.859683 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/'.
14:38:13.872621 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' read from store.
14:38:13.872621 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
14:38:13.874616 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username_that_is_not_an_email_address at https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org/
14:38:13.881634 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username_that_is_not_an_email_address@bitbucket.org' written to store.
14:38:13.909523 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:38:13.921490 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://bitbucket.org/myorganization/myrepo.git/'
14:38:14.341367 run-command.c:626 trace: run_command: 'unpack-objects' '--pack_header=2,29'
14:38:14.354333 git.c:344 trace: built-in: git 'unpack-objects' '--pack_header=2,29'
14:38:14.491964 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
14:38:14.502936 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
(GitHub, text cred prompt, expected behavior)
$ cmdkey.exe /list
Currently stored credentials:
* NONE *
15:02:50.306228 git.c:576 trace: exec: 'git-st'
15:02:50.306228 run-command.c:626 trace: run_command: 'git-st'
15:02:50.309223 git.c:274 trace: alias expansion: st => 'status'
15:02:50.309223 git.c:620 trace: exec: 'git' 'status'
15:02:50.309223 run-command.c:626 trace: run_command: 'git' 'status'
15:03:06.942639 git.c:576 trace: exec: 'git-st'
15:03:06.943636 run-command.c:626 trace: run_command: 'git-st'
15:03:06.945630 git.c:274 trace: alias expansion: st => 'status'
15:03:06.945630 git.c:620 trace: exec: 'git' 'status'
15:03:06.945630 run-command.c:626 trace: run_command: 'git' 'status'
15:04:42.313757 git.c:344 trace: built-in: git 'clone' 'https://www.github.com/HandmadeHero/cpp.git'
15:04:42.349662 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:04:42.361630 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:04:42.361630 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:04:43.050965 run-command.c:626 trace: run_command: 'git credential-manager get'
15:04:43.083794 git.c:576 trace: exec: 'git-credential-manager' 'get'
15:04:43.083794 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
15:04:43.139671 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
15:04:43.191533 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:04:43.196493 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:04:43.199485 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:04:43.242398 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
15:04:43.505801 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
15:04:43.505801 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
15:04:43.510788 ...\Common.cs:809 trace: [QueryCredentials] credentials for 'https://github.com/' not found.
15:04:43.511758 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve GitHub credentials for 'https://github.com/'.
15:04:43.512755 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
15:04:43.537717 run-command.c:626 trace: run_command: 'git credential-manager get'
15:04:43.568606 git.c:576 trace: exec: 'git-credential-manager' 'get'
15:04:43.568606 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
15:04:43.622462 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
15:04:43.674323 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:04:43.678340 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:04:43.682301 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:04:43.723192 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
15:04:44.067510 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
15:04:44.067510 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
15:04:44.073494 ...\Common.cs:809 trace: [QueryCredentials] credentials for 'https://github.com/' not found.
15:04:44.073494 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve GitHub credentials for 'https://github.com/'.
15:04:44.074491 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
15:04:44.099424 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r line </dev/tty && echo "$line"'
15:05:01.722733 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r -s line </dev/tty && echo "$line" && echo >/dev/tty'
15:06:21.106005 run-command.c:626 trace: run_command: 'git credential-manager store'
15:06:21.135925 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:06:21.136923 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:06:21.190807 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:06:21.246638 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:06:21.250619 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:06:21.253611 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:06:21.282533 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@github.com/'.
15:06:21.589741 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://my@email.com@github.com/'.
15:06:21.589741 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://my@email.com@github.com/' is GitHub.
15:06:21.589741 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://my@email.com@github.com/'.
15:06:21.596722 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:06:21.621656 run-command.c:626 trace: run_command: 'git credential-manager store'
15:06:21.651576 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:06:21.652572 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:06:21.704434 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:06:21.761282 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:06:21.765271 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:06:21.769260 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:06:21.796188 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@github.com/'.
15:06:22.065605 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://my@email.com@github.com/'.
15:06:22.066602 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://my@email.com@github.com/' is GitHub.
15:06:22.066602 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://my@email.com@github.com/'.
15:06:22.077572 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:06:22.105498 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:06:22.121456 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:06:22.324929 run-command.c:626 trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 15496 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:06:22.338892 git.c:344 trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 15496 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:06:22.830577 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
15:06:22.841547 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://github.com
Type: Generic
User: my@email.com
Local machine persistence
15:06:53.280875 git.c:344 trace: built-in: git 'clone' 'https://www.github.com/HandmadeHero/cpp.git'
15:06:53.313787 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:06:53.325755 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:06:53.325755 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:06:53.974793 run-command.c:626 trace: run_command: 'git credential-manager get'
15:06:54.006624 git.c:576 trace: exec: 'git-credential-manager' 'get'
15:06:54.006624 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
15:06:54.069457 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
15:06:54.130311 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:06:54.134284 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:06:54.137303 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:06:54.179164 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
15:06:54.442507 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
15:06:54.442507 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
15:06:54.447466 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
15:06:54.447466 ...uthentication.cs:175 trace: [GetCredentials] credentials for 'https://github.com/' found.
15:06:55.523755 ...\Authority.cs:200 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
15:06:55.523755 ...\Common.cs:804 trace: [QueryCredentials] credentials for 'https://github.com/' found.
15:06:55.523755 ...\Common.cs:642 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
15:06:55.764210 run-command.c:626 trace: run_command: 'git credential-manager store'
15:06:55.795126 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:06:55.795126 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:06:55.846988 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:06:55.900844 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:06:55.904833 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:06:55.907825 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:06:55.936748 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@github.com/'.
15:06:56.192202 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://my@email.com@github.com/'.
15:06:56.192202 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://my@email.com@github.com/' is GitHub.
15:06:56.192202 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://my@email.com@github.com/'.
15:06:56.200180 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:06:56.226111 run-command.c:626 trace: run_command: 'git credential-manager store'
15:06:56.256031 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:06:56.256031 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:06:56.308889 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:06:56.366735 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:06:56.370724 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 51 entries.
15:06:56.373716 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
15:06:56.401641 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@github.com/'.
15:06:56.682014 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://my@email.com@github.com/'.
15:06:56.682014 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://my@email.com@github.com/' is GitHub.
15:06:56.682014 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://my@email.com@github.com/'.
15:06:56.693064 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:06:56.731902 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:06:56.744847 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:06:56.949300 run-command.c:626 trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 1852 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:06:56.962265 git.c:344 trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 1852 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:06:58.442477 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
15:06:58.453469 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
(GitHub, gui cred prompt, expected behavior)
$ cmdkey.exe /list
Currently stored credentials:
* NONE *
15:13:42.681758 git.c:344 trace: built-in: git 'clone' 'https://www.github.com/HandmadeHero/cpp.git'
15:13:42.717661 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:13:42.729622 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:13:42.729622 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:13:43.649576 run-command.c:626 trace: run_command: 'git credential-manager get'
15:13:43.684403 git.c:576 trace: exec: 'git-credential-manager' 'get'
15:13:43.684403 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
15:13:43.741280 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
15:13:43.796104 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:13:43.800121 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
15:13:43.844973 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
15:13:44.102578 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
15:13:44.102578 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
15:13:44.153415 ...icationPrompts.cs:59 trace: [CredentialModalPrompt] prompting user for credentials for 'https://github.com/'.
15:14:00.418671 ...\Authority.cs:101 trace: [AcquireToken] server responded with Created.
15:14:00.419585 ...\Authority.cs:125 trace: [AcquireToken] authentication success: new personal access token for 'https://github.com/' created.
15:14:00.419585 ...uthentication.cs:201 trace: [InteractiveLogon] token acquisition for 'https://github.com/' succeeded
15:14:00.427563 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:14:01.198014 ...\Authority.cs:200 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
15:14:01.198014 ...\Common.cs:804 trace: [QueryCredentials] credentials for 'https://github.com/' found.
15:14:01.198014 ...\Common.cs:642 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
15:14:01.897667 run-command.c:626 trace: run_command: 'git credential-manager store'
15:14:01.929499 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:14:01.930496 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:14:01.980390 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:14:02.033248 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:14:02.037238 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
15:14:02.067160 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://Personal Access Token@github.com/'.
15:14:02.323517 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://Personal Access Token@github.com/'.
15:14:02.323517 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://Personal Access Token@github.com/' is GitHub.
15:14:02.323517 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://Personal Access Token@github.com/'.
15:14:02.334650 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:14:02.360584 run-command.c:626 trace: run_command: 'git credential-manager store'
15:14:02.392498 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:14:02.392498 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:14:02.446363 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:14:02.502205 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:14:02.506194 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
15:14:02.538109 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://Personal Access Token@github.com/'.
15:14:02.797121 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://Personal Access Token@github.com/'.
15:14:02.797121 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://Personal Access Token@github.com/' is GitHub.
15:14:02.798118 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://Personal Access Token@github.com/'.
15:14:02.808092 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:14:02.844994 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:14:02.858956 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:14:03.074492 run-command.c:626 trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 11916 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:14:03.087457 git.c:344 trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 11916 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:14:06.890257 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
15:14:06.902225 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://github.com
Type: Generic
User: Personal Access Token
Local machine persistence
15:14:26.043058 git.c:344 trace: built-in: git 'clone' 'https://www.github.com/HandmadeHero/cpp.git'
15:14:26.077965 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:14:26.090930 git.c:576 trace: exec: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:14:26.090930 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://www.github.com/HandmadeHero/cpp.git'
15:14:26.648617 run-command.c:626 trace: run_command: 'git credential-manager get'
15:14:26.680507 git.c:576 trace: exec: 'git-credential-manager' 'get'
15:14:26.680507 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
15:14:26.732389 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
15:14:26.785231 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:14:26.789246 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
15:14:26.834124 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://github.com/'.
15:14:27.116415 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://github.com/'.
15:14:27.116415 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://github.com/' is GitHub.
15:14:27.122395 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://github.com' read from store.
15:14:27.122395 ...uthentication.cs:175 trace: [GetCredentials] credentials for 'https://github.com/' found.
15:14:27.780373 ...\Authority.cs:200 trace: [ValidateCredentials] credential validation for 'https://github.com/' succeeded.
15:14:27.780373 ...\Common.cs:804 trace: [QueryCredentials] credentials for 'https://github.com/' found.
15:14:27.780373 ...\Common.cs:642 trace: [LogEvent] GitHub credentials for 'https://github.com/' successfully retrieved.
15:14:28.172450 run-command.c:626 trace: run_command: 'git credential-manager store'
15:14:28.204386 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:14:28.204386 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:14:28.256223 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:14:28.310106 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:14:28.313098 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
15:14:28.343987 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://Personal Access Token@github.com/'.
15:14:28.590463 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://Personal Access Token@github.com/'.
15:14:28.590463 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://Personal Access Token@github.com/' is GitHub.
15:14:28.591464 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://Personal Access Token@github.com/'.
15:14:28.599415 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:14:28.625345 run-command.c:626 trace: run_command: 'git credential-manager store'
15:14:28.656263 git.c:576 trace: exec: 'git-credential-manager' 'store'
15:14:28.657260 run-command.c:626 trace: run_command: 'git-credential-manager' 'store'
15:14:28.709122 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
15:14:28.762998 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
15:14:28.767964 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
15:14:28.798882 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://Personal Access Token@github.com/'.
15:14:29.068378 ...uthentication.cs:151 trace: [GetAuthentication] created GitHub authentication for 'https://Personal Access Token@github.com/'.
15:14:29.068378 ...\Common.cs:162 trace: [CreateAuthentication] authority for 'https://Personal Access Token@github.com/' is GitHub.
15:14:29.068378 ...\Program.cs:527 trace: [Store] storing GitHub credentials for 'https://Personal Access Token@github.com/'.
15:14:29.080353 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://github.com' written to store.
15:14:29.111264 run-command.c:626 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:14:29.125226 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/HandmadeHero/cpp.git/'
15:14:29.308985 run-command.c:626 trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 15996 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:14:29.322948 git.c:344 trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 15996 on cooper' '--check-self-contained-and-connected' '--pack_header=2,5012'
15:14:33.634049 run-command.c:626 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
15:14:33.645019 git.c:344 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
I can't even authenticate with bitbucket.. they screw everything lately without any notice... Always cause login failed even with new GCW 1.17
C:\Users\Ben>git clone https://Xxx@bitbucket.org/xxx/xxxx.git Cloning into 'xxxx... Logon failed, use ctrl+c to cancel basic credential prompt. Password for 'https://xxxx@bitbucket.org': remote: Counting objects: 817
Git 2.18 broken for me, too in the same way. I reverted to git 2.16.3 and I can sign in with the (old) Atlassian credential dialog via GCW.
/CC @foda @mminns
@benyaminl and @codekaizen could you capture trace logs similar to what @mesbahamin was kind enough to provide? They are invaluable when attempting to resolve issues for you.
@whoisj In an attempt to answer some of the questions I listed in my last post, I cloned and built Git Credential Manager for Windows locally and told git to use this local build as its credential helper.
Unfortunately I didn't quite manage to get to the point where I could step through the code in VS when git invoked GCM. I may be able to put more time into this, and will report here if I find anything notable.
@mesbahamin if you set GCM_DEBUG=1
the GCM will reach out to your debugger for help.
Of course, this works best with a debug build of the project, so using your local built GCM is likely the best solution if you plan to debug the project.
Thanks so much for your continued patience and effort! πββοΈπ
Even with interactive = never, I am prompted by (I think) Git Credential Manager for Windows, just textually rather than with a GUI. So I'm confused that the results are different.
The source code governing that interaction is below, and I'm very surprised to find that the condition allows Interactivity == Never
to call the AcquireCredentials
API.
if (((operationArguments.Interactivity != Interactivity.Always)
&& ((credentials = await bbcAuth.GetCredentials(operationArguments.TargetUri, operationArguments.Username)) != null)
&& (!operationArguments.ValidateCredentials
|| ((credentials = await bbcAuth.ValidateCredentials(operationArguments.TargetUri, operationArguments.Username, credentials)) != null)))
|| ((operationArguments.Interactivity != Interactivity.Never)
&& ((credentials = await bbcAuth.InteractiveLogon(operationArguments.TargetUri, operationArguments.Username)) != null)
&& (!operationArguments.ValidateCredentials
|| ((credentials = await bbcAuth.ValidateCredentials(operationArguments.TargetUri, operationArguments.Username, credentials)) != null))))
/CC @Foda - perhaps he can help explain why we're seeing a pair of credentials being saved off. Perhaps one of them is the "refresh token"?
Git 2.18 broken for me, too in the same way. I reverted to git 2.16.3 and I can sign in with the (old) Atlassian credential dialog via GCW.
@codekaizen I do not believe there's a GCM change between v2.17 and v2.18 of Git for Windows, it's a separate project and they keep their own schedule as to when various components update and they also control to what version of the component their package is updated to.
For the purposes of this issue tracker you should be concerned with the output of git credential-manager version
and not git version
; though the two can interplay, for this issue they do not.
@whoisj It's working after useing GCW 1.17.1 (Sorry for not looking the release, I've seen that there's problem on milestone, thanks for fix it for user like us). I use busybox git version, the very minimal version of git on windows
@benyamini please be aware that Minimal Git for Windows is not designed to be used directly by people. It is intended to be used as part of a GUI application. For example : Visual Studio ships with and exclusively uses Minimal Git for Windows.
You can make it work on the command line, but you're on your own if / when things fail.
@whoisj Yep I just told by other developer the same way. I use it with VS Code :) Anyway it's working for now (I hate git with very big footprint on memory, that's why I use MinGit, and It's portable :))
After some additional time spent investigating this (with he help of GCM_DEBUG
and the Visual Studio debugger), I think I may have some useful observations.
First, some words about the current state of Bitbucket authentication.
Bitbucket has the concept of an account with a username and an email. In the
following discussion and logs, I will use "my_bitbucket_username"
and
"my@email.com"
as example values for each, respectively.
For the purpose of Bitbucket authentication, these used to be interchangeable (the way they are with GitHub or GitLab). At some point, Atlassian changed this. Since that change, users have only been permitted to authenticate with their email, not their username. You can see this if you try to log in to Bitbucket with your username:
Because of this policy, I have gotten used to using only my email to authenticate with Bitbucket.
I wondered whether perhaps this issue (#725) had been caused by some subtle bug having to do with my use of my email address rather than my username. I did some more experimentation to investigate that possibility.
Oddly (and conveniently) enough, if you use Git Credential Manager for Windows
without credential.interactive = never
in your gitconfig, you are actually
able to authenticate with either your username or your email:
If I enter my creds into this modal window, regardless of whether I use my username or my email address, the result is that the following is stored in Windows Credential Cache:
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
Target: LegacyGeneric:target=git:https://my_bitbucket_username@bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
We can observe that both of the above stored credentials make reference to
"my_bitbucket_username"
and not "my@email.com"
. If I entered my email, how
does my username end up in the credential cache? We can see how in the GCM logs:
11:52:56.381907 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
11:52:56.828859 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
11:52:56.829856 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
11:53:39.405970 ...icationPrompts.cs:96 trace: [CredentialModalPrompt] prompting user for credentials.
11:54:02.472771 ...\RestClient.cs:35 trace: [TryGetUser] server responded with OK.
11:54:02.898317 ...\RestClient.cs:42 trace: [TryGetUser] authentication success: new password token created.
11:54:09.152400 ...\RestClient.cs:80 trace: [FindUsername] Found username [my_bitbucket_username]
11:54:14.257394 ...hAuthenticator.cs:31 trace: [GetAuthAsync] remote username [my_bitbucket_username] != [my@email.com] supplied username
11:54:14.280342 ...uthentication.cs:360 trace: [InteractiveLogon] token acquisition succeeded
11:54:37.472420 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username at https://bitbucket.org/
11:54:49.021027 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username at https://my_bitbucket_username@bitbucket.org/
11:55:30.418705 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username@bitbucket.org' written to store.
11:55:47.317635 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://bitbucket.org' written to store.
We can see here that, after prompting me for my credentials and receiving my email address and password, GCM talks to Bitbucket, which in turn responds with my username. This is what GCM ultimately stores with the 2 credentials in the credential cache.
With these 2 credentials in the cache, I can make subsequent clones without
needing to re-input my credentials! This is true regardless of the setting of
credential.interactive
during those subsequent clones. It seems as though this
is our desired state for the credential cache after authenticating.
Now what happens when I do use credential.interactive = never
?
In this case, GCM doesn't talk to Bitbucket about my username. It simply takes the email I provided and uses it like a username:
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://my@email.com@bitbucket.org
Type: Generic
User: my@email.com
Local machine persistence
We can observe the notable lack of RestClient.cs
in the logs:
11:37:28.737167 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
11:37:29.216370 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
11:37:29.217356 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
11:39:36.977570 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
11:40:06.719875 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
11:40:06.745805 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r line </dev/tty && echo "$line"'
11:40:24.280739 run-command.c:626 trace: run_command: 'bash' '-c' 'cat >/dev/tty && read -r -s line </dev/tty && echo "$line" && echo >/dev/tty'
11:40:29.676473 run-command.c:626 trace: run_command: 'C:/dev/myorganization/libraries/Git-Credential-Manager-for-Windows/Cli/Manager/bin/Debug/git-credential-manager.exe store'
11:40:35.515578 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
11:40:35.566473 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
11:40:35.571429 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
11:40:35.574421 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
11:40:35.575417 ...\Common.cs:312 trace: [EnableTraceLogging] GCM arguments:
protocol=https
host=bitbucket.org
path=
username=my@email.com
password=mypassword
11:40:35.599381 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my@email.com@bitbucket.org/'.
11:40:36.087947 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
11:40:36.087947 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my@email.com@bitbucket.org/' is Bitbucket.
11:40:36.088944 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my@email.com@bitbucket.org/'.
11:43:19.647559 ...uthentication.cs:258 trace: [SetCredentials] my@email.com at https://my%40email.com@bitbucket.org/
11:44:32.428785 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my@email.com@bitbucket.org' written to store.
Also notably absent is the credential of the form, Target: LegacyGeneric:target=git:https://bitbucket.org
. We can notice that there is
only 1 call to SetCredentials
in the above logs.
With only this credential in the cache, subsequent clones will prompt me again for my credentials every time.
If I enter my username rather than my email in the text prompt, the resulting log is essentially the same as the one in the previous section. However I end up with this nice, familiar credential in the credential cache:
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://my_bitbucket_username@bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
Again, I end up with only 1 cached credential. This time, however, it looks just like one of the 2 I got when I used the modal window! Sadly, subsequent clones will still prompt me for my credentials every time. This entry in the credential cache is not, alone, sufficient.
Further tinkering and testing revealed that if there is a single cached credential of either of the following 2 forms, subsequent clones will use it as expected:
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://bitbucket.org
Type: Generic
User: my@email.com
Local machine persistence
or
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
If there is no such cached credential, I am prompted again for every clone.
So it seems the essence of the problem is:
Target: LegacyGeneric:target=git:https://bitbucket.org
during 'interactive
login', when the user inputs credentials into the modal window.Target: LegacyGeneric:target=git:https://bitbucket.org
when the user inputs
credentials into the text prompt.Target: LegacyGeneric:target=git:https://bitbucket.org
in the credential
cache in order to successfully authenticate without having to re-prompt.If the above is true, a solution could perhaps be to change the behavior in the
second bullet so that the necessary credential is saved in all cases. If time
permits I would like to more closely investigate GetCredentials()
and
SetCredentials()
, capture this bug in a unit test, and find some reasonable
fix.
@mminns @Foda this is some amazing debugging detective work on behalf of @mesbahamin for you. π€©π
@mesbahamin thanks. I'll take some time to read it in more detail.
I will just mention that the Bitbucket code should store credentials under git:https://username@bitbucket.org when the username is included in the repository's remote url. If the remote url does not include the username then the credentials should be stored as git:https://bitbucket.org.
Whether that is happening consistently/correctly is something for us to look in to.
Whether that is happening consistently/correctly is something for us to look in to.
@mminns I tested whether GCM's behavior conforms to our expectations. These
2 tests were done with GCM checked out at tag v1.17.1-preview.1
(commit
91d2120c0684694c382b737e3b4f9bb23d5ed0ef), and with this in the gitconfig:
[credential]
interactive = never
the Bitbucket code should store credentials under git:https://username@bitbucket.org when the username is included in the repository's remote url.
This appears to be happening as we expect. See the log for Test 01 at the end of this comment.
If the remote url does not include the username then the credentials should be stored as git:https://bitbucket.org.
This does not happen as expected. See the log for Test 02 at the end of this comment. The resulting cached credential is identical to the one in Test 01.
In both cases, by the time we get to SetCredentials()
, targetUri
contains
"my_bitbucket_username"
. The if condition here evaluates to false
, and
SetCredentials()
doesn't recurse, and only one credential, the one in the logs
at the end of this comment, is cached:
/// <inheritdoc/>
public async Task<bool> SetCredentials(TargetUri targetUri, Credential credentials, string username)
{
if (targetUri is null)
throw new ArgumentNullException(nameof(targetUri));
if (credentials is null)
throw new ArgumentNullException(nameof(credentials));
Trace.WriteLine($"{credentials.Username} at {targetUri.QueryUri.AbsoluteUri}");
// If the Url doesn't contain a username then save with an explicit username.
if (!targetUri.ContainsUserInfo && (!string.IsNullOrWhiteSpace(username)
|| !string.IsNullOrWhiteSpace(credentials.Username)))
{
var realUsername = GetRealUsername(credentials, username);
Credential tempCredentials = new Credential(realUsername, credentials.Password);
if (tempCredentials.Username.Length > BaseSecureStore.UsernameMaxLength)
throw new ArgumentOutOfRangeException(nameof(tempCredentials.Username));
if (tempCredentials.Password.Length > BaseSecureStore.PasswordMaxLength)
throw new ArgumentOutOfRangeException(nameof(tempCredentials.Password));
await SetCredentials(targetUri.GetPerUserTargetUri(realUsername), tempCredentials, null);
}
return await PersonalAccessTokenStore.WriteCredentials(targetUri, credentials);
}
Contrast this to our happy path, examined in some detail in my previous comment
(see heading "Entering Email in the Modal Window"), in which I use the modal
window to enter my credentials. In that case, by the time SetCredentials()
is
first called from InteractiveLogon()
:
targetUri
has the value "https://bitbucket.org/"
.if
condition evaluates to true
.SetCredentials()
recurses, passing down a copy of targetUri
with the
username injected into it: "https://my_bitbucket_username@bitbucket.org/"
.SetCredentials()
calls WriteCredentials()
with this new copy of
targetUri
.SetCredentials()
completes by calling
WriteCredentials()
with the original targetUri
.git:https://bitbucket.org
.$ cmdkey.exe /list
Currently stored credentials:
* NONE *
$ git clone https://my_bitbucket_username@bitbucket.org/myorganization/myrepo.git
Cloning into 'myrepo'...
13:59:01.277874 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
13:59:01.329735 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
13:59:01.334723 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
13:59:01.338712 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
13:59:01.340711 ...\Common.cs:312 trace: [EnableTraceLogging] GCM arguments:
protocol=https
host=bitbucket.org
path=
13:59:01.375614 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username@bitbucket.org/'.
13:59:01.870290 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
13:59:01.870290 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username@bitbucket.org/' is Bitbucket.
13:59:01.875278 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://my_bitbucket_username@bitbucket.org/'.
13:59:01.877272 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
Logon failed, use ctrl+c to cancel basic credential prompt.
Password for 'https://my_bitbucket_username@bitbucket.org':
13:59:28.263651 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
13:59:28.330778 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
13:59:28.336736 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
13:59:28.339728 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
13:59:28.341749 ...\Common.cs:312 trace: [EnableTraceLogging] GCM arguments:
protocol=https
host=bitbucket.org
path=
username=my_bitbucket_username
password=mypassword
13:59:28.363690 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username@bitbucket.org/'.
13:59:28.765037 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
13:59:28.766040 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username@bitbucket.org/' is Bitbucket.
13:59:28.766040 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my_bitbucket_username@bitbucket.org/'.
13:59:39.966057 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username at https://my_bitbucket_username@bitbucket.org/
14:16:11.711244 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username@bitbucket.org' written to store.
remote: Counting objects: 29, done.
remote: Total 29 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (29/29), done.
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://my_bitbucket_username@bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
$ cmdkey.exe /list
Currently stored credentials:
* NONE *
$Ξ»git clone https://bitbucket.org/myorganization/myrepo.git
Cloning into 'myrepo'...
14:26:07.458314 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'get'
14:26:07.512149 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:26:07.519130 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:26:07.522122 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:26:07.523120 ...\Common.cs:312 trace: [EnableTraceLogging] GCM arguments:
protocol=https
host=bitbucket.org
path=
14:26:07.558026 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://bitbucket.org/'.
14:26:08.019082 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:26:08.020053 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://bitbucket.org/' is Bitbucket.
14:26:08.026037 ...\Common.cs:642 trace: [LogEvent] Failed to retrieve Bitbucket credentials for 'https://bitbucket.org/'.
14:26:08.027033 ...\Program.cs:415 trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://bitbucket.org': my_bitbucket_username
Password for 'https://my_bitbucket_username@bitbucket.org':
14:26:41.040692 ...\Common.cs:677 trace: [Main] git-credential-manager (v1.17.1) 'store'
14:26:41.114494 ...\Git\Where.cs:361 trace: [FindGitInstallations] found 1 Git installation(s).
14:26:41.120478 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 50 entries.
14:26:41.122473 ...\Common.cs:446 trace: [LoadOperationArguments] interactive = 'never'.
14:26:41.124468 ...\Common.cs:312 trace: [EnableTraceLogging] GCM arguments:
protocol=https
host=bitbucket.org
path=
username=my_bitbucket_username
password=mypassword
14:26:41.148426 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://my_bitbucket_username@bitbucket.org/'.
14:26:41.551832 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
14:26:41.552808 ...\Common.cs:174 trace: [CreateAuthentication] authority for 'https://my_bitbucket_username@bitbucket.org/' is Bitbucket.
14:26:41.552808 ...\Program.cs:518 trace: [Store] storing Bitbucket credentials for 'https://my_bitbucket_username@bitbucket.org/'.
14:26:46.107459 ...uthentication.cs:258 trace: [SetCredentials] my_bitbucket_username at https://my_bitbucket_username@bitbucket.org/
14:27:15.300154 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://my_bitbucket_username@bitbucket.org' written to store.
remote: Counting objects: 29, done.
remote: Total 29 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (29/29), done.
$ cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://my_bitbucket_username@bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
In both cases, by the time we get to
SetCredentials()
,targetUri
contains"my_bitbucket_username"
.
A natural question to ask is:
"Why is initial value of the targetUri
parameter of SetCredentials()
"https://my_bitbucket_username@bitbucket.org/"
when I enter my creds in the textual
prompt, but "https://bitbucket.org/"
when I enter the exact same creds in the
modal window prompt?"
Some digging revealed that the username is injected into the URI here:
// Username.
if (!string.IsNullOrWhiteSpace(_username))
{
var username = NeedsToBeEscaped(_username)
? Uri.EscapeDataString(_username)
: _username;
buffer.Append(username)
.Append('@');
}
This particular line of this method (OperationArguments.CreateTargetUri()
, called by
OperationArguments.ReadInput()
, called by Program.Store()
) is run after
I input my credentials in the text prompt, and is not run at all when the
modal window prompt is used.
Since this code is in a common part of the code base, and particularly since
GitHub authentication doesn't seem to have any problem with it (see Test 3 of
this previous comment), I suspect this code is doing what is intended, and that
the problem does indeed lie in the behavior of either or both of
SetCredentials()
and GetCredentials()
in
Atlassian.Bitbucket.Authentication.Authentication
.
I'm intending to look into this next week.
Hi, so no fixes yet but I've been doing some research to confirm my understanding.
Briefly, these are my results:
Authentication | Credential.Interactive | Url | Authentication Prompts when cloning twice | WCM credentials | |
---|---|---|---|---|---|
2fa | interactive | https://user@bitbucket.org/... | 1 | 2: git:https://user@bitbucket.org access_token + refresh_token | |
2fa | interactive | https://bitbucket.org/... | 1 | 4: git:https://user@bitbucket.org access_token + refresh_token, git:https://bitbucket.org access_token + refresh_token | |
Basic | interactive | https://user@bitbucket.org/... | 1 | 1: git:https://user@bitbucket.org password | |
Basic | interactive | https://bitbucket.org/... | 1 | 2: git:https://user@bitbucket.org password, git:https://bitbucket.org password | |
Basic | never | https://user@bitbucket.org/... | 1 | 1: git:https://user@bitbucket.org password | |
*** | Basic | never | https://bitbucket.org/... | 2 | 1: git:https://user@bitbucket.org password |
All the behaviours worked as expected except the last one in the list, it prompted for credentials everytime you clone, I believe because it has not created the per host git:https://bitbucket.org entry in WCM so the GCM can't find the credentials when it next looks for it.
I want to double check behaviour using www.bitbucket.org but I think that is the one inconsistency/error.
Which seems to tally with the more in-depth research provided in all the comments above.
OK, a bit more research, a surprise or 2 for me.
I had assumed, incorrectly, that when the GUI is off , i.e. interactive=never, the command line username/password prompt would come from GCMW, but it doesn't it is Git itself doing the prompt.
Hence the GCMW GET fails -> GCMW GET fails -> Git command line prompt -> GCMW Store process seen in the logs when using interactive=never for Bitbucket urls.
The problem comes because the GCMW Store call from Git is passing in a user specific URL e.g. https://user@bitbucket.org/. It does this regardless of the original remote URL, https://bitbucket.org or https://user@bitbucket.org/, it picks up the username from the username/password prompt it runs.
So when using with interactive=never with a clean Windows Credential Manager:
A call like git clone https://bitbucket.org/blah/blah.git results in a call to the GCMW using:
protocol=https host=bitbucket.org path= interactive=Never
The GCMW will construct the following URL, https://bitbucket.org and look for credentials using that key. It can't find them and can't show a login prompt, GUI or otherwise, so instead it shows:
Logon failed, use ctrl+c to cancel basic credential prompt.
Git appears to trigger this twice.
Since the GCMW did not return any credentials, Git will then prompt with:
Username for 'https://bitbucket.org/': username Password for 'https://username@bitbucket.org/':
Assuming you provide good credentials, Git then calls the GCMW with:
protocol=https host=bitbucket.org path= username=testoneitofinity password=password interactive=Never
The GCMW then creates the URL https://username@bitbucket.org and stores the credentials against it.
In principle for GitHub and VSTS this doesn't matter because GCMW will strip away the username and store credentials against https://github.com or https://mminns.visualstudio.com etc.
For Bitbucket, because we support per-user credentials, they get stored against https://user@bitbucket.org/.
The problem then arises because the next time a pull/push etc command is run against https://bitbucket.org/blah/blah.git Git again calls GCMW GET with the following parameters:
protocol=https host=bitbucket.org path= interactive=Never
The GCMW will again construct the following URL, https://bitbucket.org and look for credentials using that key, but the only credentials we have stored are for https://user@bitbucket.org so the whole process starts again.
Apologies if this was duplicating information in earlier posts
Conclusions
This problem only occurs when the interactive=never and a repository URL that does not include a username.
The problem arises because the STORE method essentially just trusts the information passed to it by Git because each call to GCMW is atomic and we have no concept of what might have happened before it has to. In interactive=never mode STORE is called with the same parameters by Git, regardless of whether the repository remote URL includes a username or not.
The problem does not arise when interactive!=never because storing credentials in WCM is all handled atomically during the GET call. GCMW and the Bitbucket code has the full context and can store credentials as per user and/or simple host based URLs.
Fixes?
I think the 3rd option above is the equivalent of modalprompt=false ?
Oddities
cc: @whoisj I've not yet tested all these behaviours with GitHub, I need to turn 2fa off on my account first, but I have tested this with VSTS and it doesn't seem to work either. Essentially using a username/password (not a PAT) and interactive=never GCMWwill not save credentials during the STORE call, that doesn't feel right?
Actually using the following configuration for Bitbucket URLs without usernames seems to work as expected:
git config --global credential.modalPrompt false git config --global --unset credential.interactive
so that GCMW is called with:
modalPrompt=false interactive=Auto
This makes GCMW handle the username/password command line input as part of the GET.
Which makes me wonder if the interactive=never and modalPrompt=false should be doing the same thing?
@mminns re: VSTS handling of Git's GET and STORE calls - the VSTS authentication handlers ignore the STORE calls because of the difficulties with 1:1 mapping; I do not remember what the GitHub variant does.
Re: interactive=never and modalPrompt=false cases, the same authentication and authority types should used, just the interface presented (or not presented in this case) should differ. In the case of VSTS, we have no way to authenticate without the modal dialog, so we just fail. In the case of GitHub they used the console flow I authored like 2 years ago. In fact, I Bitbucket may use the same interface functions.
Which makes me wonder if the interactive=never and modalPrompt=false should be doing the same thing?
I agree, they should be.
Re: interactive=never and modalPrompt=false cases, the same authentication and authority types should used
That is what I am seeing and what I'd expect.
So ultimately I think the actual change coming out of this discussion will be to update Bitbucket flow so interactive=never has the same outcome as modalPrompt=false i.e. to run a non-modal console flow for GET calls.
I will make a start and put a PR when its ready.
@whoisj Once again I'm probably missing something obvious, but can you assign this to me?
Thanks
@whoisj Once again I'm probably missing something obvious, but can you assign this to me?
Apparently, I cannot. π
I'm actually having second thoughts about making interactive=never and modalPrompt=false do the same thing.
Logically interactive=never seems to imply never ever show a prompt where as modalPrompt=false implies if you are going to prompt the user then do it via the command line.
Personally I have no use case for interactive=never but I wouldn't be surprised if there is one out there somewhere. I'm not sure it is the right thing to do to effectively just remove it.
That being the case @mesbahamin does setting interactive=never (actually the default anyway) and modalPrompt=false solve your problem?
It should give a command line only prompt for credentials when they don't exist, but when entered they will be correctly stored for the next call, so the user/CI is only ever prompted once.
Personally I have no use case for interactive=never but I wouldn't be surprised if there is one out there somewhere. I'm not sure it is the right thing to do to effectively just remove it.
One word: automation. π No, seriously that is what it is for. If a user is in a setup where an interactive prompt would effectively create a deadlock scenario (because there's no human to answer it), they should be using credential.interactive=never
.
interactive=never (actually the default anyway)
The default should be Auto, if it is not then we have a bug.
The default should be Auto, if it is not then we have a bug
Sorry you are 100% correct. π
But I think my, re-phrased and corrected, question still stands:
That being the case @mesbahamin does setting interactive=Auto and modalPrompt=false solve your problem?
If so then I don't think there is anything to do here.
@mminns I will test today and report back.
Maybe this info can help somebody. I had annoying problem using Git with Atlassian SourceTree. I had to re-enter bitbucket credentials again and again. Then I replaced default installation of Git Credentials Manager with compiled debug version and encountered timeouts every time cred manager tried to validate credentials from UI. Here is the rough stack trace of situation:
Network.HttpGetAsync() // this one timed out
Atlassian.Bitbucket.Authentication.Rest.TryGetUser()
Atlassian.Bitbucket.Authentication.Authority.ValidateCredentials() // this was called twice - thus 2 dialogs
Microsoft.Alm.Cli.CommonFunctions.QueryCredentials()
Tried changing default timeout value from 15 seconds to 30 - no luck.
@mminns, interactive = Auto
and modalPrompt = false
works as desired. I am
prompted once, and then never again. After that initial prompt, I have these
credentials:
C:\dev
Ξ» cmdkey.exe /list
Currently stored credentials:
Target: LegacyGeneric:target=git:https://bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
Target: LegacyGeneric:target=git:https://my_bitbucket_username@bitbucket.org
Type: Generic
User: my_bitbucket_username
Local machine persistence
@whoisj said:
If a user is in a setup where an interactive prompt would effectively create a deadlock scenario (because there's no human to answer it), they should be using credential.interactive=never.
Indeed, the original reason I was using interactive = never
was because build
agents were silently deadlocking with a prompt for credentials. I read the
documentation for this project, which recommended use of interactive = never
in such a scenario.
So I'm still wondering what I should be doing in this situation. It seems to me that either the behavior of GCM needs to change or the documentation needs to change. I'm not clear which.
From a personal point of view I don't think the documentation is explicitly wrong, it just needs expanding to explain some more of the nuances.
Yes I agree. Perhaps it could say something about needing to get the necessary credentials stored in Windows credential cache before turning on interactive = never
. Does that seem reasonable? If so, maybe I can submit a PR.
And can we safely conclude that GCM is behaving as it should? I'm still not certain about that, so I would like to hear your thoughts. Are there any lingering questions or uncertainties?
I didn't look into what @PaulDotNet brought up. Is that connected to this?
I don't think @PaulDotNet 's issue is directly related. Perhaps you could raise a separate issue Paul?
I think the GCM is behaving as intended, i.e.
I agree it a bit ambiguous but I'd personally be loathe to change any of the existing behaviours until there was a compelling use case showing they were wrong.
Indeed, the original reason I was using interactive = never was because build agents were silently deadlocking with a prompt for credentials. I read the documentation for this project, which recommended use of interactive = never in such a scenario.
I highly recommend not relying on a credential manager for automation situations. Instead, I recommend using SSH or HTTPS with the -c "http.extraHeader=Authorization: BASIC {base64encoded("{username}:{passwrord}")}"
Summary
Details
Context
Steps
Credential manager shows no credentials related to bitbucket:
I set up logging and clone my repo:
I had to enter my credentials 3 times. Here's what Windows Credential Manager was storing after I entered them the first time:
The output was the same after the second time. Here's what it was after the third time:
Even with these credentials stored in Windows Credential Manager, I had to enter them again 3 times when I re-cloned the same repository:
Logs
First clone
Second clone