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.68k stars 295 forks source link

[Remote-SSH Bug]: Replace -o with -O for scp to work #10406

Open kaizen-cmd opened 1 month ago

kaizen-cmd commented 1 month ago

Is there an existing issue for this bug?

Required Troubleshooting Steps

Connect Locally

It connects successfully

->

scp command to copy vscode server tar to remote server fails because of the -o flag. -O flag should be used instead

Expected Behavior

I custom fixed it by editing the code of the installed extension in ~/.vscode/extensions/ms-vscode-remote.remote-ssh-0.115.0/out/extension.js Please make it standard as a part of the release.

Steps To Reproduce

Try connecting to an older remote server without internet

Remote-SSH Log

Remote-SSH Log

``` [PASTE LOG HERE] ```

Anything else?

I custom fixed it by editing the code of the installed extension in ~/.vscode/extensions/ms-vscode-remote.remote-ssh-0.115.0/out/extension.js Please make it standard as a part of the release.

joshspicer commented 3 weeks ago

Please attach your entire Remote SSH logs.

What led you to make this change in your extension build? What operating system are you using on both the local and remote? Could you share the before and after of the command you changed (and what problem you were fixing)?

Looking in the scp man page on my machine I see the following for -O

CAVEATS
     The legacy SCP protocol (selected by the -O flag) requires execution of
     the remote user's shell to perform glob(3) pattern matching.  This
     requires careful quoting of any characters that have special meaning to
     the remote shell, such as quote characters.

This doesn't sound like something we want to adopt, but perhaps there is a certain scenario where it does indeed make sense. Thanks!

kaizen-cmd commented 3 weeks ago
joshspicer commented 3 weeks ago

Thanks for the details, we appreciate you taking the time to open an issue. It makes sense that you're looking to use the local download mode if your hosts do not have access to the internet.

Could you share more details on the remote host so I can attempt to build a repro/regression test (providing the log should also give me some of that info, if you're able to copy/paste that into the original Remote-SSH Log section)

kaizen-cmd commented 3 weeks ago

This is the error message with which scp exits. Log taken from Output > Remote - SSH

subsystem request failed on channel 0
scp: Connection closed

Host config:

NAME="Rocky Linux"
VERSION="8.9 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.9 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"

The workaround I did in ~/.vscode/extensions/ms-vscode-remote.remote-ssh-0.115.0/out/extension.js

let w = await (0, c.generateScpCommand)(y, e.host, n.destPath, i.logger);
w = w.replace('-o', '-O ');