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

[ssh] connecting to Alpine < 2.7 results in script syntax error: unexpected token `(' #4394

Open aeschli opened 3 years ago

aeschli commented 3 years ago

Verifying #2271

Remote- SSH: v2021.1.35460

image

[11:32:36.381] Log Level: 2
[11:32:36.383] remote-ssh-nightly@2021.1.35460
[11:32:36.383] linux x64
[11:32:36.384] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a226c6f63616c686f7374222c2275736572223a22726f6f74222c22706f7274223a323232327d", attempt 1
[11:32:36.384] "remote.SSH.useLocalServer": true
[11:32:36.385] "remote.SSH.sshPath": undefined
[11:32:36.385] "remote.SSH.sshConfigurationFile": undefined
[11:32:36.385] "remote.SSH.useFlock": true
[11:32:36.385] "remote.SSH.lockfilesInTmp": false
[11:32:36.385] "remote.SSH.localServerDownload": auto
[11:32:36.385] "remote.SSH.remoteServerListenOnSocket": false
[11:32:36.385] "remote.SSH.showLoginTerminal": false
[11:32:36.386] SSH Resolver called for host: root@localhost
[11:32:36.386] Setting up SSH remote "localhost"
[11:32:36.388] Acquiring local install lock: /tmp/vscode-remote-ssh-root@localhost-install.lock
[11:32:36.395] Looking for existing server data file at /home/martin/.config/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-root@localhost-5a52bc29d5e9bc419077552d336ea26d904299fa-2021.1.35460/data.json
[11:32:36.395] Using commit id "5a52bc29d5e9bc419077552d336ea26d904299fa" and quality "insider" for server
[11:32:36.398] Install and start server if needed
[11:32:36.412] Checking ssh with "ssh -V"
[11:32:36.418] > OpenSSH_8.0p1 Ubuntu-6build1, OpenSSL 1.1.1c  28 May 2019

[11:32:36.422] askpass server listening on /run/user/1000/vscode-ssh-askpass-7ef36ac7ef1dd8e12d3f57fc01e8152e36de6608.sock
[11:32:36.422] Spawning local server with {"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-1f39d5e4b27cf37e4084dc7583beb2f8838ce9b2.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","46431","-o","ConnectTimeout=15","-p","2222","root@localhost"],"dataFilePath":"/home/martin/.config/Code - Insiders/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-root@localhost-5a52bc29d5e9bc419077552d336ea26d904299fa-2021.1.35460/data.json"}
[11:32:36.422] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/usr/share/code-insiders/code-insiders","VSCODE_SSH_ASKPASS_MAIN":"/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-7ef36ac7ef1dd8e12d3f57fc01e8152e36de6608.sock"}
[11:32:36.425] Spawned 26400
[11:32:36.504] > local-server> Spawned ssh: 26408
[11:32:36.506] stderr> OpenSSH_8.0p1 Ubuntu-6build1, OpenSSL 1.1.1c  28 May 2019
[11:32:36.517] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:BPSvKHL5IkQs9h/WzGRTnvP8yk2SEj6JOdvvnzrChqs
[11:32:36.600] Got askpass request: {"request":"root@localhost's password:"}
[11:32:36.600] Showing password prompt
[11:32:36.601] Listening for interwindow password on /run/user/1000/vscode-ssh-askpass-367b6b31ff984e87795c1525910ceffac0c3d820.sock
[11:32:36.601] Writing password prompt to globalState
[11:32:41.518] Got password response
[11:32:41.519] Interactor gave response: ********
[11:32:41.519] Cleaning up other-window auth server
[11:32:41.537] stderr> Authenticated to localhost ([127.0.0.1]:2222).
[11:32:41.539] > ready: d681ce39a5ec
[11:32:41.540] > Linux 5.3.0-64-generic #58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020
[11:32:41.540] Platform: linux
[11:32:41.550] stderr> bash: line 498: syntax error near unexpected token `('
[11:32:41.550] stderr> bash: line 498: `echo "* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)"'
[11:32:41.551] stderr> -ash: syntax error: unexpected redirection
[11:32:41.551] stderr> Transferred: sent 18172, received 3200 bytes, in 0.0 seconds
[11:32:41.552] stderr> Bytes per second: sent 1292066.3, received 227526.5
[11:32:41.552] > local-server> ssh child died, shutting down
[11:32:41.555] Local server exit: 0
[11:32:41.555] Received install output: OpenSSH_8.0p1 Ubuntu-6build1, OpenSSL 1.1.1c  28 May 2019
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:BPSvKHL5IkQs9h/WzGRTnvP8yk2SEj6JOdvvnzrChqs
Authenticated to localhost ([127.0.0.1]:2222).
ready: d681ce39a5ec
Linux 5.3.0-64-generic #58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020
bash: line 498: syntax error near unexpected token `('
bash: line 498: `echo "* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)"'
-ash: syntax error: unexpected redirection
Transferred: sent 18172, received 3200 bytes, in 0.0 seconds
Bytes per second: sent 1292066.3, received 227526.5

[11:32:41.556] Stopped parsing output early. Remaining text: OpenSSH_8.0p1 Ubuntu-6build1, OpenSSL 1.1.1c  28 May 2019debug1: Server host key: ecdsa-sha2-nistp256 SHA256:BPSvKHL5IkQs9h/WzGRTnvP8yk2SEj6JOdvvnzrChqsAuthenticated to localhost ([127.0.0.1]:2222).ready: d681ce39a5ecLinux 5.3.0-64-generic #58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020bash: line 498: syntax error near unexpected token `('bash: line 498: `echo "* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)"'-ash: syntax error: unexpected redirectionTransferred: sent 18172, received 3200 bytes, in 0.0 secondsBytes per second: sent 1292066.3, received 227526.5
[11:32:41.556] Failed to parse remote port from server output
[11:32:41.564] Resolver error: Error: 
    at Function.Create (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:64027)
    at Object.t.handleInstallOutput (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:62766)
    at Object.t.tryInstallWithLocalServer (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:405103)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:310398
    at async Object.t.withShowDetailsEvent (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:405859)
    at async /home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:403627
    at async S (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:400395)
    at async Object.t.resolveWithLocalServer (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:403254)
    at async Object.t.resolve (/home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:1:314401)
    at async /home/martin/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-nightly-2021.1.35460/out/extension.js:127:110333
[11:32:41.568] ------
roblourens commented 3 years ago

There is something very weird going on. Even if I replace the entire script with a simple "echo", it still doesn't work. If I run a script with the default shell "ash" instead of "bash" it works. Is there something weird about "bash" in that container? Looks fine

image

davidwincent commented 2 years ago

I get the same problem with the default colima vm, which is also based on Alpine linux.

VS Code Version: 1.64.2
Commit: f80445acd5a3dadef24aa209168452a3d97cc326
Date: 2022-02-09T22:00:56.651Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.3.0