Closed myandrienko closed 3 weeks 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.
@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
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.
git clone
with Git for Windows installed and credential.helper
in WSL set to /mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe
git clone
with just GCM installed and credential.helper
in WSL set to /mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager-core.exe
and the WSLENV
env var setgit clone
with just GCM installed and credential.helper
in WSL set to /mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager/git-credential-manager-core.exe
and the WSLENV
env var not set (which of course just results in an error finding the Git executable)I have issues with git push
only. Clone works fine, but I'm cloned only public repos.
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.
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.
@myandrienko - can you run git config --list
and paste in the output here?
user.name=DrGarbinsky
user.email=
Can you run git-credential-manager diagnose
and paste in the results?
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
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.
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.
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:
Example logs when authentication succeeds, but an error message is still printed:
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).