microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.69k stars 299 forks source link

WSL git ls hang on Dev Containers: Clone Repository in Container Volume #9377

Open evanyu10 opened 10 months ago

evanyu10 commented 10 months ago
Logs
[74304 ms] Start: Run in host: test -f '/home/evanyu/.vscode-remote-containers/dist/vscode-remote-containers-server-0.327.0.js' [74304 ms] [74304 ms] [74306 ms] userEnvProbe: loginInteractiveShell (default) [74306 ms] userEnvProbe: not found in cache [74307 ms] userEnvProbe shell: /bin/bash [74356 ms] userEnvProbe PATHs: Probe: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/mnt/c/Program Files (x86)/Razer Chroma SDK/bin:/mnt/c/Program Files/Razer Chroma SDK/bin:/mnt/c/Program Files (x86)/Razer/ChromaBroadcast/bin:/mnt/c/Program Files/Razer/ChromaBroadcast/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Users/Owner/AppData/Local/Microsoft/WindowsApps:/mnt/c/Windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/Git/cmd:/Docker/host/bin:/mnt/c/Users/Owner/AppData/Local/Programs/Python/Python312/Scripts/:/mnt/c/Users/Owner/AppData/Local/Programs/Python/Python312/:/mnt/c/Users/Owner/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Owner/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin' Container: None [74400 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/evanyu/CHRLPortal' && /bin/sh [74415 ms] Start: Run in host: id -un [74510 ms] evanyu [74510 ms] [74511 ms] Start: Run in host: (command -v getent >/dev/null 2>&1 && getent passwd 'evanyu' || grep -E '^evanyu|^[^:]*:[^:]*:evanyu:' /etc/passwd || true) [74512 ms] Start: Run in host: echo ~ [74513 ms] /home/evanyu [74513 ms] [74514 ms] Start: Run in host: test -x '/home/evanyu/.vscode-remote-containers/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node' [74514 ms] [74514 ms] [74514 ms] Exit code 1 [74515 ms] Start: Run in host: test -x '/home/evanyu/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node' [74515 ms] [74515 ms] [74515 ms] Start: Run in host: test -f '/home/evanyu/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node_modules/node-pty/package.json' [74516 ms] [74516 ms] [74517 ms] Start: Run in host: test -f '/home/evanyu/.vscode-remote-containers/dist/vscode-remote-containers-server-0.327.0.js' [74517 ms] [74518 ms] [74518 ms] userEnvProbe: loginInteractiveShell (default) [74518 ms] userEnvProbe: not found in cache [74518 ms] userEnvProbe shell: /bin/bash [74570 ms] userEnvProbe PATHs: Probe: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/mnt/c/Program Files (x86)/Razer Chroma SDK/bin:/mnt/c/Program Files/Razer Chroma SDK/bin:/mnt/c/Program Files (x86)/Razer/ChromaBroadcast/bin:/mnt/c/Program Files/Razer/ChromaBroadcast/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Users/Owner/AppData/Local/Microsoft/WindowsApps:/mnt/c/Windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/Git/cmd:/Docker/host/bin:/mnt/c/Users/Owner/AppData/Local/Programs/Python/Python312/Scripts/:/mnt/c/Users/Owner/AppData/Local/Programs/Python/Python312/:/mnt/c/Users/Owner/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Owner/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin' Container: None [74609 ms] Start: Run in Host: docker version --format {{.Server.APIVersion}} [74652 ms] 1.43 [82522 ms] Start: Run in Host: git ls-remote https://github.com/mesachrl/CHRLPortal.git

Steps to Reproduce:

  1. Open VSCode in WSL
  2. Ensure that Dev > Containers: Execute in WSL is checked in settings under the user tab.
  3. Ensure that Git is installed on both Windows and WSL.
  4. Ensure the remote extension pack is installed on VSCode
  5. Command Palette > Dev Containers: Clone Repository in Container Volume.
  6. Select private GitHub repository and branch.
  7. Nothing happens (no errors or output).
  8. In the logs it looks like it is hanging on git ls-remote

Does this issue occur when you try this locally?: Yes Does this issue occur when you try this locally and all extensions are disabled?: N/A

JOSEPHGILBY commented 10 months ago

This appears to be issue #9163

rgalonso commented 3 months ago

I was experiencing this issue and realized it was hanging (or silently failing - it's unclear) because it was unable to interactively prompt for the login credentials.

The solution is to make sure that WSL has access to Git Credential Manager from the Windows side, as explained in this StackOverflow answer.

In WSL, run the following to make the necessary update:

git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"

This resolved the issue when dealing with an HTTPS clone.

For an SSH clone, make sure you have an SSH agent running in WSL and have added your key to it. Alternatively, make sure the Windows-side SSH agent is accessible from the WSL side. (This is possible, but beyond the scope of what I'm explaining here.)

Malix-Labs commented 1 month ago

Duplicate of https://github.com/microsoft/vscode-remote-release/issues/9163