git-ecosystem / git-credential-manager

Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
Other
6.88k stars 1.81k forks source link

Flaky behavior with WSL and standalone installation #791

Closed myandrienko closed 3 weeks ago

myandrienko commented 2 years ago

Which version of GCM are you using?

Git Credential Manager version 2.0.785 (Windows)

I'm using a standalone installation of GCM on Windows, which is invoked by git in WSL.

Which Git host provider are you trying to connect to?

GitHub

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

The behavior is flaky. Sometimes the operation fails with the following error message: fatal: Failed to enumerate all Git configuration entries [1]. Sometimes I see the error message but authentication still happens successfully. Sometimes I get no error message at all.

Logs

Example logs when authentication fails:

04:18:35.591064 git.c:439               trace: built-in: git clone https://github.com/myandrienko/***.git
Cloning into 'telesoyuz'...
04:18:35.605606 run-command.c:663       trace: run_command: git-remote-https origin https://github.com/myandrienko/***.git
04:18:35.930138 run-command.c:663       trace: run_command: '/mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager-core.exe get'
04:18:36.203753 ...\Application.cs:95   trace: [RunInternalAsync] Version: 2.0.785.29792
04:18:36.203753 ...\Application.cs:96   trace: [RunInternalAsync] Runtime: .NET Framework 4.0.30319.42000
04:18:36.203753 ...\Application.cs:97   trace: [RunInternalAsync] Platform: Windows (x86-64)
04:18:36.203753 ...\Application.cs:98   trace: [RunInternalAsync] OSVersion: 10.0 (build 22000)
04:18:36.203753 ...\Application.cs:99   trace: [RunInternalAsync] AppPath: C:\Program Files (x86)\Git Credential Manager\git-credential-manager-core.exe
04:18:36.203753 ...\Application.cs:100  trace: [RunInternalAsync] Arguments: get
04:18:36.258171 ...GitCommandBase.cs:33 trace: [ExecuteAsync] Start 'get' command...
04:18:36.267815 ...GitCommandBase.cs:47 trace: [ExecuteAsync] Detecting host provider for input:
04:18:36.279775 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   protocol=https
04:18:36.279775 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   host=github.com
04:18:36.475497 ...viderRegistry.cs:149 trace: [GetProviderAsync] Performing auto-detection of host provider.
04:18:36.569152 ...viderRegistry.cs:162 trace: [GetProviderAsync] Auto-detect probe timeout is 2 ms.
04:18:36.571152 ...viderRegistry.cs:170 trace: [GetProviderAsync] Checking against 4 host providers registered with priority 'Normal'.
04:18:36.572151 ...GitCommandBase.cs:50 trace: [ExecuteAsync] Host provider 'GitHub' was selected.
04:18:36.575266 ...\HostProvider.cs:126 trace: [GetCredentialAsync] Looking for existing credential in store with service=https://github.com account=...
04:18:36.627648 ...Configuration.cs:143 trace: [Enumerate] Failed to enumerate config entries (exit=1, level=All)
fatal: Failed to enumerate all Git configuration entries [1]

   at GitCredentialManager.GitProcess.CreateGitException(Process git, String message)
   at GitCredentialManager.GitProcessConfiguration.Enumerate(GitConfigurationLevel level, GitConfigurationEnumerationCallback cb)
   at GitCredentialManager.GitConfigurationExtensions.Enumerate(IGitConfiguration config, GitConfigurationLevel level, String section, String property, GitConfigurationEnumerationCallback cb)
   at GitCredentialManager.GitConfigurationExtensions.Enumerate(IGitConfiguration config, String section, String property, GitConfigurationEnumerationCallback cb)
   at GitCredentialManager.Settings.<GetSettingValues>d__5.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at GitCredentialManager.Settings.TryGetSetting(String envarName, String section, String property, String& value)
   at GitCredentialManager.Settings.get_CredentialNamespace()
   at GitCredentialManager.CredentialStore.EnsureBackingStore()
   at GitCredentialManager.CredentialStore.Get(String service, String account)
   at GitCredentialManager.HostProvider.<GetCredentialAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitCredentialManager.Commands.GetCommand.<ExecuteInternalAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at GitCredentialManager.Commands.GitCommandBase.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.CommandHandler.<GetExitCodeAsync>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.<InvokeAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

