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.6k stars 273 forks source link

remote containers cannot fetch git repository cloned with SSH #4990

Closed bitscuit closed 3 years ago

bitscuit commented 3 years ago

Issue Type: Bug

I use Docker Desktop along with WSL 2. I used remote containers to open a folder in a container. This folder has a git repository in it, and I get the following error when I run a fetch:

$ git fetch origin 
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I followed the documentation here to start the SSH agent and added my private key in WSL 2 https://code.visualstudio.com/docs/remote/containers#_sharing-git-credentials-with-your-container, but that did not work.

I thought remote containers maybe could have been using my Windows SSH agent, so I copied my private key to my Windows file system, and added it to the SSH agent using PowerShell, but that also did not work.

Extension version: 0.166.1 VS Code version: Code 1.55.2 (3c4e3df9e89829dce27b7b5c24508306b151f30d, 2021-04-13T09:35:57.887Z) OS version: Windows_NT x64 10.0.19041 Remote OS version: Linux x64 4.19.128-microsoft-standard

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (4 x 3192)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|7.95GB (1.13GB free)| |Process Argv|--folder-uri=vscode-remote://wsl+Ubuntu/home/henryhli/github.com/bitscuit/task-tracker --remote=wsl+Ubuntu --crash-reporter-id c5633486-83ab-4c1c-a655-1b45eef88840| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Dev Container: Ubuntu| |OS|Linux x64 4.19.128-microsoft-standard| |CPUs|Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (4 x 3191)| |Memory (System)|6.16GB (1.57GB free)| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 pythonvspyt602:30294772 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstry244:30276681 pythonvspyt639:30291489 pythontb:30283811 vspre833:30267464 pythonptprofiler:30281270 vshan820:30294714 pythondataviewer:30285071 vscus158:30286553 ```
chrmarti commented 3 years ago

Could you post your log from when you open the folder in the container (F1 > Remote-Containers: Show Log)

camilo-paidy commented 3 years ago

I am facing the same. The versions I have on my PC are:

Version: 1.56.0
Commit: cfa2e218100323074ac1948c885448fdf4de2a7f
Date: 2021-05-04T22:06:21.189Z (1 day ago)
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 20.4.0

When I build the container the first time, it works with git with no problems, but when I restart the container, it starts showing this for any git command that involves the remote repository:

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Even if I rebuild the container, the problem persists.

