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

[Dev Containers] try a example button at left dev container pannel open the example in local instead of remote when in remote window #10623

Open
NewUserHa opened this issue Jan 9, 2025 · 10 comments
Assignees
Labels
containers Issue in vscode-remote containers polish

Comments

@NewUserHa
Copy link

  • VSCode Version: 1.95.3
  • Local OS Version: win10 1803
  • Remote OS Version: debian 12.8
  • Remote Extension/Connection Type: Dev Containers
  • Logs:
[4113 ms] Dev Containers 0.394.0 over Remote - SSH 0.115.1 in VS Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813).
[4112 ms] Start: Resolving Remote
[4121 ms] Start: Loading environment from ExecServer
[4309 ms] Host OS: linux 6.1.0-28-cloud-amd64
[4310 ms] Host CWD: undefined
[4310 ms] Start: Run: /bin/sh 
[4683 ms] Start: Run in host: echo ~
[4869 ms] /root
[4869 ms] 
[4870 ms] Start: Run in host: id -un
[5057 ms] root
[5058 ms] 
[5058 ms] Start: Run in host:  (command -v getent >/dev/null 2>&1 && getent passwd 'root' || grep -E '^root|^[^:]*:[^:]*:root:' /etc/passwd || true)
[5246 ms] userEnvProbe: loginInteractiveShell (default)
[5246 ms] userEnvProbe: not found in cache
[5247 ms] userEnvProbe shell: /usr/bin/fish
[5681 ms] userEnvProbe PATHs:
Probe:     '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
Container: None
[6057 ms] Start: Run: wsl -l -v
[6109 ms] Could not connect to WSL.
[6109 ms] Exectuable 'wsl' not found on PATH 'c:\windows;c:\windows\system32;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\windows\system32\openssh\; ~~~'.
[6499 ms] Start: Check Docker is running
[6500 ms] Start: Run: docker version
[6897 ms] Client: Docker Engine - Community
[6898 ms] 
[6899 ms]  Version:
[6899 ms]         
[6900 ms]    
[6900 ms] 27.4.1
[6901 ms] 
[6901 ms]  API version:
[6901 ms]        
[6902 ms] 1.47
[6902 ms] 
[6903 ms]  Go version:
[6903 ms]         
[6904 ms] go1.22.10
[6904 ms] 
[6905 ms]  Git commit:
[6906 ms]         
[6912 ms] b9d17ea
[6913 ms] 
[6913 ms]  Built:
[6913 ms]         
[6913 ms]      
[6914 ms] Tue Dec 17 15:45:56 2024
[6914 ms] 
[6914 ms]  OS/Arch:
[6914 ms]         
[6914 ms]    
[6914 ms] linux/amd64
[6915 ms] 
[6915 ms]  Context:
[6915 ms]         
[6915 ms]    
[6915 ms] default
[6915 ms] 
[6916 ms] 
[6916 ms] Server: Docker Engine - Community
[6916 ms] 
[6916 ms]  Engine:
[6916 ms] 
[6916 ms]   Version:
[6917 ms]         
[6917 ms]   
[6917 ms] 27.4.1
[6917 ms] 
[6917 ms]   API version:
[6918 ms]       
[6918 ms] 1.47 (minimum version 1.24)
[6918 ms] 
[6918 ms]   Go version:
[6918 ms]        
[6918 ms] go1.22.10
[6918 ms] 
[6919 ms]   Git commit:
[6919 ms]        
[6919 ms] c710b88
[6919 ms] 
[6919 ms]   Built:
[6920 ms]         
[6920 ms]     
[6920 ms] Tue Dec 17 15:45:56 2024
[6921 ms] 
[6921 ms]   OS/Arch:
[6921 ms]         
[6921 ms]   
[6922 ms] linux/amd64
[6922 ms] 
[6922 ms]   Experimental:
[6922 ms]      
[6922 ms] false
[6922 ms] 
[6923 ms]  containerd:
[6923 ms] 
[6923 ms]   Version:
[6923 ms]         
[6923 ms]   
[6923 ms] 1.7.24
[6924 ms] 
[6924 ms]   GitCommit:
[6924 ms]         
[6924 ms] 88bf19b2105c8b17560993bee28a01ddc2f97182
[6924 ms] 
[6924 ms]  runc:
[6925 ms] 
[6925 ms]   Version:
[6926 ms]         
[6926 ms]   
[6926 ms] 1.2.2
[6926 ms] 
[6927 ms]   GitCommit:
[6927 ms]         
[6927 ms] v1.2.2-0-g7cb3632
[6927 ms] 
[6927 ms]  docker-init:
[6928 ms] 
[6928 ms]   Version:
[6928 ms]         
[6929 ms]   
[6929 ms] 0.19.0
[6929 ms] 
[6929 ms]   GitCommit:
[6930 ms]         
[6930 ms] de40ad0
[6930 ms] 
[6935 ms] Start: Run: docker volume ls -q
[10365 ms] Start: Run: docker build -f /tmp/vsch-root/bootstrap-image/0.394.0/bootstrap.Dockerfile -t vsc-volume-bootstrap /tmp/vsch-root/bootstrap-image/0.394.0
#0 building with "default" instance using docker driver

