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.66k stars 287 forks source link

Error when invoking the open external command: Error in response: Unable to parse response as JSON #6412

Closed tekumara closed 2 years ago

tekumara commented 2 years ago

When trying to open a browser window from a terminal in a remote vscode ssh session, the browser window opens locally but the terminal shows the error message:

Error when invoking the open external command: Error in response: Unable to parse response as JSON
Logs ``` [14:50:35.405] Log Level: 2 [14:50:35.406] remote-ssh@0.76.1 [14:50:35.407] darwin x64 [14:50:35.410] SSH Resolver called for "ssh-remote+dev-tekumara-compute", attempt 1 [14:50:35.410] "remote.SSH.useLocalServer": true [14:50:35.411] "remote.SSH.path": undefined [14:50:35.411] "remote.SSH.configFile": undefined [14:50:35.411] "remote.SSH.useFlock": true [14:50:35.411] "remote.SSH.lockfilesInTmp": false [14:50:35.411] "remote.SSH.localServerDownload": auto [14:50:35.412] "remote.SSH.remoteServerListenOnSocket": false [14:50:35.412] "remote.SSH.showLoginTerminal": false [14:50:35.414] "remote.SSH.defaultExtensions": ["ms-python.python","ms-python.vscode-pylance"] [14:50:35.414] "remote.SSH.loglevel": 2 [14:50:35.414] "remote.SSH.maxReconnectionAttempts": 2 [14:50:35.414] "remote.SSH.enableDynamicForwarding": true [14:50:35.414] "remote.SSH.enableRemoteCommand": false [14:50:35.415] "remote.SSH.serverPickPortsFromRange": {} [14:50:35.415] "remote.SSH.serverInstallPath": {} [14:50:35.426] SSH Resolver called for host: dev-tekumara-compute [14:50:35.426] Setting up SSH remote "dev-tekumara-compute" [14:50:35.430] Acquiring local install lock: /var/folders/2w/6nppjrp17y7gzv799xt_18qh0000gp/T/vscode-remote-ssh-51d099b2-install.lock [14:50:35.433] Looking for existing server data file at /Users/tekumara/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-51d099b2-b5205cc8eb4fbaa726835538cd82372cc0222d43-0.76.1/data.json [14:50:35.435] Found local server running: {"remoteListeningOn":{"port":43879},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-nty4jvfXI6/agent.3401","display":"","tmpDir":"/run/user/1001","platform":"linux","connectionToken":"1111a111-11a1-11aa-111a-aa111a11a111","pid":3775,"ipcHandlePath":"/var/folders/2w/6nppjrp17y7gzv799xt_18qh0000gp/T/vscode-ssh-askpass-69ce4d85156a62fb2956fe968e6c1b0a64d9e5d7.sock","socksPort":49731,"startupTime":1646356085876} [14:50:35.438] Server delay-shutdown request failed: connect ECONNREFUSED /var/folders/2w/6nppjrp17y7gzv799xt_18qh0000gp/T/vscode-ssh-askpass-69ce4d85156a62fb2956fe968e6c1b0a64d9e5d7.sock [14:50:35.438] Existing server's health check failed, will start a new one [14:50:35.439] Using commit id "b5205cc8eb4fbaa726835538cd82372cc0222d43" and quality "stable" for server [14:50:35.443] Install and start server if needed [14:50:35.452] PATH: /Users/tekumara/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/tekumara/Library/Python/3.8/bin:/usr/local/go/bin:/Users/tekumara/.local/bin:/usr/local/opt/fzf/bin [14:50:35.452] Checking ssh with "ssh -V" [14:50:35.459] > OpenSSH_8.6p1, LibreSSL 2.8.3 [14:50:35.472] askpass server listening on /var/folders/2w/6nppjrp17y7gzv799xt_18qh0000gp/T/vscode-ssh-askpass-47cce870461253baf783792db61122216a22824e.sock [14:50:35.473] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/2w/6nppjrp17y7gzv799xt_18qh0000gp/T/vscode-ssh-askpass-de64461fcc4855740ac877f8f7aa2b876e0c09e8.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","51352","-o","ConnectTimeout=60","dev-tekumara-compute"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/tekumara/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-51d099b2-b5205cc8eb4fbaa726835538cd82372cc0222d43-0.76.1/data.json"} [14:50:35.473] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.r29nLbDNMg/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/tekumara/.vscode/extensions/ms-vscode-remote.remote-ssh-0.76.1/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/tekumara/.vscode/extensions/ms-vscode-remote.remote-ssh-0.76.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/2w/6nppjrp17y7gzv799xt_18qh0000gp/T/vscode-ssh-askpass-47cce870461253baf783792db61122216a22824e.sock"} [14:50:35.474] Spawned 5773 [14:50:35.592] > local-server-1> Spawned ssh, pid=5776 [14:50:35.595] stderr> OpenSSH_8.6p1, LibreSSL 2.8.3 [14:50:39.675] stderr> Connecting to instance i-08b599cf9562ef849 [14:50:45.644] stderr> debug1: Server host key: ssh-ed25519 SHA256:ariwhMj7qhD5p74U0zyKtNX6YrfEsjS6YqV6rZNxRdQ [14:50:46.818] stderr> Authenticated to dev-tekumara-compute (via proxy). [14:50:47.514] > ﺩ/|、 > (゚、 。7 > ︱ ︶ヽ > _U U c )/ > > Ubuntu 20.04.3 LTS (dt-setup-ubuntu v.86.e5829af) > > System information as of Fri Mar 4 01:50:46 UTC 2022 > > > 60 updates can be applied immediately. > To see these additional updates run: apt list --upgradable > > > *** System restart required *** [14:50:47.786] > ready: cc36d08941cd [14:50:48.074] > Linux 5.11.0-1028-aws #31~20.04.1-Ubuntu SMP Fri Jan 14 14:37:50 UTC 2022 [14:50:48.074] Platform: linux [14:50:48.348] > /usr/bin/zsh [14:50:48.349] Shell: zsh [14:50:48.349] Creating bash subshell inside "zsh" [14:50:48.622] > bash version: 5.0.17(1)-release [14:50:48.672] > bash version: 5.0.17(1)-release [14:50:48.722] > bash version: 5.0.17(1)-release [14:50:48.887] > bash version: 5.0.17(1)-release [14:50:48.888] > bash version: 5.0.17(1)-release [14:50:48.889] > bash version: 5.0.17(1)-release [14:50:49.212] > cc36d08941cd: running [14:50:49.262] > Acquiring lock on /home/compute/.vscode-server/bin/b5205cc8eb4fbaa726835538cd82372cc0222d43/vscode-remote-lock.compute.b5205cc8eb4fbaa726835538cd82372cc0222d43 [14:50:49.262] > Found existing installation at /home/compute/.vscode-server/bin/b5205cc8eb4fbaa726835538cd82372cc0222d43... > Checking /home/compute/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.log and /home/compute/.vscode-server/.b5205cc8eb4fbaa726835538cd82372cc0222d43.pid for a running server > Looking for server with pid: 3448 > Found running server... > Installing extensions... [14:50:49.396] > Installing extensions... [14:50:49.431] > Extension 'ms-python.python' v2022.2.1924087327 is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: 'ms-python.python@1.2.3'. [14:50:49.480] > Extension 'ms-python.vscode-pylance' v2022.3.0 is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: 'ms-python.vscode-pylance@1.2.3'. [14:50:49.481] > > * > * Reminder: You may only use this software with Visual Studio family products, > * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057) > * > > Checking server status on port 43879 with wget > cc36d08941cd: start > SSH_AUTH_SOCK==/tmp/ssh-tzZ79RIJYY/agent.8685== > DISPLAY==== > webUiAccessToken==== > listeningOn==43879== > osReleaseId==ubuntu== > arch==x86_64== > tmpDir==/run/user/1001== > platform==linux== > unpackResult==== > didLocalDownload==0== > downloadTime==== > installTime==== > extInstallTime==233== > serverStartTime==== > connectionToken==1111a111-11a1-11aa-111a-aa111a11a111== > cc36d08941cd: end [14:50:49.481] Received install output: SSH_AUTH_SOCK==/tmp/ssh-tzZ79RIJYY/agent.8685== DISPLAY==== webUiAccessToken==== listeningOn==43879== osReleaseId==ubuntu== arch==x86_64== tmpDir==/run/user/1001== platform==linux== unpackResult==== didLocalDownload==0== downloadTime==== installTime==== extInstallTime==233== serverStartTime==== connectionToken==1111a111-11a1-11aa-111a-aa111a11a111== [14:50:49.482] Remote server is listening on 43879 [14:50:49.482] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":43879},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-tzZ79RIJYY/agent.8685","display":"","tmpDir":"/run/user/1001","platform":"linux","connectionToken":"1111a111-11a1-11aa-111a-aa111a11a111"},"extInstallTime":233,"installUnpackCode":""} [14:50:49.483] Persisting server connection details to /Users/tekumara/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-51d099b2-b5205cc8eb4fbaa726835538cd82372cc0222d43-0.76.1/data.json [14:50:49.487] Starting forwarding server. localPort 51364 -> socksPort 51352 -> remotePort 43879 [14:50:49.487] Forwarding server listening on 51364 [14:50:49.487] Waiting for ssh tunnel to be ready [14:50:49.488] Tunneled 43879 to local port 51364 [14:50:49.488] Resolved "ssh-remote+dev-tekumara-compute" to "127.0.0.1:51364" [14:50:49.489] Updating $SSH_AUTH_SOCK: ln -f -s "/tmp/ssh-tzZ79RIJYY/agent.8685" "/run/user/1001/vscode-ssh-auth-sock-124234245" [14:50:49.489] Using cwd: vscode-remote://ssh-remote%2Bdev-tekumara-compute/ [14:50:49.489] Remote extension host environment: {"SSH_AUTH_SOCK":"/run/user/1001/vscode-ssh-auth-sock-124234245"} [14:50:49.491] [Forwarding server 51364] Got connection 0 [14:50:49.500] ------ [14:50:49.512] [Forwarding server 51364] Got connection 1 [14:50:50.067] [Forwarding server 51364] Got connection 2 [14:50:55.938] [Forwarding server 51364] Got connection 3 [14:50:55.939] [Forwarding server 51364] Got connection 4 [14:50:57.932] "Update SSH_AUTH_SOCK" terminal command done ```

Steps to Reproduce:

  1. Connect to a remote machine.
  2. In the vscode terminal on the remote run: code --openExternal https://wikipedia.org/

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

danbider commented 2 years ago

Experiencing the same issue.

blaw36 commented 2 years ago

Also experiencing the same issue!

AI-Gio commented 2 years ago

I have the same problem. Now I notice this happening when I interrupt the program in vscode before closing the browser page. When doing that I have to wait a couple of minutes and restart the terminal again before it working again. So try to just close the browser page first and let the program stop by itself instead of manually stopping the program.

Tyriar commented 2 years ago

@tanhakabir this is likely related to the remote CLI

thomassajot commented 2 years ago

Experiencing the same issue. I installed jupyter using pip and conda.

jccurtis commented 2 years ago

Until @aeschli's fix goes into the next release, those encountering this with jupyter and forwarding a port (i.e. not running within VSCode via the python extension) can start the server without launching the browser:

jupyter-notebook --no-browser

Thanks @aeschli for the quick fix 😄