Example logs when authentication succeeds, but an error message is still printed:

04:20:48.516784 git.c:439               trace: built-in: git clone https://github.com/myandrienko/***.git
Cloning into 'telesoyuz'...
04:20:48.530854 run-command.c:663       trace: run_command: git-remote-https origin https://github.com/myandrienko/***.git
04:20:48.847545 run-command.c:663       trace: run_command: '/mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager-core.exe get'
04:20:49.191221 ...\Application.cs:95   trace: [RunInternalAsync] Version: 2.0.785.29792
04:20:49.191221 ...\Application.cs:96   trace: [RunInternalAsync] Runtime: .NET Framework 4.0.30319.42000
04:20:49.191221 ...\Application.cs:97   trace: [RunInternalAsync] Platform: Windows (x86-64)
04:20:49.191221 ...\Application.cs:98   trace: [RunInternalAsync] OSVersion: 10.0 (build 22000)
04:20:49.191221 ...\Application.cs:99   trace: [RunInternalAsync] AppPath: C:\Program Files (x86)\Git Credential Manager\git-credential-manager-core.exe
04:20:49.191221 ...\Application.cs:100  trace: [RunInternalAsync] Arguments: get
04:20:49.241676 ...GitCommandBase.cs:33 trace: [ExecuteAsync] Start 'get' command...
04:20:49.248045 ...GitCommandBase.cs:47 trace: [ExecuteAsync] Detecting host provider for input:
04:20:49.259921 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   protocol=https
04:20:49.259921 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   host=github.com
04:20:49.455113 ...viderRegistry.cs:149 trace: [GetProviderAsync] Performing auto-detection of host provider.
04:20:49.566217 ...viderRegistry.cs:162 trace: [GetProviderAsync] Auto-detect probe timeout is 2 ms.
04:20:49.568216 ...viderRegistry.cs:170 trace: [GetProviderAsync] Checking against 4 host providers registered with priority 'Normal'.
04:20:49.571216 ...GitCommandBase.cs:50 trace: [ExecuteAsync] Host provider 'GitHub' was selected.
04:20:49.582218 ...\HostProvider.cs:126 trace: [GetCredentialAsync] Looking for existing credential in store with service=https://github.com account=...
04:20:49.809927 ...\HostProvider.cs:140 trace: [GetCredentialAsync] Existing credential found.
04:20:49.810929 ...GitCommandBase.cs:54 trace: [ExecuteAsync] End 'get' command...
04:20:50.012276 run-command.c:663       trace: run_command: '/mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager-core.exe store'
04:20:50.268986 ...\Application.cs:95   trace: [RunInternalAsync] Version: 2.0.785.29792
04:20:50.269984 ...\Application.cs:96   trace: [RunInternalAsync] Runtime: .NET Framework 4.0.30319.42000
04:20:50.269984 ...\Application.cs:97   trace: [RunInternalAsync] Platform: Windows (x86-64)
04:20:50.269984 ...\Application.cs:98   trace: [RunInternalAsync] OSVersion: 10.0 (build 22000)
04:20:50.269984 ...\Application.cs:99   trace: [RunInternalAsync] AppPath: C:\Program Files (x86)\Git Credential Manager\git-credential-manager-core.exe
04:20:50.269984 ...\Application.cs:100  trace: [RunInternalAsync] Arguments: store
04:20:50.320983 ...GitCommandBase.cs:33 trace: [ExecuteAsync] Start 'store' command...
04:20:50.337982 ...GitCommandBase.cs:47 trace: [ExecuteAsync] Detecting host provider for input:
04:20:50.338947 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   protocol=https
04:20:50.338947 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   host=github.com
04:20:50.338947 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   username=myandrienko
04:20:50.338947 ...GitCommandBase.cs:48 trace: [ExecuteAsync]   password=********
04:20:50.536615 ...viderRegistry.cs:149 trace: [GetProviderAsync] Performing auto-detection of host provider.
04:20:50.584983 ...Configuration.cs:143 trace: [Enumerate] Failed to enumerate config entries (exit=1, level=All)
fatal: Failed to enumerate all Git configuration entries [1]

   at GitCredentialManager.GitProcess.CreateGitException(Process git, String message)
   at GitCredentialManager.GitProcessConfiguration.Enumerate(GitConfigurationLevel level, GitConfigurationEnumerationCallback cb)
   at GitCredentialManager.GitConfigurationExtensions.Enumerate(IGitConfiguration config, GitConfigurationLevel level, String section, String property, GitConfigurationEnumerationCallback cb)
   at GitCredentialManager.GitConfigurationExtensions.Enumerate(IGitConfiguration config, String section, String property, GitConfigurationEnumerationCallback cb)
   at GitCredentialManager.Settings.<GetSettingValues>d__5.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at GitCredentialManager.Settings.TryGetSetting(String envarName, String section, String property, String& value)
   at GitCredentialManager.Settings.get_AutoDetectProviderTimeout()
   at GitCredentialManager.HostProviderRegistry.<GetProviderAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GitCredentialManager.Commands.GitCommandBase.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.CommandHandler.<GetExitCodeAsync>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.<InvokeAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
