jeanp413 / open-remote-ssh

VSCode Remote Development: Open any folder on a remote machine using SSH.
MIT License
274 stars 36 forks source link

Could not establish connection: Error resolving authority, wget options not supported on linux x86_64 OpenWRT system using busybox, how to remove them? #116

Open ioogithub opened 11 months ago

ioogithub commented 11 months ago

I am attempting to run open-remote-ssh on an x86 openwrt system. I am getting the following error:

[Trace  - 19:41:06.480] Server install command stderr:
wget: unrecognized option: tries=3
Usage: wget [options] <URL>
Options:
    -4              Use IPv4 only
    -6              Use IPv6 only
    -O <file>           Redirect output to file (use "-" for stdout)
    -P <dir>            Set directory for output files
    --quiet | -q            Turn off status messages
    --continue | -c         Continue a partially-downloaded file
    --user=<user>           HTTP authentication username
    --password=<password>       HTTP authentication password
    --user-agent | -U <str>     Set HTTP user agent
    --post-data=STRING      use the POST method; send STRING as the data
    --post-file=FILE        use the POST method; send FILE as the data
    --spider | -s           Spider mode - only check file existence
    --timeout=N | -T N      Set connect/request timeout to N seconds
    --proxy=on | -Y on      Enable interpretation of proxy env vars (default)
    --proxy=off | -Y off |
    --no-proxy                  Disable interpretation of proxy env vars

HTTPS options:
    --ca-certificate=<cert>     Load CA certificates from file <cert>
    --no-check-certificate      don't validate the server's certificate
    --ciphers=<cipherlist>      Set the cipher list string

[Trace  - 19:41:06.480] Server install command stdout:
Error downloading server from https://github.com/VSCodium/vscodium/releases/download/1.82.0.23250/vscodium-reh-linux-x64-1.82.0.23250.tar.gz
ajsdklfj;asd;fhwod;ldsksdjsdfa: start
exitCode==1==
listeningOn====
connectionToken====
logFile==/root/.vscodium-server/.13ae69686c4390a9aee7b71b44337eb488319f26.log==
osReleaseId==openmptcprouter==
arch==x86_64==
platform==linux==
tmpDir==/tmp==
ajsdklfj;asd;fhwod;ldsksdjsdfa: end

[Error  - 19:41:06.481] Error resolving authority
Error: Couldn't install vscode server on remote server, install script returned non-zero exit status
    at t.installCodeServer (/home/oem/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.44-universal/out/extension.js:1:441063)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/oem/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.44-universal/out/extension.js:1:404941

The error seems pretty straight forward, the wget options --tries=3 --timeout=10 --continue --no-verbose are not supported opnewrt uses busybox and wget is here: /usr/bin/wget.

I can run this command successfully manually without the arguments on the system: wget -O vscode-server.tar.gz https://github.com/VSCodium/vscodium/releases/download/1.82.0.23250/vscodi um-reh-linux-x64-1.82.0.23250.tar.gz and it downloads the file to ~/.vscodium-server/bin/13ae69686c4390a9aee7b71b44337eb488319f26

SSH on this system uses dropbear and it is working because it did create the folder: ~/.vscodium-server/bin/13ae69686c4390a9aee7b71b44337eb488319f26 but it does not download the file.

This is a linux x86_64 system and busybox is widely used. I don't see any reason why this code could not work however I don't know how to modify the extension and remove the options to get it working.

Is the code in /home/oem/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.44-universal/out/extension.js? If so it looks obfuscated or minimized. I wasn't able to open it and made a change successfully.

StarLederer commented 9 months ago

I had a similar issue with toybox in a Nix powered container, you are right about the cause and the solution is to install full wget on top of busy/toybox. Luckily this was trivial to do in my case thanks to Nix but I imagine this will vary a lot based on the package manager used on your SSH server. Perhaps simply installing wget on top of what you already have will overwrite it correctly?

StarLederer commented 9 months ago

If you absolutely must use wget that comes with busybox you can also modify this extension but I'd personally recommend compiling from source instead of monkey-patching it and maybe contributing the change back if you manage to make this optional. I have no idea if @jeanp413 will accept it but I'd appreciate this feature too. The code you are looking for can be found here on line 319 at the time of writing.