bash: line 1: syntax error near unexpected token `done'
- VSCode Version: 1.64.2
- Local OS Version: 1.64.2
- Remote OS Version: Arch Linux 5.16.9-zen1-1-zen
- Remote Extension/Connection Type: SSH
- Logs:
[10:04:25.870] > ready: 14ba7d5ad77f
[10:04:25.874] > Linux 5.16.9-zen1-1-zen #1 ZEN SMP PREEMPT Fri, 11 Feb 2022 22:42:03 +0000
[10:04:25.874] Platform: linux
[10:04:25.890] stderr> bash: line 1: syntax error near unexpected token
done' [10:04:25.890] stderr> bash: line 1:done' [10:04:25.891] > Installing to ... [10:04:25.891] stderr> zsh: parse error near `}' [10:04:25.893] > 14ba7d5ad77f%%1%% [10:04:25.905] > Downloading with wget [10:04:26.049] > wget download failed
SSL_INIT https://update.code.visualstudio.com/commit:/server-darwin/stable: 2022-02-15 10:04:26 ERROR 404: Not Found. [10:04:26.053] > 14ba7d5ad77f%%2%%
Steps to Reproduce:
- Install latest version
- Open SSH-connection
Does this issue occur when you try this locally?: Yes/No Does this issue occur when you try this locally and all extensions are disabled?: Yes/No
I'm experience the same error. It seemed to coincide with doing an Arch update.
A few other error messages:
[09:52:56.784] > ready: 2dd6fdf9f1ec
[09:52:56.786] > Linux 5.16.9-arch1-1 #1 SMP PREEMPT Fri, 11 Feb 2022 22:42:06 +0000
[09:52:56.786] Platform: linux
[09:52:56.790] stderr> bash: line 1: syntax error near unexpected token `done'
[09:52:56.790] stderr> bash: line 1: `done'
[09:52:56.790] stderr> zsh: parse error near `}'
[09:52:56.790] > Installing to ...
[09:52:56.791] stderr> do_host_download:1: command not found: millis
[09:52:56.791] > 2dd6fdf9f1ec%%1%%
[09:52:56.794] > Downloading with curl
[09:52:56.796] stderr> % Total % Received % Xferd Average Speed Time Time Time Current
[09:52:56.796] stderr> Dload Upload Total Spent Left Speed
[09:52:56.796] stderr> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[09:52:57.351] stderr> 100 167 100 167 0 0 301 0 --:--:-- --:--:-- --:--:-- 301
[09:52:57.354] > curl download failed
> 404
> 2dd6fdf9f1ec%%2%%
> tar --version:
[09:52:57.354] stderr> do_host_download:38: command not found: printenv_indent
[09:52:57.355] stderr> do_client_download_or_fail:8: command not found: fail_with_exitcode
[09:52:57.355] stderr> do_install:1: command not found: millis
[09:52:57.356] > tar (GNU tar) 1.34
> Copyright (C) 2021 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.
> ERROR: tar exited with non-0 exit code: 0
[09:52:57.357] stderr> tar: This does not look like a tar archive
[09:52:57.357] stderr>
[09:52:57.357] stderr> gzip: stdin: not in gzip format
[09:52:57.358] stderr> tar: Child returned status 1
[09:52:57.358] stderr> tar: Error is not recoverable: exiting now
[09:52:57.362] stderr> do_install:8: command not found: elapsed
[09:52:57.363] stderr> do_client_download_or_fail:8: command not found: fail_with_exitcode
[09:52:57.363] stderr> do_install:1: command not found: millis
[09:52:57.364] > 2dd6fdf9f1ec%%2%%
@dancrossnyc Are you (also) running ZSH? Changing to bash (again) 'fixed' the issue.
I am running zsh; switching to bash is fine as a temporary workaround, but seems less than ideal.
@dancrossnyc Yep, I also need to run ZSH as I'm using plugins/aliases. Hopefully this issue will be fixed soon.
Been tormented by this problem repeatedly for the past two days, and accidentally found that downgrading the version to v0.70.0 can solve it for me.

Duplicate of https://github.com/microsoft/vscode-remote-release/issues/6341
Investigating this now
There will be a fix for this out in tomorrow's pre-release after 8am PST. Let me know if this fixes it for you all.
I changed my shell on my Linux dev box back to zsh and restarted Code with this morning's Remote update and things seem to be working again. Thanks for the quick turnaround, @tanhakabir!
I just experienced the same problem and switching to the pre-release version has fixed the issue!
@tanhakabir I switched to pre-release but I'm still plagued by the same issue
[01:45:03.877] "remote.SSH.useLocalServer": true
[01:45:03.877] "remote.SSH.path": undefined
[01:45:03.877] "remote.SSH.configFile": undefined
[01:45:03.877] "remote.SSH.useFlock": true
[01:45:03.877] "remote.SSH.lockfilesInTmp": false
[01:45:03.877] "remote.SSH.localServerDownload": auto
[01:45:03.877] "remote.SSH.remoteServerListenOnSocket": false
[01:45:03.877] "remote.SSH.showLoginTerminal": false
[01:45:03.878] "remote.SSH.defaultExtensions": []
[01:45:03.878] "remote.SSH.loglevel": 2
[01:45:03.878] "remote.SSH.enableDynamicForwarding": true
[01:45:03.878] "remote.SSH.enableRemoteCommand": false
[01:45:03.878] "remote.SSH.serverPickPortsFromRange": {}
[01:45:03.878] "remote.SSH.serverInstallPath": {}
[01:45:03.880] SSH Resolver called for host: x
[01:45:03.880] Setting up SSH remote "x"
[01:45:03.882] Acquiring local install lock: /var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-remote-ssh-4516543b-install.lock
[01:45:03.883] Looking for existing server data file at /Users/hasaber8/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4516543b-f80445acd5a3dadef24aa209168452a3d97cc326-0.75.2022022515/data.json
[01:45:03.884] Using commit id "f80445acd5a3dadef24aa209168452a3d97cc326" and quality "stable" for server
[01:45:03.886] Install and start server if needed
[01:45:03.889] PATH: /opt/homebrew/opt/[email protected]/bin:/opt/homebrew/Caskroom/miniforge/base/bin:/opt/homebrew/Caskroom/miniforge/base/condabin:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
[01:45:03.889] Checking ssh with "ssh -V"
[01:45:03.897] > OpenSSH_8.6p1, LibreSSL 2.8.3
[01:45:03.899] askpass server listening on /var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-ssh-askpass-41ad28ba994b55feef6234f9c92f8f2ca87dd11a.sock
[01:45:03.899] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-ssh-askpass-367af6e153171750e10affb0ca725793f23eaa6e.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","57719","-o","ConnectTimeout=15","x"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/hasaber8/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4516543b-f80445acd5a3dadef24aa209168452a3d97cc326-0.75.2022022515/data.json"}
[01:45:03.899] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.W3mDNkMro9/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-ssh-askpass-41ad28ba994b55feef6234f9c92f8f2ca87dd11a.sock"}
[01:45:03.900] Spawned 16910
[01:45:03.973] > local-server-1> Spawned ssh, pid=16918
[01:45:03.975] stderr> OpenSSH_8.6p1, LibreSSL 2.8.3
[01:45:05.197] stderr> debug1: Server host key: ssh-ed25519 SHA256:7eEXJlvENYi9PqBL6wx/inErD+dmXs6phjtgcF5Q5So
[01:45:06.752] stderr> Authenticated to x ([x]:22).
[01:45:07.944] > ready: 9f80301612f2
[01:45:08.228] > Linux 5.16.0-1-amd64 #1 SMP PREEMPT Debian 5.16.7-2 (2022-02-09)
[01:45:08.228] Platform: linux
[01:45:08.588] > /bin/bash
[01:45:08.589] Shell: bash
[01:45:08.874] > 9f80301612f2: running
[01:45:08.889] stderr> cat: '/libx32/libstdc++.so.6'$'\n''/lib/x86_64-linux-gnu/libstdc++.so.6'$'\n''/lib32/libstdc++.so.6'
[01:45:08.889] stderr> : No such file or directory
[01:45:08.900] > Missing GLIBCXX >= 3.4.18!
> Found versions
[01:45:08.929] stderr> mainScriptWrapper:185: bad math expression: operand expected at `*100 + '
[01:45:08.929] stderr> Transferred: sent 18768, received 3516 bytes, in 2.2 seconds
[01:45:08.929] stderr> Bytes per second: sent 8621.3, received 1615.1
[01:45:08.929] > local-server-1> ssh child died, shutting down
[01:45:08.932] Local server exit: 0
[01:45:08.932] Received install output: local-server-1> Spawned ssh, pid=16918
OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Server host key: ssh-ed25519 SHA256:7eEXJlvENYi9PqBL6wx/inErD+dmXs6phjtgcF5Q5So
Authenticated to x ([x]:22).
ready: 9f80301612f2
Linux 5.16.0-1-amd64 #1 SMP PREEMPT Debian 5.16.7-2 (2022-02-09)
/bin/bash
9f80301612f2: running
cat: '/libx32/libstdc++.so.6'$'\n''/lib/x86_64-linux-gnu/libstdc++.so.6'$'\n''/lib32/libstdc++.so.6'
: No such file or directory
Missing GLIBCXX >= 3.4.18!
Found versions
mainScriptWrapper:185: bad math expression: operand expected at `*100 + '
Transferred: sent 18768, received 3516 bytes, in 2.2 seconds
Bytes per second: sent 8621.3, received 1615.1
local-server-1> ssh child died, shutting down
[01:45:08.933] Failed to parse remote port from server output
[01:45:08.933] Resolver error: Error:
at Function.Create (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:586041)
at Object.t.handleInstallOutput (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:584693)
at Object.e [as tryInstallWithLocalServer] (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:625033)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:644084
at async Object.t.withShowDetailsEvent (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:647831)
at async /Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:623505
at async b (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:620011)
at async Object.t.resolveWithLocalServer (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:623120)
at async Object.t.resolve (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:645441)
at async /Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:722881
[01:45:08.936] ------
@tanhakabir I switched to pre-release but I'm still plagued by the same issue
[01:45:03.877] "remote.SSH.useLocalServer": true [01:45:03.877] "remote.SSH.path": undefined [01:45:03.877] "remote.SSH.configFile": undefined [01:45:03.877] "remote.SSH.useFlock": true [01:45:03.877] "remote.SSH.lockfilesInTmp": false [01:45:03.877] "remote.SSH.localServerDownload": auto [01:45:03.877] "remote.SSH.remoteServerListenOnSocket": false [01:45:03.877] "remote.SSH.showLoginTerminal": false [01:45:03.878] "remote.SSH.defaultExtensions": [] [01:45:03.878] "remote.SSH.loglevel": 2 [01:45:03.878] "remote.SSH.enableDynamicForwarding": true [01:45:03.878] "remote.SSH.enableRemoteCommand": false [01:45:03.878] "remote.SSH.serverPickPortsFromRange": {} [01:45:03.878] "remote.SSH.serverInstallPath": {} [01:45:03.880] SSH Resolver called for host: x [01:45:03.880] Setting up SSH remote "x" [01:45:03.882] Acquiring local install lock: /var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-remote-ssh-4516543b-install.lock [01:45:03.883] Looking for existing server data file at /Users/hasaber8/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4516543b-f80445acd5a3dadef24aa209168452a3d97cc326-0.75.2022022515/data.json [01:45:03.884] Using commit id "f80445acd5a3dadef24aa209168452a3d97cc326" and quality "stable" for server [01:45:03.886] Install and start server if needed [01:45:03.889] PATH: /opt/homebrew/opt/[email protected]/bin:/opt/homebrew/Caskroom/miniforge/base/bin:/opt/homebrew/Caskroom/miniforge/base/condabin:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin [01:45:03.889] Checking ssh with "ssh -V" [01:45:03.897] > OpenSSH_8.6p1, LibreSSL 2.8.3 [01:45:03.899] askpass server listening on /var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-ssh-askpass-41ad28ba994b55feef6234f9c92f8f2ca87dd11a.sock [01:45:03.899] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-ssh-askpass-367af6e153171750e10affb0ca725793f23eaa6e.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","57719","-o","ConnectTimeout=15","x"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/hasaber8/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-4516543b-f80445acd5a3dadef24aa209168452a3d97cc326-0.75.2022022515/data.json"} [01:45:03.899] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.W3mDNkMro9/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/cm/wy_jvxdj4n16z54ht3tppt0c0000gn/T/vscode-ssh-askpass-41ad28ba994b55feef6234f9c92f8f2ca87dd11a.sock"} [01:45:03.900] Spawned 16910 [01:45:03.973] > local-server-1> Spawned ssh, pid=16918 [01:45:03.975] stderr> OpenSSH_8.6p1, LibreSSL 2.8.3 [01:45:05.197] stderr> debug1: Server host key: ssh-ed25519 SHA256:7eEXJlvENYi9PqBL6wx/inErD+dmXs6phjtgcF5Q5So [01:45:06.752] stderr> Authenticated to x ([x]:22). [01:45:07.944] > ready: 9f80301612f2 [01:45:08.228] > Linux 5.16.0-1-amd64 #1 SMP PREEMPT Debian 5.16.7-2 (2022-02-09) [01:45:08.228] Platform: linux [01:45:08.588] > /bin/bash [01:45:08.589] Shell: bash [01:45:08.874] > 9f80301612f2: running [01:45:08.889] stderr> cat: '/libx32/libstdc++.so.6'$'\n''/lib/x86_64-linux-gnu/libstdc++.so.6'$'\n''/lib32/libstdc++.so.6' [01:45:08.889] stderr> : No such file or directory [01:45:08.900] > Missing GLIBCXX >= 3.4.18! > Found versions [01:45:08.929] stderr> mainScriptWrapper:185: bad math expression: operand expected at `*100 + ' [01:45:08.929] stderr> Transferred: sent 18768, received 3516 bytes, in 2.2 seconds [01:45:08.929] stderr> Bytes per second: sent 8621.3, received 1615.1 [01:45:08.929] > local-server-1> ssh child died, shutting down [01:45:08.932] Local server exit: 0 [01:45:08.932] Received install output: local-server-1> Spawned ssh, pid=16918 OpenSSH_8.6p1, LibreSSL 2.8.3 debug1: Server host key: ssh-ed25519 SHA256:7eEXJlvENYi9PqBL6wx/inErD+dmXs6phjtgcF5Q5So Authenticated to x ([x]:22). ready: 9f80301612f2 Linux 5.16.0-1-amd64 #1 SMP PREEMPT Debian 5.16.7-2 (2022-02-09) /bin/bash 9f80301612f2: running cat: '/libx32/libstdc++.so.6'$'\n''/lib/x86_64-linux-gnu/libstdc++.so.6'$'\n''/lib32/libstdc++.so.6' : No such file or directory Missing GLIBCXX >= 3.4.18! Found versions mainScriptWrapper:185: bad math expression: operand expected at `*100 + ' Transferred: sent 18768, received 3516 bytes, in 2.2 seconds Bytes per second: sent 8621.3, received 1615.1 local-server-1> ssh child died, shutting down [01:45:08.933] Failed to parse remote port from server output [01:45:08.933] Resolver error: Error: at Function.Create (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:586041) at Object.t.handleInstallOutput (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:584693) at Object.e [as tryInstallWithLocalServer] (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:625033) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async /Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:644084 at async Object.t.withShowDetailsEvent (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:647831) at async /Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:623505 at async b (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:620011) at async Object.t.resolveWithLocalServer (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:623120) at async Object.t.resolve (/Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:645441) at async /Users/hasaber8/.vscode/extensions/ms-vscode-remote.remote-ssh-0.75.2022022515/out/extension.js:1:722881 [01:45:08.936] ------
Update: Got fixed by switching back to zsh as default shell
@Hasaber8 your issue looked different with Missing GLIBCXX >= 3.4.18! as the error
@Hasaber8 your issue looked different with
Missing GLIBCXX >= 3.4.18!as the error
actually, I was reading about the issue and someone suggested switching the default shell to bash, which messed it up actually leading to the above error, I switched it back to zsh and bam, it worked.
Which makes me wonder why it is broken on bash now + I have that version of the module its requesting.
@Hasaber8 I'm not sure, we didn't change anything for remote bash shells
@Hasaber8 I'm not sure, we didn't change anything for remote bash shells
I'll try to debug it and let you know😄
@Hasaber8 you could try using bash as the default shell with an older version of the SSH extension and VS Code?
Sure, I'll try that
@Hasaber8 have you had it working facing the same issue
bash version: 5.0.17(1)-release
[13:00:12.618] > ae7cd3d1b928: running
[13:00:12.629] stderr> Illegal option -p
[13:00:12.631] stderr> musl libc (x86_64)
[13:00:12.631] stderr> Version 1.1.24
[13:00:12.631] stderr> Dynamic Program Loader
[13:00:12.632] stderr> Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
[13:00:12.632] > Missing GLIBC >= 2.17!
> Found version
Thanks
@andodeki you can create a separate issue with your full log and I can help you there!