04:20:50.613751 run-command.c:663       trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning https://github.com/myandrienko/telesoyuz.git/
04:20:50.614628 git.c:439               trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning https://github.com/myandrienko/telesoyuz.git/
remote: Enumerating objects: 93, done.
remote: Counting objects: 100% (93/93), done.
remote: Compressing objects: 100% (59/59), done.
04:20:50.845835 run-command.c:663       trace: run_command: git unpack-objects --pack_header=2,93
04:20:50.846742 git.c:439               trace: built-in: git unpack-objects --pack_header=2,93
remote: Total 93 (delta 29), reused 87 (delta 23), pack-reused 0
Unpacking objects: 100% (93/93), 23.04 KiB | 245.00 KiB/s, done.
04:20:50.941383 run-command.c:663       trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'
04:20:50.942144 git.c:439               trace: built-in: git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'

By the look of these logs it seems there's a race condition between a command actually executing and GCM trying to read config from git on the host (which doesn't exist).

ldennington commented 2 years ago

Unfortunately, we're having some trouble repro'ing this issue. I've set up my WSL environment on a PC without Git for Windows installed, and it works as expected each time I run a git operation that requires authentication. Our tentative plan right now is to move to a streaming model for reading Git output and add some extra tracing to get more visibility into what's going on with Git in this scenario.

ultram4rine commented 2 years ago

@ldennington can you try to follow steps from wsl with git-for-windows or wsl without git for windows? Because I have this issue with this two options. Also, OP have

standalone installation of GCM on Windows, which is invoked by git in WSL

and you

WSL environment on a PC without Git for Windows installed

ldennington commented 2 years ago

