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

fatal: Object reference not set to an instance of an object. #1165

Closed
ThePlenkov opened this issue Mar 27, 2023 · 4 comments
Closed

fatal: Object reference not set to an instance of an object. #1165

ThePlenkov opened this issue Mar 27, 2023 · 4 comments
Labels
auth-issue An issue authenticating to a host

Comments

@ThePlenkov
Copy link

Version

2.0.973+784e7c794e

Operating system

Linux

OS version or distribution

Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Git hosting provider(s)

GitLab

Other hosting provider

No response

(Azure DevOps only) What format is your remote URL?

None

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

GCM should pick up credentials from the store.

Actual behavior

I still can input username and password and pull works - but it doesn't store the password.
I feel like may be the issue is more like with storing rather than with reading

Please review log

Logs

WSLENV=$WSLENV:GCM_TRACE:GIT_TRACE GCM_TRACE=1 GIT_TRACE=1 git fetch
16:23:53.964529 git.c:439 trace: built-in: git fetch
16:23:53.964959 run-command.c:655 trace: run_command: GIT_DIR=.git git remote-https origin https://gitlab.myorg.com/finsys/docker/devops-docker-xs-cli.git
16:23:53.967078 git.c:725 trace: exec: git-remote-https origin https://gitlab.myorg.com/finsys/docker/devops-docker-xs-cli.git
16:23:53.967156 run-command.c:655 trace: run_command: git-remote-https origin https://gitlab.myorg.com/finsys/docker/devops-docker-xs-cli.git
16:23:54.108945 run-command.c:655 trace: run_command: '/usr/local/bin/git-credential-manager get'
16:23:54.252600 git.c:439 trace: built-in: git version
16:23:54.285050 git.c:439 trace: built-in: git config --null trace2.eventtarget
16:23:54.286986 git.c:439 trace: built-in: git config --null trace2.normaltarget
16:23:54.288267 git.c:439 trace: built-in: git config --null trace2.perftarget
16:23:54.310013 git.c:439 trace: built-in: git config --null credential.httpProxy
16:23:54.311355 git.c:439 trace: built-in: git config --null http.proxy
16:23:54.329163 git.c:439 trace: built-in: git config --null http.sslBackend
16:23:54.331603 git.c:439 trace: built-in: git config --null http.sslBackend
16:23:54.333684 git.c:439 trace: built-in: git config --null http.sslVerify
16:23:54.336356 git.c:439 trace: built-in: git config --null --type=path http.sslCAInfo
16:23:54.361152 ...re/Application.cs:95 trace: [RunInternalAsync] Version: 2.0.973.20088
16:23:54.363488 ...re/Application.cs:96 trace: [RunInternalAsync] Runtime: .NET 6.0.13
16:23:54.363506 ...re/Application.cs:97 trace: [RunInternalAsync] Platform: Linux (x86-64)
16:23:54.363509 ...re/Application.cs:98 trace: [RunInternalAsync] OSVersion: Linux MYHOST 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
16:23:54.363516 ...re/Application.cs:99 trace: [RunInternalAsync] AppPath: /usr/local/bin/git-credential-manager
16:23:54.363560 ...e/Application.cs:100 trace: [RunInternalAsync] InstallDir: /usr/local/share/gcm-core/
16:23:54.363618 ...e/Application.cs:101 trace: [RunInternalAsync] Arguments: get
16:23:54.408996 ...GitCommandBase.cs:33 trace: [ExecuteAsync] Start 'get' command...
16:23:54.422325 ...GitCommandBase.cs:47 trace: [ExecuteAsync] Detecting host provider for input:
16:23:54.422402 ...GitCommandBase.cs:48 trace: [ExecuteAsync] protocol=https
16:23:54.422408 ...GitCommandBase.cs:48 trace: [ExecuteAsync] host=gitlab.myorg.com
16:23:54.426211 git.c:439 trace: built-in: git config --null --list
16:23:54.429978 ...oviderRegistry.cs:99 trace: [GetProviderAsync] Host provider override was set id='gitlab'
16:23:54.431817 ...GitCommandBase.cs:50 trace: [ExecuteAsync] Host provider 'GitLab' was selected.
16:23:54.436621 git.c:439 trace: built-in: git config --null --list
16:23:54.440664 git.c:439 trace: built-in: git config --null credential.namespace
16:23:54.442109 git.c:439 trace: built-in: git config --null --list
16:23:54.443429 git.c:439 trace: built-in: git config --null credential.credentialStore
16:23:54.599425 ...edentialStore.cs:357 trace: [GetGpgPath] Using PATH-located GPG (gpg) executable: /usr/bin/gpg
16:23:54.614937 git.c:439 trace: built-in: git config --null --list
16:23:54.621340 ...bHostProvider.cs:128 trace: [GetSupportedAuthenticationModes] Supported authentication modes override present: Browser
fatal: Object reference not set to an instance of an object.
at GitCredentialManager.WslUtils.GetWslVersion(IEnvironment env, IFileSystem fs)
at GitCredentialManager.WslUtils.IsWslDistribution(IEnvironment env, IFileSystem fs, Int32& wslVersion)
at GitCredentialManager.Interop.Linux.LinuxSessionManager.GetWebBrowserAvailable()
at GitCredentialManager.Interop.Linux.LinuxSessionManager.get_IsWebBrowserAvailable()
at GitLab.GitLabAuthentication.GetAuthenticationAsync(Uri targetUri, String userName, AuthenticationModes modes)
at GitLab.GitLabHostProvider.GenerateCredentialAsync(InputArguments input)
at GitLab.GitLabHostProvider.GetCredentialAsync(InputArguments input)
at GitCredentialManager.Commands.GetCommand.ExecuteInternalAsync(InputArguments input, IHostProvider provider)
at GitCredentialManager.Commands.GitCommandBase.ExecuteAsync()
at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<b__0>d.MoveNext()
16:23:54.647809 run-command.c:655 trace: run_command: /home/myuser/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/extensions/git/dist/askpass.sh 'Username for '''https://gitlab.myorg.com'\'': '
16:24:01.779434 run-command.c:655 trace: run_command: /home/myuser/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/extensions/git/dist/askpass.sh 'Password for '''https://myuser@gitlab.myorg.com'\'': '
16:24:08.260110 run-command.c:655 trace: run_command: '/usr/local/bin/git-credential-manager store'
16:24:08.411926 git.c:439 trace: built-in: git version
16:24:08.443846 git.c:439 trace: built-in: git config --null trace2.eventtarget
16:24:08.445326 git.c:439 trace: built-in: git config --null trace2.normaltarget
16:24:08.446627 git.c:439 trace: built-in: git config --null trace2.perftarget
16:24:08.464733 git.c:439 trace: built-in: git config --null credential.httpProxy
16:24:08.466115 git.c:439 trace: built-in: git config --null http.proxy
16:24:08.484723 git.c:439 trace: built-in: git config --null http.sslBackend
16:24:08.487025 git.c:439 trace: built-in: git config --null http.sslBackend
16:24:08.488666 git.c:439 trace: built-in: git config --null http.sslVerify
16:24:08.490706 git.c:439 trace: built-in: git config --null --type=path http.sslCAInfo
16:24:08.514248 ...re/Application.cs:95 trace: [RunInternalAsync] Version: 2.0.973.20088
16:24:08.516172 ...re/Application.cs:96 trace: [RunInternalAsync] Runtime: .NET 6.0.13
16:24:08.516189 ...re/Application.cs:97 trace: [RunInternalAsync] Platform: Linux (x86-64)
16:24:08.516192 ...re/Application.cs:98 trace: [RunInternalAsync] OSVersion: Linux MYHOST 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
16:24:08.516199 ...re/Application.cs:99 trace: [RunInternalAsync] AppPath: /usr/local/bin/git-credential-manager
16:24:08.516261 ...e/Application.cs:100 trace: [RunInternalAsync] InstallDir: /usr/local/share/gcm-core/
16:24:08.516295 ...e/Application.cs:101 trace: [RunInternalAsync] Arguments: store
16:24:08.556549 ...GitCommandBase.cs:33 trace: [ExecuteAsync] Start 'store' command...
16:24:08.564766 ...GitCommandBase.cs:47 trace: [ExecuteAsync] Detecting host provider for input:
16:24:08.564837 ...GitCommandBase.cs:48 trace: [ExecuteAsync] protocol=https
16:24:08.564842 ...GitCommandBase.cs:48 trace: [ExecuteAsync] host=gitlab.myorg.com
16:24:08.564844 ...GitCommandBase.cs:48 trace: [ExecuteAsync] username=myuser
16:24:08.564846 ...GitCommandBase.cs:48 trace: [ExecuteAsync] password=********
16:24:08.568985 git.c:439 trace: built-in: git config --null --list
16:24:08.572034 ...oviderRegistry.cs:99 trace: [GetProviderAsync] Host provider override was set id='gitlab'
16:24:08.573830 ...GitCommandBase.cs:50 trace: [ExecuteAsync] Host provider 'GitLab' was selected.
16:24:08.574182 .../HostProvider.cs:160 trace: [StoreCredentialAsync] Storing credential with service=https://gitlab.myorg.com account=myuser...
16:24:08.576950 git.c:439 trace: built-in: git config --null --list
16:24:08.579488 git.c:439 trace: built-in: git config --null credential.namespace
16:24:08.581358 git.c:439 trace: built-in: git config --null --list
16:24:08.583064 git.c:439 trace: built-in: git config --null credential.credentialStore
16:24:08.702952 ...edentialStore.cs:357 trace: [GetGpgPath] Using PATH-located GPG (gpg) executable: /usr/bin/gpg
fatal: StandardIn has not been redirected.
at System.Diagnostics.Process.get_StandardInput()
at GitCredentialManager.ChildProcess.get_StandardInput()
at GitCredentialManager.Gpg.EncryptFile(String path, String gpgId, String contents)
at GitCredentialManager.Interop.Posix.GpgPassCredentialStore.SerializeCredential(FileCredential credential)
at GitCredentialManager.PlaintextCredentialStore.AddOrUpdate(String service, String account, String secret)
at GitCredentialManager.CredentialStore.AddOrUpdate(String service, String account, String secret)
at GitCredentialManager.HostProvider.StoreCredentialAsync(InputArguments input)
at GitCredentialManager.Commands.StoreCommand.ExecuteInternalAsync(InputArguments input, IHostProvider provider)
at GitCredentialManager.Commands.GitCommandBase.ExecuteAsync()
at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<b__0>d.MoveNext()
16:24:09.193379 run-command.c:655 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs
16:24:09.205167 run-command.c:1523 run_processes_parallel: preparing to run up to 1 tasks
16:24:09.205283 run-command.c:1551 run_processes_parallel: done
16:24:09.205299 run-command.c:655 trace: run_command: git maintenance run --auto --no-quiet
16:24:09.208228 git.c:439 trace: built-in: git maintenance run --auto --no-quiet

@ThePlenkov ThePlenkov added the auth-issue An issue authenticating to a host label Mar 27, 2023
@ThePlenkov
Copy link
Author

Could be caused by #1148

ThePlenkov referenced this issue Mar 27, 2023
Add methods to the WslUtils class to enable detection of a WSL
distribution, and also determine which WSL version is being used.

Version 1 uses the Windows NT kernel and runs the distribution in the
same user-mode space as Windows programs.

Version 2 uses a light-weight VM to host a real Linux kernel, and runs
the distribution also inside the VM; interop with Windows is achieved
using other mechanisms.
ThePlenkov added a commit to ThePlenkov/git-credential-manager that referenced this issue Mar 27, 2023
@ldennington
Copy link
Contributor

Thank you for bringing this issue to our attention. We are working on a fix now and will merge by EOD (Pacific time).

@ldennington
Copy link
Contributor

Closing with the completion of #1167

@ThePlenkov
Copy link
Author

@ldennington thanks! Actually in this log there are two issues. The first one was fixed - the second one StandardIn has not been redirected still persists. It doesn't store pwd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth-issue An issue authenticating to a host
Projects
None yet
Development

No branches or pull requests

2 participants