Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitbucket 2FA status check #128

Closed
nikolazlatkovic opened this issue Jun 8, 2020 · 2 comments
Closed

Bitbucket 2FA status check #128

nikolazlatkovic opened this issue Jun 8, 2020 · 2 comments
Labels
bug A bug in Git Credential Manager host:bitbucket Specific to the Bitbucket host provider

Comments

@nikolazlatkovic
Copy link

Which version of GCM Core are you using?

2.0.157-beta+b11949c7a5 (macOS, .NET Core 3.1.4)

Which Git host provider are you trying to connect to?

  • Bitbucket

Can you access the remote repository directly in the browser using the remote URL?

  • Yes

Expected behavior

I am authenticated and my Git operation completes successfully.

Actual behavior

I was getting following:

fatal: Error converting value {null} to type 'System.Boolean'. Path 'has_2fa_enabled', line 1, position 95.
fatal: Null object cannot be converted to a value type.

followed by password prompt:
Password for 'https://***********@bitbucket.org':

instead of being authenticated automatically.

After that, I have set up 2FA for that account, repeated the git pull command, was redirected to browser to perform (two-factor) authentication and authorization, and after that all commands were automatically authenticated.

Git remote format is: https://********@bitbucket.org/*******/*******.git

Logs

$ GIT_TRACE=1 GCM_TRACE=1 git pull
13:19:54.307187 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/bin/git
13:19:54.307700 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/bin
13:19:54.308246 git.c:419               trace: built-in: git pull
13:19:54.308710 run-command.c:643       trace: run_command: git fetch --update-head-ok
13:19:54.310936 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git
13:19:54.311468 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:19:54.311945 git.c:419               trace: built-in: git fetch --update-head-ok
13:19:54.313162 run-command.c:643       trace: run_command: GIT_DIR=.git git-remote-https origin https://***********@bitbucket.org/********/*********.git
13:19:54.317497 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git-remote-https
13:19:54.318081 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:19:55.250236 run-command.c:643       trace: run_command: 'git credential-manager-core get'
13:19:55.257549 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git
13:19:55.258226 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:19:55.258785 git.c:670               trace: exec: git-credential-manager-core get
13:19:55.258813 run-command.c:643       trace: run_command: git-credential-manager-core get
13:19:55.341929 ...er/Application.cs:69 trace: [RunInternalAsync] Git Credential Manager version 2.0.157-beta+b11949c7a5 (macOS, .NET Core 3.1.4) 'get'
13:19:55.352523 ...mmands/Command.cs:63 trace: [ExecuteAsync] Start 'get' command...
13:19:55.375781 ...mmands/Command.cs:74 trace: [ExecuteAsync] Detecting host provider for input:
13:19:55.377353 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	protocol=https
13:19:55.377399 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	host=bitbucket.org
13:19:55.377408 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	username=***********
13:19:55.381046 ...nterop/LibGit2.cs:30 trace: [GetConfiguration] Opening default Git configuration...
13:19:55.381579 ...nterop/LibGit2.cs:46 trace: [GetConfiguration] Adding local configuration from repository '/***********/.git/'...
13:19:55.382303 ...terop/LibGit2.cs:111 trace: [.ctor] Creating Git configuration snapshot...
13:19:55.382678 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:19:55.383643 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:19:55.384839 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'credential.provider'...
13:19:55.385517 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:19:55.385711 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:19:55.385763 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:19:55.385788 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'credential.authority'...
13:19:55.385802 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:19:55.385810 ...viderRegistry.cs:129 trace: [GetProvider] Performing auto-detection of host provider.
13:19:55.386649 ...mmands/Command.cs:77 trace: [ExecuteAsync] Host provider 'Bitbucket' was selected.
13:19:55.389784 ...etHostProvider.cs:68 trace: [GetCredentialAsync] Checking for refresh token with key 'git:https://***********@bitbucket.org/refresh_token'...
13:19:55.411697 ...etHostProvider.cs:78 trace: [GetCredentialAsync] Checking for credentials with key 'git:https://***********@bitbucket.org'...
13:19:55.422344 ...etHostProvider.cs:95 trace: [GetCredentialAsync] Checking if two-factor requirements for stored credentials...
13:19:55.433406 ...tbucketRestApi.cs:74 trace: [GetUserInformationAsync] HTTP: GET https://api.bitbucket.org/2.0/user
13:19:55.434828 ...pClientFactory.cs:53 trace: [CreateClient] Creating new HTTP client instance...
13:19:55.436256 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:19:55.436393 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:19:55.436418 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'credential.httpsProxy'...
13:19:55.436461 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:19:55.436479 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:19:55.436539 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:19:55.436553 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'credential.httpProxy'...
13:19:55.436569 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:19:55.436586 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:19:55.436634 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:19:55.436647 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'http.proxy'...
13:19:55.436662 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:19:55.438092 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:19:55.438212 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:19:55.438268 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'http.sslVerify'...
13:19:55.438303 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:19:56.513255 ...tbucketRestApi.cs:77 trace: [GetUserInformationAsync] HTTP: Response 200 [OK]
fatal: Error converting value {null} to type 'System.Boolean'. Path 'has_2fa_enabled', line 1, position 95.
fatal: Null object cannot be converted to a value type.
Password for 'https://***********@bitbucket.org':
13:20:02.439071 run-command.c:643       trace: run_command: 'git credential-manager-core store'
13:20:02.446180 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git
13:20:02.446747 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:20:02.447161 git.c:670               trace: exec: git-credential-manager-core store
13:20:02.447182 run-command.c:643       trace: run_command: git-credential-manager-core store
13:20:02.536651 ...er/Application.cs:69 trace: [RunInternalAsync] Git Credential Manager version 2.0.157-beta+b11949c7a5 (macOS, .NET Core 3.1.4) 'store'
13:20:02.549673 ...mmands/Command.cs:63 trace: [ExecuteAsync] Start 'store' command...
13:20:02.569950 ...mmands/Command.cs:74 trace: [ExecuteAsync] Detecting host provider for input:
13:20:02.571532 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	protocol=https
13:20:02.571579 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	host=bitbucket.org
13:20:02.571587 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	username=***********
13:20:02.571609 ...mmands/Command.cs:75 trace: [ExecuteAsync] 	password=********
13:20:02.575107 ...nterop/LibGit2.cs:30 trace: [GetConfiguration] Opening default Git configuration...
13:20:02.575680 ...nterop/LibGit2.cs:46 trace: [GetConfiguration] Adding local configuration from repository '/***********/.git/'...
13:20:02.576407 ...terop/LibGit2.cs:111 trace: [.ctor] Creating Git configuration snapshot...
13:20:02.576729 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:20:02.577765 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:20:02.579092 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'credential.provider'...
13:20:02.579774 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:20:02.579981 ...terop/LibGit2.cs:139 trace: [Enumerate] Enumerating Git configuration entries...
13:20:02.580036 ...terop/LibGit2.cs:146 trace: [Enumerate] Enumeration complete.
13:20:02.580063 ...terop/LibGit2.cs:199 trace: [TryGetValue] Reading Git configuration entry 'credential.authority'...
13:20:02.580084 ...terop/LibGit2.cs:208 trace: [TryGetValue] No entry found.
13:20:02.580098 ...viderRegistry.cs:129 trace: [GetProvider] Performing auto-detection of host provider.
13:20:02.580969 ...mmands/Command.cs:77 trace: [ExecuteAsync] Host provider 'Bitbucket' was selected.
13:20:02.583322 ...tHostProvider.cs:182 trace: [StoreCredentialAsync] Storing credential with key 'git:https://***********@bitbucket.org'...
13:20:02.625270 ...tHostProvider.cs:184 trace: [StoreCredentialAsync] Credential was successfully stored.
13:20:02.625349 ...mmands/Command.cs:81 trace: [ExecuteAsync] End 'store' command...
13:20:02.631903 run-command.c:643       trace: run_command: git rev-list --objects --stdin --not --all --quiet
13:20:02.639686 run-command.c:643       trace: run_command: git rev-list --objects --stdin --not --all --quiet
13:20:02.641667 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git
13:20:02.642149 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:20:02.642593 git.c:419               trace: built-in: git rev-list --objects --stdin --not --all --quiet
13:20:02.647721 run-command.c:1577      run_processes_parallel: preparing to run up to 1 tasks
13:20:02.647741 run-command.c:1609      run_processes_parallel: done
13:20:02.647758 run-command.c:643       trace: run_command: git gc --auto
13:20:02.649905 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git
13:20:02.650421 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:20:02.650897 git.c:419               trace: built-in: git gc --auto
13:20:02.651931 run-command.c:643       trace: run_command: git merge FETCH_HEAD
13:20:02.654003 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git
13:20:02.654557 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
13:20:02.655036 git.c:419               trace: built-in: git merge FETCH_HEAD
Already up to date.
$ 
@mjcheetham mjcheetham added bug A bug in Git Credential Manager host:bitbucket Specific to the Bitbucket host provider labels Jun 8, 2020
@mjcheetham
Copy link
Collaborator

Hi @nikolazlatkovic thanks for reporting this issue! I believe we've already corrected this issue (#126) and it should be available in the next release. Watch this space 😃

@mjcheetham
Copy link
Collaborator

Fixed in release 2.0.164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in Git Credential Manager host:bitbucket Specific to the Bitbucket host provider
Projects
None yet
Development

No branches or pull requests

2 participants