I have tried the below today already, and all work (or don't work in the case of the final scenario) as expected. These cover both the scenarios you mentioned in your above comment @ultram4rine.

ultram4rine commented 2 years ago

I have issues with git push only. Clone works fine, but I'm cloned only public repos.

ldennington commented 2 years ago

I was using clone because @myandrienko was also using clone in this issue. If you try cloning a private repo, I imagine you will see the error.

drGarbinsky commented 2 years ago

I am experiencing the same issue with fetch pull and push. It works one second and then a few seconds later it fails. And GCM appears to be asking me to sign in every time is does work.

ldennington commented 1 year ago

@myandrienko - can you run git config --list and paste in the output here?

drGarbinsky commented 1 year ago

user.name=DrGarbinsky user.email= credential.helper=/mnt/c/Program\ Files\ (x86)/Git\ Credential\ Manager/git-credential-manager.exe credential.interactive=true credential.guiprompt=true credential.https://dev.azure.com.usehttppath=true dev.azure.com=azure-repos core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.drgarbinsky.url=https://dev.azure.com/co/Proj/_git/graphql remote.drgarbinsky.fetch=+refs/heads/:refs/remotes/drgarbinsky/

ldennington commented 1 year ago

Can you run git-credential-manager diagnose and paste in the results?

drGarbinsky commented 1 year ago

Here you go:

/mnt/c/Program\ Files\ (x86)/Git\ Credential\ Manager/git-credential-manager.exe diagnose Running diagnostics...

[ OK ] Environment [ OK ] File system [ OK ] Networking [ OK ] Git [ OK ] Credential storage [ OK ] Microsoft authentication (AAD/MSA) [ OK ] GitHub API

Diagnostic summary: 7 passed, 0 skipped, 0 failed. Log files: \wsl.localhost\Ubuntu\home\me\repos\sa\sec-doc-chunker-func\gcm-diagnose.log

Caution: Log files may include sensitive information - redact before sharing.

---------------------log file------------------------------------------------------------------------

Diagnose log at 2023-03-09T20:20:42Z

AppPath: C:\Program Files (x86)\Git Credential Manager\git-credential-manager.exe InstallDir: C:\Program Files (x86)\Git Credential Manager\ Version: 2.0.886+ea93cb5158


Diagnostic: Environment Skipped: False Success: True Exception: None Log: OSType: Windows OSVersion: 10.0 (build 22622) Reading environment variables... OK Variables: Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Users\me\AppData\Local\Microsoft\WindowsApps;C:\Users\me\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\me\AppData\Local\GitHubDesktop\bin;C:\ProgramData\me\GitHubDesktop\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC USERDOMAIN=FE501 PROCESSOR_ARCHITECTURE=x86 ProgramW6432=C:\Program Files DriverData=C:\Windows\System32\Drivers\DriverData PUBLIC=C:\Users\Public APPDATA=C:\Users\me\AppData\Roaming windir=C:\WINDOWS LOCALAPPDATA=C:\Users\me\AppData\Local CommonProgramW6432=C:\Program Files\Common Files WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION:WT_SESSION:WT_SESSION:GET_EXEC_PATH/wp:WT_PROFILE_ID:GIT_EXEC_PATH/wp:GIT_EXEC_PATH/wp:WT_PROFILE_ID:GIT_EXEC_PATH/wp:WT_PROFILE_ID

OneDriveCommercial=C:\Users\me\OneDrive - Sales Advantage OneDrive=C:\Users\me\OneDrive - Sales Advantage USERPROFILE=C:\Users\me ProgramFiles=C:\Program Files (x86) PROCESSOR_LEVEL=6 CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files HOMEPATH=\Users\me COMPUTERNAME=FE501 PROCESSOR_ARCHITEW6432=AMD64 USERNAME=me NUMBER_OF_PROCESSORS=8 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 126 Stepping 5, GenuineIntel WT_PROFILE_ID={2c4de342-38b7-51cf-b940-2309a097f518} OneDriveConsumer=C:\Users\me\OneDrive ComSpec=C:\WINDOWS\system32\cmd.exe LOGONSERVER=\FE501 TEMP=C:\Users\me\AppData\Local\Temp ProgramFiles(x86)=C:\Program Files (x86) CommonProgramFiles=C:\Program Files (x86)\Common Files TMP=C:\Users\me\AppData\Local\Temp USERDOMAIN_ROAMINGPROFILE=FE501 PROCESSOR_REVISION=7e05 SystemRoot=C:\WINDOWS PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules ALLUSERSPROFILE=C:\ProgramData SystemDrive=C: OS=Windows_NT WT_SESSION=be5edc95-e499-450c-9a32-5891657add8c ProgramData=C:\ProgramData HOMEDRIVE=C:


Diagnostic: File system Skipped: False Success: True Exception: None Log: Temporary directory is 'C:\Users\me\AppData\Local\Temp\'... Checking basic file I/O... Writing to temporary file 'C:\Users\me\AppData\Local\Temp\0bf54cd3a0f13b77205d95e3'... OK Reading from temporary file 'C:\Users\me\AppData\Local\Temp\0bf54cd3a0f13b77205d95e3'... OK Deleting temporary file 'C:\Users\me\AppData\Local\Temp\0bf54cd3a0f13b77205d95e3'... OK Testing IFileSystem instance... UserHomePath: C:\Users\me UserDataDirectoryPath: C:\Users\me.gcm GetCurrentDirectory(): \wsl.localhost\Ubuntu\home\me\repos\sa\sec-doc-chunker-func


Diagnostic: Networking Skipped: False Success: True Exception: None Log: Checking networking and HTTP stack... Creating HTTP client... OK IsNetworkAvailable: True Sending HEAD request to http://example.com... OK Sending HEAD request to https://example.com... OK Acquiring free TCP port... OK Testing local HTTP loopback connections... Creating new HTTP listener for http://localhost:54554/... OK Waiting for loopback connection... OK Writing response... OK Waiting for response data... OK Loopback connection data OK


Diagnostic: Git Skipped: False Success: True Exception: None Log: Getting Git version... OK Git version is '2.38.1.windows.1' Locating current repository... OK Not inside a Git repository. Listing all Git configuration... OK Git configuration: file:C:/Program Files/Git/etc/gitconfig diff.astextplain.textconv=astextplain file:C:/Program Files/Git/etc/gitconfig filter.lfs.clean=git-lfs clean -- %f file:C:/Program Files/Git/etc/gitconfig filter.lfs.smudge=git-lfs smudge -- %f file:C:/Program Files/Git/etc/gitconfig filter.lfs.process=git-lfs filter-process file:C:/Program Files/Git/etc/gitconfig filter.lfs.required=true file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt file:C:/Program Files/Git/etc/gitconfig core.autocrlf=true file:C:/Program Files/Git/etc/gitconfig core.fscache=true file:C:/Program Files/Git/etc/gitconfig core.symlinks=false file:C:/Program Files/Git/etc/gitconfig pull.rebase=false file:C:/Program Files/Git/etc/gitconfig credential.helper=manager-core file:C:/Program Files/Git/etc/gitconfig credential.helper= file:C:/Program Files/Git/etc/gitconfig credential.helper=C:/Program\ Files\ (x86)/Git\ Credential\ Manager/git-credential-manager-core.exe file:C:/Program Files/Git/etc/gitconfig credential.helper= file:C:/Program Files/Git/etc/gitconfig credential.helper=C:/Program\ Files\ (x86)/Git\ Credential\ Manager/git-credential-manager.exe file:C:/Program Files/Git/etc/gitconfig credential.https://dev.azure.com.usehttppath=true file:C:/Program Files/Git/etc/gitconfig init.defaultbranch=master file:C:/Users/me/.gitconfig filter.lfs.clean=git-lfs clean -- %f file:C:/Users/me/.gitconfig filter.lfs.smudge=git-lfs smudge -- %f file:C:/Users/me/.gitconfig filter.lfs.process=git-lfs filter-process file:C:/Users/me/.gitconfig filter.lfs.required=true file:C:/Users/me/.gitconfig core.editor="C:\Users\me\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait file:C:/Users/me/.gitconfig user.email=drgarbinsky@gmail.com file:C:/Users/me/.gitconfig user.name=me


Diagnostic: Credential storage Skipped: False Success: True Exception: None Log: ICredentialStore instance is of type: CredentialStore Writing test credential... OK Reading test credential... OK Deleting test credential... OK


Diagnostic: Microsoft authentication (AAD/MSA) Skipped: False Success: True Exception: None Log: Broker not supported. Flow type is: Auto Gathering MSAL token cache data... OK CacheDirectory: C:\Users\me\AppData\Local.IdentityService CacheFileName: msal.cache CacheFilePath: C:\Users\me\AppData\Local.IdentityService\msal.cache Creating cache helper... OK Verifying MSAL token cache persistence... OK


Diagnostic: GitHub API Skipped: False Success: True Exception: None Log: Using 'https://github.com/' as API target. Querying '/meta' endpoint... OK

spaceisfun commented 1 year ago

Not sure if the exact issue, but commenting here in case I help someone out 😄

I see git-credential-manager (GCM 2.0.935) hang forever when attempting git fetch from Ubuntu 20.04 WSL2. In WSL I use credential.helper=/mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager.exe

I noticed in Windows the git config --null --list process spawned by git-credential-manager seemed to be hung.

When i terminated the process forcibly WSL showed the following warnings:

jafriedm@jdf-wfh:~/cc_uefi$ git fetch
fatal: Failed to enumerate all Git configuration entries [1]
warning: encountered old-style '//wsl.localhost/Ubuntu-20.04/home/jafriedm/arm_server_evens' that should be '%(prefix)///wsl.localhost/Ubuntu-20.04/home/jafriedm/arm_server_evens'

... (and many more like above)

Removing those entries from my Windows git config with git config --global --unset-all safe.directory resolved my issue, and git fetch now succeeds.

mjcheetham commented 3 weeks ago

Closing as this no longer reproduces on the latest versions of GCM and Git for Windows. If you believe this issue still exists, please re-open with logs from the latest versions.