`Remote-Containers: Show Log` ``` [177 ms] Remote-Containers 0.177.0 in VS Code 1.56.0 (cfa2e218100323074ac1948c885448fdf4de2a7f). [176 ms] Start: Resolving Remote [178 ms] Setting up container for folder or workspace: /Users/username/Documents/git/credit-risk-models [199 ms] Start: Check Docker is running [199 ms] Start: Run: docker version --format {{.Server.APIVersion}} [371 ms] Server API version: 1.41 [408 ms] Start: Run: git rev-parse --show-cdup [422 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/username/Documents/git/credit-risk-models --filter label=vsch.quality=stable [582 ms] Start: Run: docker build -f /Users/username/Documents/git/credit-risk-models/.devcontainer/Dockerfile -t vsc-credit-risk-models-ee7fb64822d0b4ee001668ede3d14247 --build-arg VARIANT=3.6 --build-arg INSTALL_NODE=true --build-arg NODE_VERSION=lts/* /Users/username/Documents/git/credit-risk-models [+] Building 0.7s (7/7) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 37B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 34B 0.0s => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/p 0.5s => [1/3] FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.6@sha256 0.0s => CACHED [2/3] RUN if [ "true" = "true" ]; then su vscode -c "umask 000 0.0s => CACHED [3/3] RUN apt-get update && export DEBIAN_FRONTEND=noninteract 0.0s => exporting to image 0.0s => => exporting layers 0.0s => => writing image sha256:cdcf1421974d78b0d127e5b1c9cebcf9667462ac83113 0.0s => => naming to docker.io/library/vsc-credit-risk-models-ee7fb64822d0b4e 0.0s Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them [2550 ms] Start: Run: docker events --format {{json .}} --filter event=start [2552 ms] Start: Starting container [2552 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=/Users/username/Documents/git/credit-risk-models,target=/workspaces/credit-risk-models,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=/Users/username/Documents/git/credit-risk-models -l vsch.quality=stable -l vsch.remote.devPort=0 --entrypoint /bin/sh vsc-credit-risk-models-ee7fb64822d0b4ee001668ede3d14247 -c echo Container started ; trap "exit 0" 15; while sleep 1 & wait $!; do :; done Container started [3691 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/username/Documents/git/credit-risk-models --filter label=vsch.quality=stable [3840 ms] Start: Run: docker inspect --type container 632e69a77b82 [3993 ms] Start: Inspecting container [3994 ms] Start: Run: docker inspect --type container 632e69a77b824965c6477a4f87de3b97ca7d5d160c6a9b3eaecffd8cc4f44987 [4140 ms] Start: Run in container: /bin/sh [4142 ms] Start: Run in container: uname -m [4385 ms] x86_64 [4386 ms] [4386 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null [4390 ms] PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" [4390 ms] [4390 ms] Start: Run in container: cat /etc/passwd [4394 ms] Start: Updating configuration state [4396 ms] Start: Setup shutdown monitor [4397 ms] Forking shutdown monitor: /Users/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.177.0/dist/shutdown/shutdownMonitorProcess /var/folders/qz/bnjnnf316bl1ph05w9hnnpgw0000gq/T/vscode-remote-containers-0b24a4bdb73626b5a8aa7c2ff24103eb39e4fea0.sock singleContainer Debug /Users/username/Library/Application Support/Code/logs/20210506T114038/exthost1/ms-vscode-remote.remote-containers 1620268886841 [4399 ms] Start: Run in container: test -d /home/vscode/.vscode-server [4401 ms] [4401 ms] [4401 ms] Exit code 1 [4401 ms] Start: Run in container: test -d /home/vscode/.vscode-remote [4403 ms] [4403 ms] [4403 ms] Exit code 1 [4404 ms] Start: Run in container: set -o noclobber ; mkdir -p '/home/vscode/.vscode-server/data/Machine' && { > '/home/vscode/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null [4410 ms] [4410 ms] [4410 ms] Start: Run in container: mkdir -p '/home/vscode/.vscode-server/data/Machine' && cat >'/home/vscode/.vscode-server/data/Machine/settings.json' <<'settingsJSON' [4419 ms] [4419 ms] [4419 ms] Start: Run in container: test -d /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f [4422 ms] [4422 ms] [4422 ms] Exit code 1 [4422 ms] Start: Run in container: test -d /vscode/vscode-server/bin/x64/cfa2e218100323074ac1948c885448fdf4de2a7f [4425 ms] [4425 ms] [4425 ms] Start: Run in container: mkdir -p '/home/vscode/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/cfa2e218100323074ac1948c885448fdf4de2a7f' '/home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f' [4431 ms] [4431 ms] [4432 ms] Start: Run in container: /bin/sh [4433 ms] Start: Launching Remote-Containers helper. [4433 ms] Start: Run in container: touch '/vscode/vscode-server/bin/x64/cfa2e218100323074ac1948c885448fdf4de2a7f' [4434 ms] Start: Run: gpgconf --list-dir agent-extra-socket [4451 ms] /Users/username/.gnupg/S.gpg-agent.extra [4451 ms] [4452 ms] Start: Run in container: gpgconf --list-dir agent-socket [4455 ms] /home/vscode/.gnupg/S.gpg-agent [4455 ms] [4456 ms] Start: Run in container: gpgconf --list-dir homedir [4461 ms] /home/vscode/.gnupg [4461 ms] [4461 ms] Start: Run in container: ls '/home/vscode/.gnupg/private-keys-v1.d' 2>/dev/null [4466 ms] [4466 ms] [4466 ms] Exit code 2 [4466 ms] Start: Run in container: mkdir -p -m 700 '/home/vscode/.gnupg' [4470 ms] [4470 ms] [4470 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js' >/tmp/vscode-remote-containers-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js [4471 ms] Start: Run: gpgconf --list-dir homedir [4475 ms] [4475 ms] [4475 ms] Start: Run in container: # Test for /home/vscode/.ssh/known_hosts and ssh [4480 ms] [4481 ms] [4481 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js' >/tmp/vscode-remote-containers-server-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js [4484 ms] /Users/username/.gnupg [4484 ms] [4495 ms] [4495 ms] [4495 ms] Start: Run in container: # Copy /Users/username/.ssh/known_hosts to /home/vscode/.ssh/known_hosts [4496 ms] Start: Run in container: /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/node /tmp/vscode-remote-containers-server-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js [4504 ms] [4504 ms] [4504 ms] Start: Run in container: gpgconf --list-dir homedir [4511 ms] /home/vscode/.gnupg [4511 ms] [4512 ms] Start: Run in container: # Test for /home/vscode/.gnupg/pubring.kbx and gpg [4517 ms] [4517 ms] [4517 ms] Start: Run in container: # Copy /Users/username/.gnupg/pubring.kbx to /home/vscode/.gnupg/pubring.kbx [4546 ms] [4546 ms] [4547 ms] Start: Run in container: # Test for /home/vscode/.gnupg/trustdb.gpg and gpg [4552 ms] [4552 ms] [4552 ms] Start: Run in container: # Copy /Users/username/.gnupg/trustdb.gpg to /home/vscode/.gnupg/trustdb.gpg [4558 ms] [4559 ms] [4559 ms] Start: Run: gpg-connect-agent updatestartuptty /bye [4767 ms] [4767 ms] [4767 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system credential.helper '!f() { /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/node /tmp/vscode-remote-containers-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js $*; }; f' || true [4772 ms] [4772 ms] [4772 ms] Start: Preparing Extensions [4772 ms] Start: Run in container: set -o noclobber ; mkdir -p '/home/vscode/.vscode-server/data/Machine' && { > '/home/vscode/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null [4779 ms] [4779 ms] [4781 ms] Extensions cache, install extensions: ms-python.python [4781 ms] Start: Run in container: test -d /home/vscode/.vscode-server/extensionsCache && ls /home/vscode/.vscode-server/extensionsCache || true [4784 ms] [4785 ms] [4785 ms] Start: Run in container: test -d /vscode/vscode-server/extensionsCache && ls /vscode/vscode-server/extensionsCache || true [4789 ms] eamodio.gitlens-11.4.1 felipe.nasc-touchbar-1.12.0 ms-python.python-2021.3.680753044 ms-python.python-2021.4.765268190 ms-toolsai.jupyter-2021.5.702919634 ms-toolsai.jupyter-2021.5.745244803 ms-toolsai.jupyter-2021.6.811652604 visualstudioexptteam.vscodeintellicode-1.2.12 [4789 ms] [4790 ms] Extensions cache, link in container: ms-python.python-2021.3.680753044, ms-python.python-2021.4.765268190 [4790 ms] Start: Run in container: mkdir -p '/home/vscode/.vscode-server/extensionsCache' && ln -s '/vscode/vscode-server/extensionsCache'/* '/home/vscode/.vscode-server/extensionsCache' || true [4798 ms] [4798 ms] [4798 ms] Start: Run in container: cd /vscode/vscode-server/extensionsCache && touch 'ms-python.python-2021.3.680753044' 'ms-python.python-2021.4.765268190' [4799 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd ; readlink /proc/$pid/ns/mnt ; cat /proc/$pid/stat | tr " [4804 ms] [4804 ms] [4898 ms] Start: Starting VS Code Server [4898 ms] Start: Run in container: /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/server.sh --log debug --force-disable-user-env --use-host-proxy --port 0 --extensions-download-dir /home/vscode/.vscode-server/extensionsCache --install-extension ms-python.python --start-server [5121 ms] * * Visual Studio Code Server * * Reminder: You may only use this software with Visual Studio family products, * as described in the license https://aka.ms/vscode-remote/license * Extension host agent listening on 45609 [5121 ms] Start: Run in container: echo 45609 >/home/vscode/.vscode-server/data/Machine/.devport [5126 ms] [5126 ms] [5127 ms] Port forwarding for container port 45609 starts listening on local port. [5127 ms] Port forwarding local port 45609 to container port 45609 [5133 ms] Start: Run in container: # Test for /home/vscode/.gitconfig and git [5137 ms] [5137 ms] [5137 ms] Start: Run in container: # Copy /Users/username/.gitconfig to /home/vscode/.gitconfig [5139 ms] Port forwarding connection from 56861 > 45609 > 45609 in the container. [5139 ms] Start: Run in container: /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/node -e [5143 ms] [5143 ms] [5143 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/node /tmp/vscode-remote-containers-d38f05f34e65365cf3cb4e2bbd9c899f52c07ca6.js $*; }; f' || true [5149 ms] [5149 ms] [5521 ms] [02:41:32] Extension host agent started. [5585 ms] Installing extensions... [5759 ms] Port forwarding connection from 56877 > 45609 > 45609 in the container. [5760 ms] Start: Run in container: /home/vscode/.vscode-server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/node -e [5799 ms] [02:41:32] [::ffff:127.0.0.1][d40a521f][ManagementConnection] New connection established. [6351 ms] [02:41:33] [::ffff:127.0.0.1][068abe70][ExtensionHostConnection] New connection established. [6365 ms] [02:41:33] [::ffff:127.0.0.1][068abe70][ExtensionHostConnection] <220> Launched Extension Host Process. [6374 ms] Installing extension 'ms-python.python' v2021.4.765268190... [6553 ms] [02:41:33] Installing extension: ms-python.python [6555 ms] [02:41:33] Downloaded extension: ms-python.python /home/vscode/.vscode-server/extensionsCache/ms-python.python-2021.4.765268190 [7422 ms] Start: Run in container: cat /proc/232/environ [13715 ms] [02:41:40] Extracted extension to /home/vscode/.vscode-server/extensions/.6c25b15e-10ac-4ea2-8760-1b2dc038b439: ms-python.python [13744 ms] [02:41:40] Renamed to /home/vscode/.vscode-server/extensions/ms-python.python-2021.4.765268190 [13749 ms] [02:41:40] Installation completed. ms-python.python [14319 ms] [02:41:41] Installing extension: ms-toolsai.jupyter [14328 ms] [02:41:41] Downloaded extension: ms-toolsai.jupyter /home/vscode/.vscode-server/extensionsCache/ms-toolsai.jupyter-2021.6.811652604 [16055 ms] [02:41:42] Extracted extension to /home/vscode/.vscode-server/extensions/.06c82b3b-9887-46bd-a4fe-37b92cbc870a: ms-toolsai.jupyter [16074 ms] [02:41:42] Renamed to /home/vscode/.vscode-server/extensions/ms-toolsai.jupyter-2021.6.811652604 [16078 ms] [02:41:42] Installation completed. ms-toolsai.jupyter [16082 ms] [02:41:42] Extensions installed successfully: ms-toolsai.jupyter [16086 ms] [02:41:42] Extensions installed successfully: ms-python.python [16088 ms] Extension 'ms-python.python' v2021.4.765268190 was successfully installed. ```
camilo-paidy commented 3 years ago

