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.67k stars 290 forks source link

[Remote-SSH Bug]: Failed to install code when specifying a server install path #9930

Open MariusDrulea opened 5 months ago

MariusDrulea commented 5 months ago

Is there an existing issue for this bug?

Required Troubleshooting Steps

Connect Locally

It connects successfully

->

No response

Expected Behavior

The vscode server shall install in remote when specifying the serverInstallPath. I use this setting cause I have to use an apptainer on the remote. If I don't use the apptainer related settings (e.g. no serverInstallPath specified, and connect to myhost.com instead of myimage1~myhost.com), the installation of vscode server works.

Steps To Reproduce

in settings.json "remote.SSH.serverInstallPath": { "myimage1\~myhost.com": "~/.vscode-container/myimage1", },

in ssh config file Host myimage1~* RemoteCommand apptainer shell /path/myimage1.sif RequestTTY yes

Host myhost.com myimage1~myhost.com HostName myhost.com User user ForwardAgent yes ForwardX11 yes ForwardX11Trusted yes

Remote-SSH Log

[12:05:36.493] > 6983fdd17fe0: running [12:05:36.527] > Installing to ~/.vscode-container/myimage1/.vscode-server... [12:05:36.542] > 6983fdd17fe0%%1%%

Downloading with wget [12:05:36.967] > Download complete [12:05:36.982] > 6983fdd17fe0%%2%% tar --version: tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason. [12:05:37.531] > mv: cannot move ‘code’ to ‘~/.vscode-container/myimage1/.vscode-server/code-d c96b837cf6bb4af9cd736aa3af08cf8279f7685’: No such file or directory bash: line 272: /home/user/.vscode-container/myimage1/.vscode-server/code- dc96b837cf6bb4af9cd736aa3af08cf8279f7685: No such file or directory ERROR: ~/.vscode-container/myimage1/.vscode-server/code-dc96b837cf6bb4af9cd73 6aa3af08cf8279f7685 don't exist

Anything else?

No response

MariusDrulea commented 5 months ago

Based on the error message above, the issue is one of this:

  1. cannot un-tar to a specific folder
  2. cannot or does not move a file from ~/Downloads to a specific folder
  3. the specific folder is not created by the extension, or it cannot be created due to missing access rights

I tested the access rights, this works. I am able to connect using the same command used by the vscode: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D 54396 -o RemoteCommand=none "myimage1~myhost.com" bash Inside the remote command I am able to create and delete folders.

MariusDrulea commented 5 months ago

Indeed, the folder ~/.vscode-container/myimage1 is not created during the server installation process. [12:05:36.967] > Download complete. Ok, the download is complete, but where is the downloaded file? I guess it might be deleted at the end of the process.

xiongqr commented 2 months ago

I can confirm the existence of the bug. The bug happened to me when VSCode is upgraded to 1.93. It was working in March, 2024. Please fix it, it took me a couple of hours to figure out why my VScode did not work suddenly. Following is the log:

[12:36:20.050] > ready: c709ec542267 [12:36:20.254] > Linux 5.15.72-5.15.1.1-amd64-7e749e4c93ab8d10 #1 SMP Fri Feb 17 23:33:53 UTC 2023 [12:36:20.255] Platform: linux [12:36:20.460] > /bin/bash [12:36:20.460] Parent Shell: bash [12:36:20.460] Parent Shell pid: 3153 [12:36:20.638] > 1746676 [12:36:20.638] Waiting for pid of spawned 'sh' subshell: '1746676'... [12:36:20.688] > 1746676 [12:36:20.738] > 1746676 [12:36:20.796] > 1746676 [12:36:20.841] > c709ec542267: running

Script executing under PID: 1746676 [12:36:20.849] > Installing to '/ghostcache'/.vscode-server... c709ec542267%%1%% [12:36:20.851] > Downloading with wget wget is from busybox: no [12:36:20.855] stderr> Program 'wget' appears to support flag '--no-config' [12:36:35.204] > Download complete [12:36:35.206] > c709ec542267%%2%% [12:36:35.208] > tar --version: tar (GNU tar) 1.30 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason. [12:36:35.381] stderr> mv: cannot move 'code' to "'/ghostcache'/.vscode-server/code-4849ca9bdf9666755eb463db297b69e5385090e3": No such file or directory [12:36:35.383] > ERROR: '/ghostcache'/.vscode-server/code-4849ca9bdf9666755eb463db297b69e5385090e3 don't exist