#1 [internal] load build definition from bootstrap.Dockerfile
#1 transferring dockerfile: 1.02kB done
#1 DONE 0.0s

#2 [internal] load metadata for mcr.microsoft.com/devcontainers/base:0-alpine-3.20
#2 DONE 0.1s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [1/8] FROM mcr.microsoft.com/devcontainers/base:0-alpine-3.20@sha256:5212d8ed44c89bfadad14a03104ef75b09c5de8642a58721c271f2e9155f5023
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 214.63kB done
#5 DONE 0.0s

#6 [3/8] RUN cat /tmp/host-ca-certificates.crt >> /etc/ssl/certs/ca-certificates.crt
#6 CACHED

#7 [4/8] RUN csplit -f /usr/local/share/ca-certificates/host-ca-certificate- -b '%02d.pem' -z -s /tmp/host-ca-certificates.crt '/-----BEGIN CERTIFICATE-----/' '{*}'
#7 CACHED

#8 [2/8] COPY host-ca-certificates.crt /tmp/host-ca-certificates.crt
#8 CACHED

#9 [5/8] RUN echo "@old https://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories
#9 CACHED

#10 [7/8] RUN npm config set cafile /etc/ssl/certs/ca-certificates.crt && cd && npm i node-pty || echo "Continuing without node-pty."
#10 CACHED

#11 [6/8] RUN apk add --no-cache        git-lfs         nodejs  python3       npm     make    g++     docker-cli      docker-cli-buildx    docker-cli-compose       openssh-client-default@old      ;
#11 CACHED

#12 [8/8] COPY .vscode-remote-containers /root/.vscode-remote-containers
#12 CACHED

#13 exporting to image
#13 exporting layers done
#13 writing image sha256:42e9e7e90cab2554d8737f3dbfa79dfa78e9ca41dd9773ef3730d7015f5974aa done
#13 naming to docker.io/library/vsc-volume-bootstrap done
#13 DONE 0.0s
[11092 ms] Cloning Github repository: Microsoft/vscode-remote-try-python into /workspaces/vscode-remote-try-python