This setting seems to have helped:

"remote.containers.gitCredentialHelperConfigLocation": "system"

bitscuit commented 3 years ago

@chrmarti here are my logs

[11 ms] Remote-Containers 0.166.1 in VS Code 1.55.2 (3c4e3df9e89829dce27b7b5c24508306b151f30d).
[2375 ms] Start: Resolving Remote
[2377 ms] Start: Run: wsl -d Ubuntu -e wslpath -u \\wsl$\Ubuntu\home\henryhli\github.com\bitscuit\habits
[2683 ms] Start: Run: wsl -d Ubuntu
[3084 ms] Setting up container for folder or workspace: /home/henryhli/github.com/bitscuit/habits
[3086 ms] Start: Check Docker is running
[3087 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='1' docker 'version' '--format' '{{.Server.APIVersion}}'
[3598 ms] Server API version: 1.41
[3840 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && test '-f' '/home/henryhli/github.com/bitscuit/habits/.devcontainer/devcontainer.json'
[4027 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/github.com/bitscuit/habits/.devcontainer/devcontainer.json'
[4368 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && git 'rev-parse' '--show-cdup'
[4680 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='2' docker 'ps' '-q' '-a' '--filter' 'label=vsch.local.folder=\\wsl$\Ubuntu\home\henryhli\github.com\bitscuit\habits' '--filter' 'label=vsch.quality=stable'
[5264 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='3' docker 'inspect' '--type' 'container' '0feec92375cd'
[5651 ms] Start: Starting container
[5651 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='4' docker 'start' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee'
[6758 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='5' docker 'ps' '-q' '-a' '--filter' 'label=vsch.local.folder=\\wsl$\Ubuntu\home\henryhli\github.com\bitscuit\habits' '--filter' 'label=vsch.quality=stable'
[7095 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='6' docker 'inspect' '--type' 'container' '0feec92375cd'
[7474 ms] Start: Inspecting container
[7474 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='7' docker 'inspect' '--type' 'container' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee'
[7792 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='8' docker 'exec' '-i' '-u' 'vscode' '-e' 'VSCODE_REMOTE_CONTAINERS_SESSION=7a77f45e-bd89-41ce-97b5-09cfe3b3c86d1620358787470' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee' '/bin/sh'
[7809 ms] Start: Run in container: uname -m
[8169 ms] x86_64
[8170 ms] 
[8170 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[8176 ms] PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[8176 ms] 
[8176 ms] Start: Run in container: cat /etc/passwd
[8180 ms] Start: Setup shutdown monitor
[8184 ms] Forking shutdown monitor: c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\shutdown\shutdownMonitorProcess \\.\pipe\vscode-remote-containers-1a1009035ae3ac18ed20b0aaf5d4d264f95929cb-sock singleContainer Info c:\Users\Henry-PC\AppData\Roaming\Code\logs\20210506T233719\exthost1\ms-vscode-remote.remote-containers 1620358789131
[8194 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/github.com/bitscuit/habits/.devcontainer/Dockerfile'
[8195 ms] Start: Run in container: test -d /home/vscode/.vscode-server
[8215 ms] 
[8216 ms] 
[8216 ms] Start: Run in container: set -o noclobber ; mkdir -p '/home/vscode/.vscode-server/data/Machine' && { > '/home/vscode/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[8247 ms] 
[8247 ms] 
[8247 ms] Exit code 2
[8247 ms] Start: Run in container: cat /home/vscode/.vscode-server/data/Machine/settings.json
[8251 ms] {
        "terminal.integrated.shell.linux": "/bin/bash",
        "python.pythonPath": "/usr/local/bin/python",
        "python.linting.enabled": true,
        "python.linting.pylintEnabled": true,
        "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
        "python.formatting.blackPath": "/usr/local/py-utils/bin/black",
        "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
        "python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
        "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
        "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
        "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
        "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
        "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
}
[8252 ms] 
[8253 ms] Start: Run in container: test -d /home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d
[8258 ms] 
[8258 ms] 
[8259 ms] Start: Run in container: test -d /vscode/vscode-server/bin/x64/3c4e3df9e89829dce27b7b5c24508306b151f30d
[8260 ms] 
[8260 ms] 
[8261 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='9' docker 'exec' '-i' '-u' 'root' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee' '/bin/sh'
[8261 ms] Start: Launching Remote-Containers helper.
[8261 ms] SSH_AUTH_SOCK not set on host.
[8262 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && gpgconf '--list-dir' 'agent-extra-socket'
[8278 ms] Start: Run in container: touch '/vscode/vscode-server/bin/x64/3c4e3df9e89829dce27b7b5c24508306b151f30d'
[8649 ms] /home/henryhli/.gnupg/S.gpg-agent.extra
[8649 ms] 
[8649 ms] Start: Run in container: gpgconf --list-dir agent-socket
[8692 ms] /home/vscode/.gnupg/S.gpg-agent
[8692 ms] 
[8692 ms] Start: Run in container: gpgconf --list-dir homedir
[8695 ms] /home/vscode/.gnupg
[8696 ms] 
[8696 ms] Start: Run in container: ls '/home/vscode/.gnupg/private-keys-v1.d' 2>/dev/null
[8707 ms] 
[8707 ms] 
[8707 ms] Exit code 2
[8707 ms] Start: Run in container: mkdir -p -m 700 '/home/vscode/.gnupg'
[8708 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/.ssh/known_hosts'
[8711 ms] 
[8711 ms] 
[8711 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-419010c7b707903ac58b782ac82a06119e6ec0ea.js' >/tmp/vscode-remote-containers-419010c7b707903ac58b782ac82a06119e6ec0ea.js
[8711 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && gpgconf '--list-dir' 'homedir'
[8767 ms] 
[8767 ms] 
[8767 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-419010c7b707903ac58b782ac82a06119e6ec0ea.js' >/tmp/vscode-remote-containers-server-419010c7b707903ac58b782ac82a06119e6ec0ea.js
[8783 ms] 
[8783 ms] 
[8784 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='10' docker 'exec' '-i' '-u' 'vscode' '-e' 'REMOTE_CONTAINERS_SOCKETS=["/home/vscode/.gnupg/S.gpg-agent"]' '-e' 'REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-419010c7b707903ac58b782ac82a06119e6ec0ea.sock' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee' '/home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/node' '/tmp/vscode-remote-containers-server-419010c7b707903ac58b782ac82a06119e6ec0ea.js'
[8879 ms] 
[8879 ms] 
[9014 ms] Start: Run in container: # Test for /home/vscode/.ssh/known_hosts and ssh
[9031 ms] /home/vscode/.ssh/known_hosts exists
[9031 ms] 
[9031 ms] Exit code 1
[9031 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system credential.helper '!f() { /home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/node /tmp/vscode-remote-containers-419010c7b707903ac58b782ac82a06119e6ec0ea.js $*; }; f' || true
[9055 ms] /home/henryhli/.gnupg
[9055 ms] 
[9055 ms] Start: Run in container: gpgconf --list-dir homedir
[9082 ms] /home/vscode/.gnupg
[9082 ms] 
[9082 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/.gnupg/pubring.kbx'
[9163 ms] 
[9163 ms] 
[9163 ms] Start: Preparing Extensions
[9163 ms] Start: Run in container: set -o noclobber ; mkdir -p '/home/vscode/.vscode-server/data/Machine' && { > '/home/vscode/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[9173 ms] 
[9173 ms] 
[9173 ms] Exit code 2
[9174 ms] Start: Run in container: test -d /home/vscode/.vscode-server/extensionsCache && ls /home/vscode/.vscode-server/extensionsCache || true
[9179 ms] ms-azuretools.vscode-docker-1.12.1
ms-python.python-2021.4.765268190
ms-toolsai.jupyter-2021.5.745244803
[9179 ms] 
[9179 ms] Start: Run in container: test -d /vscode/vscode-server/extensionsCache && ls /vscode/vscode-server/extensionsCache || true
[9191 ms] ms-azuretools.vscode-docker-1.12.1
ms-python.python-2021.4.765268190
ms-toolsai.jupyter-2021.5.745244803
[9192 ms] 
[9192 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd ; readlink /proc/$pid/ns/mnt ; cat /proc/$pid/stat | tr "
[9346 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/.gnupg/trustdb.gpg'
[9364 ms] Start: Starting VS Code Server
[9364 ms] Start: Run in container: /home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/server.sh --force-disable-user-env --use-host-proxy --port 0 --extensions-download-dir /home/vscode/.vscode-server/extensionsCache --start-server
[9557 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && gpg-connect-agent 'updatestartuptty' '/bye'
[9808 ms] 

*
* Visual Studio Code Server
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license https://aka.ms/vscode-remote/license
*

Extension host agent listening on 42021

[9808 ms] Start: Run in container: echo 42021 >/home/vscode/.vscode-server/data/Machine/.devport
[9810 ms] 
[9810 ms] 
[9812 ms] Forwarding local port 42021 to container port 42021
[9813 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/.gitconfig'
[9837 ms] Forwarding connection from port 51858 on local port 42021 to container port 42021
[9838 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='12' docker 'exec' '-i' '-u' 'vscode' '-e' 'VSCODE_REMOTE_CONTAINERS_SESSION=7a77f45e-bd89-41ce-97b5-09cfe3b3c86d1620358787470' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee' '/home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/node' '-e' '
[10111 ms] Start: Run in container: # Test for /home/vscode/.gitconfig and git
[10113 ms] /home/vscode/.gitconfig exists
[10113 ms] 
[10113 ms] Exit code 1
[10114 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && cat '/home/henryhli/.config/git/config'
[10383 ms] [03:39:59] Extension host agent started.
[10391 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { /home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/node /tmp/vscode-remote-containers-419010c7b707903ac58b782ac82a06119e6ec0ea.js $*; }; f' || true
[10416 ms] 
[10416 ms] 
[10700 ms] Forwarding connection from port 51872 on local port 42021 to container port 42021
[10701 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='13' docker 'exec' '-i' '-u' 'vscode' '-e' 'VSCODE_REMOTE_CONTAINERS_SESSION=7a77f45e-bd89-41ce-97b5-09cfe3b3c86d1620358787470' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee' '/home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/node' '-e' '
[10779 ms] [03:39:59] [::ffff:127.0.0.1][6aa65cd4][ManagementConnection] New connection established.
[10828 ms] [IPC Library: Pty Host]  INFO Listing 0 persistent terminals, 0 total terminals
[12251 ms] Forwarding connection from port 51884 on local port 42021 to container port 42021
[12252 ms] Start: Run: wsl -d Ubuntu -e /bin/sh -c cd '/home/henryhli/github.com/bitscuit/habits' && DISPLAY='1' ELECTRON_RUN_AS_NODE='1' SSH_ASKPASS='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\scripts\ssh-askpass.bat' VSCODE_SSH_ASKPASS_NODE='C:\Program Files\Microsoft VS Code\Code.exe' VSCODE_SSH_ASKPASS_MAIN='c:\Users\Henry-PC\.vscode\extensions\ms-vscode-remote.remote-containers-0.166.1\dist\common\sshAskpass.js' VSCODE_SSH_ASKPASS_HANDLE='\\.\pipe\ssh-askpass-21b7e982bfe12f64e94a009afe2e037f786fac88-sock' DOCKER_CONTEXT='default' VSCODE_SSH_ASKPASS_COUNTER='14' docker 'exec' '-i' '-u' 'vscode' '-e' 'VSCODE_REMOTE_CONTAINERS_SESSION=7a77f45e-bd89-41ce-97b5-09cfe3b3c86d1620358787470' '0feec92375cdb8644119d703f2cb60dfdd57c22e8c5ea5339995d9a9e9e6ecee' '/home/vscode/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d/node' '-e' '
[12514 ms] [03:40:01] [::ffff:127.0.0.1][bef780fa][ExtensionHostConnection] New connection established.
[12530 ms] [03:40:01] [::ffff:127.0.0.1][bef780fa][ExtensionHostConnection] <203> Launched Extension Host Process.
[12943 ms] Start: Run in container: cat /proc/214/environ

I notice a lot of exit codes 1 and 2. Is that normal?

chrmarti commented 3 years ago

@bitscuit The various exit codes are expected. SSH_AUTH_SOCK is not set in WSL. Make sure you start the ssh-agent in your .bash_profile: https://code.visualstudio.com/docs/remote/containers#_using-ssh-keys

bitscuit commented 3 years ago

@chrmarti are those instructions valid? Because after I added the code snippet to start up the ssh-agent in my bash profile, I tried adding my private key to the ssh-agent that was supposedly running, but got this error:

Could not open a connection to your authentication agent.

And I guess since the ssh-agent did not have the key, when I opened the folder in a container, it was still unable to access the remote repo

chrmarti commented 3 years ago

The snippet in the bash profile should start the agent and set SSH_AUTH_SOCK the first time it is run. Is SSH_AUTH_SOCK set? A bash session from before you added this snippet won't have the variable set, try with a new bash session in this case.

bitscuit commented 3 years ago

@chrmarti thanks for the help. Looks like I was missing socat, so I had to install that