[11093 ms] Start: Run: docker run -d --mount type=volume,src=vscode-remote-try-python-57162747f0204512b2a2119607d864e61e3cfb714da0e7ce0cf5751654850e99,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[11735 ms] Start: Run in container: /bin/sh
[12109 ms] Start: Launching Dev Containers helper.
[12152 ms] ssh-agent: SSH_AUTH_SOCK not set on remote host.
[12152 ms] ssh-agent: SSH_AUTH_SOCK not set on local host.
[12154 ms] X11 forwarding: DISPLAY not set on remote host.
[12155 ms] X11 forwarding: DISPLAY not set on local host.
[12156 ms] Start: Run in container: gpgconf --list-dirs
[12350 ms] sysconfdir:/etc/gnupg
bindir:/usr/bin
libexecdir:/usr/libexec
libdir:/usr/lib/gnupg
datadir:/usr/share/gnupg
localedir:/usr/share/locale
socketdir:/root/.gnupg
dirmngr-socket:/root/.gnupg/S.dirmngr
keyboxd-socket:/root/.gnupg/S.keyboxd
agent-ssh-socket:/root/.gnupg/S.gpg-agent.ssh
agent-extra-socket:/root/.gnupg/S.gpg-agent.extra
agent-browser-socket:/root/.gnupg/S.gpg-agent.browser
agent-socket:/root/.gnupg/S.gpg-agent
homedir:/root/.gnupg
[12351 ms] 
[12352 ms] Start: Run in container: ls '/root/.gnupg/private-keys-v1.d' 2>/dev/null
[12543 ms] 
[12544 ms] 
[12544 ms] Exit code 2
[12545 ms] Start: Run in container: grep -e '^s*use-keyboxds*$' '/root/.gnupg/common.conf' 2>/dev/null
[12733 ms] 
[12734 ms] 
[12734 ms] Exit code 2
[12736 ms] Start: Run: gpgconf --list-dirs
[13109 ms] CodeError(ProcessSpawnFailed(Os { code: 2, kind: NotFound, message: "No such file or directory" }))
[13109 ms] gpg-agent: No agent-extra-socket found on remote host.
[13109 ms] Start: Run: gpgconf --list-dirs
[13162 ms] sysconfdir:C%3a\ProgramData\GNU\etc\gnupg
bindir:c%3a\program files (x86)\gnupg\bin
libexecdir:c%3a\program files (x86)\gnupg\bin
libdir:c%3a\program files (x86)\gnupg\lib\gnupg
datadir:c%3a\program files (x86)\gnupg\share\gnupg
localedir:c%3a\program files (x86)\gnupg\share\locale
socketdir:C%3a\Users\user\AppData\Roaming\gnupg
dirmngr-socket:C%3a\Users\user\AppData\Roaming\gnupg\S.dirmngr
agent-ssh-socket:C%3a\Users\user\AppData\Roaming\gnupg\S.gpg-agent.ssh
agent-extra-socket:C%3a\Users\user\AppData\Roaming\gnupg\S.gpg-agent.extra
agent-browser-socket:C%3a\Users\user\AppData\Roaming\gnupg\S.gpg-agent.browser
agent-socket:C%3a\Users\user\AppData\Roaming\gnupg\S.gpg-agent
homedir:C%3a\Users\user\AppData\Roaming\gnupg
[13162 ms] 
[13163 ms] Start: Run in container: test -f '/root/.gnupg/pubring.kbx'
[13350 ms] 
[13350 ms] 
[13351 ms] Exit code 1
[13351 ms] Start: Run in container: test -f '/root/.gnupg/pubring.gpg'
[13539 ms] 
[13540 ms] 
[13540 ms] Exit code 1
[13541 ms] Start: Run in container: test -f '/root/.gnupg/trustdb.gpg'
[13728 ms] 
[13728 ms] 
[13728 ms] Exit code 1
[13729 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
[13730 ms] gpg-agent: Socket in container (/root/.gnupg/S.gpg-agent) forwarded to local host (C:\Users\user\AppData\Roaming\gnupg\S.gpg-agent.extra).
[13917 ms] 
[13917 ms] 
[13917 ms] Start: Run in container: (command -v 'docker' || command -v 'oras' || command -v 'skopeo') >/dev/null 2>&1
[14104 ms] 
[14104 ms] 
[14104 ms] Start: Run in container: # Test for /root/.gnupg/pubring.kbx and gpg
[14105 ms] Start: Run in container: /bin/sh
[14293 ms] 
[14293 ms] 
[14294 ms] Start: Run in container: # Copy C:\Users\user\AppData\Roaming\gnupg\pubring.kbx to /root/.gnupg/pubring.kbx
[14477 ms] Start: Run in container: echo ~
[14664 ms] /root
[14664 ms] 
[14665 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-af86f090-29d4-43a5-8905-8dbdf8318438.js' >/tmp/vscode-remote-containers-af86f090-29d4-43a5-8905-8dbdf8318438.js
[14714 ms] 
[14715 ms] 
[14716 ms] Start: Run in container: # Test for /root/.gnupg/trustdb.gpg and gpg
[14853 ms] 
[14854 ms] 
[14905 ms] 
[14905 ms] 
[14906 ms] Start: Run in container: # Copy C:\Users\user\AppData\Roaming\gnupg\trustdb.gpg to /root/.gnupg/trustdb.gpg
[15277 ms] 
[15277 ms] 
[15278 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[15877 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-af86f090-29d4-43a5-8905-8dbdf8318438.js' >/tmp/vscode-remote-containers-server-af86f090-29d4-43a5-8905-8dbdf8318438.js_1736461096128
[16070 ms] 
[16070 ms] 
[16447 ms] Start: Run in container: # Test for /root/.gitconfig and git
[16634 ms] 
[16634 ms] 
[16634 ms] Start: Run in container: # Copy C:\Users\user\.gitconfig to /root/.gitconfig
[17007 ms] 
[17008 ms] 
[17197 ms] Start: Run in container: # Cleaning up git config
[17389 ms] 
[17389 ms] 
[17390 ms] Start: Run: git config --global --get gpg.ssh.allowedSignersFile
[17391 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global --replace-all credential.helper '!f() { node /tmp/vscode-remote-containers-af86f090-29d4-43a5-8905-8dbdf8318438.js git-credential-helper $*; }; f' || true
[17580 ms] 
[17581 ms] 
[17770 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[17959 ms] 
[17959 ms] 
[17959 ms] Start: Run in container: # Copy C:\Users\user\.ssh\known_hosts to /root/.ssh/known_hosts
[18333 ms] 
[18334 ms] 
[19109 ms] Start: Run in container: git clone --depth 1 https://github.com/Microsoft/vscode-remote-try-python .
Cloning into '.'...
fatal: unable to access 'https://github.com/Microsoft/vscode-remote-try-python/': Failed to connect to 127.0.0.1 port 8000 after 0 ms: Could not connect to server
[19568 ms] Start: Run: docker rm -f 236da2c45a5ba493bf15aec08bcb3a97f45fd831335d3d194af843097945aecc
[19981 ms] Container server terminated (code: 137, signal: null).
[19981 ms] Container server terminated. Reconnecting in 5 seconds...
[24982 ms] Start: Container: Reconnecting Dev Container server
[24982 ms] Start: Run in container: /bin/sh
[25366 ms] Container server: Error response from daemon: No such container: 236da2c45a5ba493bf15aec08bcb3a97f45fd831335d3d194af843097945aecc
[25368 ms] Container server terminated (code: 1, signal: null).
[25368 ms] Container server terminated early. Not reconnecting.
[25368 ms] Reconnecting Dev Container server failed: Container server terminated (code: 1, signal: null).

Steps to Reproduce:

  1. connect to the remote host via remote-ssh
  2. click the remote explore on the left pannel, switch to dev container, click try a example, then select any

the issue seems to just be that the dev-container incorrectly used the local env to git clone

old issue: #10352

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Jan 9, 2025
@chrmarti
Copy link
Contributor

The log looks like everything is done remotely. The following looks interesting:

[19109 ms] Start: Run in container: git clone --depth 1 https://github.com/Microsoft/vscode-remote-try-python .
Cloning into '.'...
fatal: unable to access 'https://github.com/Microsoft/vscode-remote-try-python/': Failed to connect to 127.0.0.1 port 8000 after 0 ms: Could not connect to server

Why would it connect to 127.0.0.1:8000? Do you have a network proxy configured?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jan 10, 2025
@NewUserHa
Copy link
Author

the remote is a *nix server, [6109 ms] [13162 ms] [14294 ms] [17959 ms] are local envs,
the local&remote vscode themselvies don't have proxy configured, the 127.0.0.1:8000 is from .gitconfig locally

@chrmarti
Copy link
Contributor

The log lines you refer to are from the Dev Containers extension using local configuration to set up the remote container.

Could you share your local .gitconfig?

@NewUserHa
Copy link
Author

~/.gitconfig:
[http]
	proxy = socks5h://127.0.0.1:8000
[https]
	proxy = socks5h://127.0.0.1:8000
[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true

@NewUserHa
Copy link
Author

the remote has nothing proxy configured

@chrmarti
Copy link
Contributor

You could try with removing the proxy from the .gitconfig or disable copying it over in the user settings:
Image
(You will need to rebuild the container to make these changes effective.)

@NewUserHa
Copy link
Author

after checking, the ~/.gitconfig caused the issue

@NewUserHa
Copy link
Author

also, then the issue occurred, the left-bottom corner also only showed "dev container ..." which seems like it is indicating running locally.

it should display "dev container ... @ remote" to keep the same as it successfully connected to the remote and is operating on the remote.

@chrmarti
Copy link
Contributor

It should show an @ like:
Image

@NewUserHa
Copy link
Author

It should show an @ like:
Image

if it ran successfully, that is what it showed.
But if it failed like in this issue, it will just show "dev container ..." only.

@chrmarti chrmarti added polish and removed info-needed Issue requires more information from poster labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers polish
Projects
None yet
Development

No branches or pull requests

2 participants