Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: BadInstallScriptResult (Got bad result from install script) #10758

Open
6 tasks done
andprov opened this issue Mar 6, 2025 · 12 comments
Open
6 tasks done

Error: BadInstallScriptResult (Got bad result from install script) #10758

andprov opened this issue Mar 6, 2025 · 12 comments
Assignees
Labels
ssh Issue in vscode-remote SSH

Comments

@andprov
Copy link

andprov commented Mar 6, 2025

Is there an existing issue for this bug?

  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.

Required Troubleshooting Steps

  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar

[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I COULD successfully SSH to the remote machine with the generated SSH command

Remote-SSH Log

Remote-SSH Log

[22:47:15.456] Log Level: 2
[22:47:15.476] SSH Resolver called for "ssh-remote+dev", attempt 1
[22:47:15.479] remote.SSH.useLocalServer = false
[22:47:15.479] remote.SSH.useExecServer = true
[22:47:15.479] remote.SSH.bindHost = {}
[22:47:15.479] remote.SSH.showLoginTerminal = false
[22:47:15.480] remote.SSH.remotePlatform = {"dev":"linux"}
[22:47:15.480] remote.SSH.path = undefined
[22:47:15.480] remote.SSH.configFile = undefined
[22:47:15.480] remote.SSH.useFlock = true
[22:47:15.480] remote.SSH.lockfilesInTmp = false
[22:47:15.480] remote.SSH.localServerDownload = auto
[22:47:15.480] remote.SSH.remoteServerListenOnSocket = false
[22:47:15.480] remote.SSH.defaultExtensions = []
[22:47:15.481] remote.SSH.defaultExtensionsIfInstalledLocally = []
[22:47:15.481] remote.SSH.loglevel = 2
[22:47:15.481] remote.SSH.enableDynamicForwarding = true
[22:47:15.481] remote.SSH.enableRemoteCommand = false
[22:47:15.481] remote.SSH.serverPickPortsFromRange = {}
[22:47:15.481] remote.SSH.serverInstallPath = {}
[22:47:15.481] remote.SSH.permitPtyAllocation = false
[22:47:15.481] remote.SSH.preferredLocalPortRange = undefined
[22:47:15.482] remote.SSH.useCurlAndWgetConfigurationFiles = false
[22:47:15.482] remote.SSH.experimental.chat = false
[22:47:15.482] remote.SSH.experimental.enhancedSessionLogs = false
[22:47:15.482] remote.SSH.httpProxy = {}
[22:47:15.482] remote.SSH.httpsProxy = {}
[22:47:15.493] VS Code version: 1.98.0
[22:47:15.493] Remote-SSH version: remote-ssh@0.118.0
[22:47:15.493] win32 x64
[22:47:15.498] SSH Resolver called for host: dev
[22:47:15.498] Setting up SSH remote "dev"
[22:47:15.507] Using commit id "6609ac3d66f4eade5cf376d1cb76f13985724bcb" and quality "stable" for server
[22:47:15.507] Extensions to install: 
[22:47:15.512] Install and start server if needed
[22:47:15.515] Checking ssh with "C:\Program Files\Zulu\zulu-17\bin\ssh.exe -V"
[22:47:15.517] Got error from ssh: spawn C:\Program Files\Zulu\zulu-17\bin\ssh.exe ENOENT
[22:47:15.517] Checking ssh with "C:\Program Files\Microsoft MPI\Bin\ssh.exe -V"
[22:47:15.518] Got error from ssh: spawn C:\Program Files\Microsoft MPI\Bin\ssh.exe ENOENT
[22:47:15.518] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[22:47:15.519] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[22:47:15.519] Checking ssh with "C:\Windows\ssh.exe -V"
[22:47:15.520] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[22:47:15.520] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[22:47:15.520] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[22:47:15.520] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[22:47:15.521] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[22:47:15.521] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[22:47:15.539] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

[22:47:15.542] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 58785 dev sh
[22:47:15.543] Generated SSH command: 'type "C:\Users\user\AppData\Local\Temp\vscode-linux-multi-line-command-dev-593493515.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 58785 dev sh'
[22:47:15.544] Using connect timeout of 17 seconds
[22:47:15.544] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[22:47:15.741] > 
[22:47:15.741] Got some output, clearing connection timeout
[22:47:17.050] "install" terminal command done
[22:47:17.050] Install terminal quit with output: 
[22:47:17.051] Resolver error: Error: Got bad result from install script
	at y.Create (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:740625)
	at t.tryInstall (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:856042)
	at async c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:815123
	at async t.withShowDetailsEvent (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:818374)
	at async R (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:811578)
	at async t.resolve (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:815775)
	at async c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:1102718
[22:47:17.056] ------




[22:47:17.056]  ---------- [Session Summary] ----------- 
[22:47:17.056] [BadInstallScriptResult]: Error: BadInstallScriptResult (Got bad result from install script)
[22:47:17.056]  ---------------------------------------- 
[22:47:17.728] Opening exec server for ssh-remote+dev
[22:47:17.882] Initizing new exec server for ssh-remote+dev
[22:47:17.882] Using commit id "6609ac3d66f4eade5cf376d1cb76f13985724bcb" and quality "stable" for server
[22:47:17.882] Extensions to install: 
[22:47:17.903] Opening exec server for ssh-remote+dev
[22:47:17.914] Install and start server if needed
[22:47:17.917] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 58785 dev sh
[22:47:17.918] Generated SSH command: 'type "C:\Users\user\AppData\Local\Temp\vscode-linux-multi-line-command-dev-749145444.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 58785 dev sh'
[22:47:17.918] Using connect timeout of 17 seconds
[22:47:17.918] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[22:47:18.138] > 
[22:47:18.138] Got some output, clearing connection timeout
[22:47:18.341] > ccaef1e90359: running
> Script executing under PID: 46223
[22:47:18.357] > Found existing installation at /home/user/.vscode-server...
> Starting VS Code CLI...
> Removing old logfile at /home/user/.vscode-server/.cli.6609ac3d66f4eade5cf376d1cb76f13985724bcb.log
> Spawned remote CLI: 46241
[22:47:18.372] > Waiting for server log...
[22:47:18.387] > ccaef1e90359: start
> listeningOn==127.0.0.1:34089==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==40==
> execServerToken==aa111a11-11aa-1a1a-aa1a-111aa1111a1a==
> platformDownloadPath==cli-alpine-x64==
> SSH_AUTH_SOCK====
> DISPLAY====
> ccaef1e90359: end
[22:47:18.387] Received install output: 
listeningOn==127.0.0.1:34089==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==40==
execServerToken==aa111a11-11aa-1a1a-aa1a-111aa1111a1a==
platformDownloadPath==cli-alpine-x64==
SSH_AUTH_SOCK====
DISPLAY====

[22:47:18.388] Remote server is listening on port 34089
[22:47:18.388] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":34089},"osReleaseId":"ubuntu","arch":"x86_64","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","execServerToken":"aa111a11-11aa-1a1a-aa1a-111aa1111a1a"},"serverStartTime":40,"installUnpackCode":""}
[22:47:18.391] Starting forwarding server. local port 58798 -> socksPort 58785 -> remotePort 34089
[22:47:18.392] Forwarding server listening on port 58798
[22:47:18.392] Waiting for ssh tunnel to be ready
[22:47:18.393] [Forwarding server port 58798] Got connection 0
[22:47:18.394] Tunneled port 34089 to local port 58798
[22:47:18.394] Resolved "ssh-remote+dev" to "port 58798"
[22:47:18.394] Resolving exec server at port 58798
[22:47:18.395] [Forwarding server port 58798] Got connection 1
[22:47:18.441] Exec server for ssh-remote+dev created and cached
[22:47:18.441]  ---------- [Session Summary] ----------- 
[22:47:18.441] [BadInstallScriptResult]: Error: BadInstallScriptResult (Got bad result from install script)
[22:47:18.441]  ---------------------------------------- 
[22:47:18.442] Verified and reusing cached exec server for ssh-remote+dev
[22:47:18.442]  ---------- [Session Summary] ----------- 
[22:47:18.443] [BadInstallScriptResult]: Error: BadInstallScriptResult (Got bad result from install script)
[22:47:18.443]  ---------------------------------------- 
[22:47:18.486] Opening exec server for ssh-remote+dev
[22:47:18.489] Verified and reusing cached exec server for ssh-remote+dev
[22:47:18.489]  ---------- [Session Summary] ----------- 
[22:47:18.489] [BadInstallScriptResult]: Error: BadInstallScriptResult (Got bad result from install script)
[22:47:18.489]  ---------------------------------------- 

Expected Behavior

Connecting to a remote host and successfully working with project files and folders.

Actual Behavior

After successfully connecting to the host, the connection to the host is lost when attempting to open the project folder.

Steps To Reproduce

  1. Select the host name in the "Connect to Host" menu
  2. After connecting, open the project folder via File -> Open Folder and select the project folder
  3. Get an error - Cold not establish connection to "HOST NAME": Got bad result from install script.

Anything else?

This behavior started after updating VSCode to version 1.98.0. If I install the previous version, everything works fine.
OS: Windows 11
Host: Ubuntu 24.04

When I work on Ubuntu and connect to the same host, there is no such issue. It only occurs when working from Windows.
When connecting to the host via the terminal, everything works perfectly.
I tried reinstalling the .vscode-server on the host. This does not resolve the issue.

@andprov andprov added the ssh Issue in vscode-remote SSH label Mar 6, 2025
@andprov
Copy link
Author

andprov commented Mar 6, 2025

Logs on the host ~$ sudo tail -f /var/log/auth.log :

2025-03-07T01:20:25.445123+03:00 dev sshd[56178]: Accepted publickey for <user> from 192.168.1.116 port 60813 ssh2: RSA SHA256:2XTPup1bGr+msqJc2kGHsuMZrwwa3
2025-03-07T01:20:25.446944+03:00 dev sshd[56178]: pam_unix(sshd:session): session opened for user <user>(uid=1000) by <user>(uid=0)
2025-03-07T01:20:25.450730+03:00 dev systemd-logind[678]: New session 369 of user <user>.
2025-03-07T01:20:36.068824+03:00 dev sshd[56235]: Received disconnect from 192.168.1.116 port 60813:11: disconnected by user
2025-03-07T01:20:36.069284+03:00 dev sshd[56235]: Disconnected from user <user>192.168.1.116 port 60813
2025-03-07T01:20:36.069540+03:00 dev sshd[56178]: pam_unix(sshd:session): session closed for user <user>
2025-03-07T01:20:36.072211+03:00 dev systemd-logind[678]: Session 369 logged out. Waiting for processes to exit.
2025-03-07T01:20:37.080229+03:00 dev sshd[56414]: Connection reset by 192.168.1.116 port 60847 [preauth]
2025-03-07T01:20:39.469361+03:00 dev sshd[56416]: Accepted publickey for <user>from 192.168.1.116 port 60853 ssh2: RSA SHA256:2XTPup1bGr+msqJc2kGHsuMZrwwa3
2025-03-07T01:20:39.471337+03:00 dev sshd[56416]: pam_unix(sshd:session): session opened for user <user>(uid=1000) by <user>(uid=0)
2025-03-07T01:20:39.475204+03:00 dev systemd-logind[678]: New session 370 of user <user>.

@andprov
Copy link
Author

andprov commented Mar 6, 2025

cmd > ssh -i C:\Users\user\.ssh\key -v -T -D 53961 user@192.168.1.152 sh :

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug1: Reading configuration data C:\\Users\\user/.ssh/config
debug1: Connecting to 192.168.1.152 [192.168.1.152] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\user\\.ssh\\key type 0
debug1: identity file C:\\Users\\user\\.ssh\\key-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_9.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6p1 Ubuntu-3ubuntu13.8
debug1: compat_banner: match: OpenSSH_9.6p1 Ubuntu-3ubuntu13.8 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.1.152:22 as 'user'
debug1: load_hostkeys: fopen C:\\Users\\user/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:ZllXWwnsPWeHUhcN
debug1: load_hostkeys: fopen C:\\Users\\user/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: Host '192.168.1.152' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\user/.ssh/known_hosts:5
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: C:\\Users\\user\\.ssh\\key RSA SHA256:2XTPup1bGr+msqJc2kGHsuMZrwwa3 explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_check_ver: publickey-hostbound@openssh.com=<0>
debug1: kex_ext_info_check_ver: ping@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\user\\.ssh\\key RSA SHA256:2XTPup1bGr+msqJc2kGHsuMZrwwa3 explicit agent
debug1: Server accepts key: C:\\Users\\user\\.ssh\\key RSA SHA256:2XTPup1bGr+msqJc2kGHsuMZrwwa3 explicit agent
Authenticated to 192.168.1.152 ([192.168.1.152]:22) using "publickey".
debug1: Local connections to LOCALHOST:53961 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 53961.
debug1: channel 0: new port-listener [port listener] (inactive timeout: 0)
debug1: Local forwarding listening on 127.0.0.1 port 53961.
debug1: channel 1: new port-listener [port listener] (inactive timeout: 0)
debug1: channel 2: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching C:\\Users\\user/.ssh/known_hosts for 192.168.1.152 / (none)
debug1: client_input_hostkeys: searching C:\\Users\\user/.ssh/known_hosts2 for 192.168.1.152 / (none)
debug1: client_input_hostkeys: hostkeys file C:\\Users\\user/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: no new or deprecated keys from server
debug1: Remote: /home/user/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/user/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending command: sh
debug1: pledge: network

@andprov
Copy link
Author

andprov commented Mar 6, 2025

After an unsuccessful attempt to select a project folder on the host, VS Code saves the state. I noticed another oddity. If you close VS Code and open it again, it will successfully connect to the previously selected project folder, and everything will work normally.

@andprov
Copy link
Author

andprov commented Mar 6, 2025

And I found a similar issue in the VSCode repo.
microsoft/vscode#242825

@BlackedProxy
Copy link

I'm in the exact same situation.
Is there a solution yet?

@andprov
Copy link
Author

andprov commented Mar 7, 2025

I'm in the exact same situation. Is there a solution yet?

downgrade to previous version VSCode

@Cilonen
Copy link

Cilonen commented Mar 7, 2025

Same issue here, downgraded and disabled auto-updates for the moment.

@TuRan-H
Copy link

TuRan-H commented Mar 8, 2025

If you don't want downgrade the VsCode version, try using VsCode Insiders. The Insiders version works fine.

@niuzheng168
Copy link

same issue.
downgrade to 1.97 worked.

@sfsaccone
Copy link

I have the same issue. Connecting to remote server with Remote - SSH fails with BadInstallScriptResult on first try, works on Retry, repeats for each new connection to a different server. I also see this in Remote - SSH log:

[08:42:41.248] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 55219 saclab1 sh
[08:42:41.250] Generated SSH command: 'type "C:\Users\Me\AppData\Local\Temp\vscode-linux-multi-line-command-saclab1-474228346.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 55219 saclab1 sh'
[08:42:41.250] Using connect timeout of 17 seconds
[08:42:41.250] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[08:42:41.529] > 
[08:42:41.529] Got some output, clearing connection timeout
[08:42:43.253] "install" terminal command done
[08:42:43.253] Install terminal quit with output: 
[08:42:43.254] Resolver error: Error: Got bad result from install script
	at y.Create (c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:740625)
	at t.tryInstall (c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:856042)
	at async c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:815123
	at async t.withShowDetailsEvent (c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:818374)
	at async R (c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:811578)
	at async t.resolve (c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:815775)
	at async c:\Users\Me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.118.0\out\extension.js:2:1102718
[08:42:43.257] ------
[08:42:43.257]  ---------- [Session Summary] ----------- 
[08:42:43.257] [BadInstallScriptResult]: Error: BadInstallScriptResult (Got bad result from install script)
[08:42:43.257]  ---------------------------------------- 

I wonder if there's a way to get more information than just "Got bad result" at [08:42:43.254].

Versions:

Remote - SSH: 0.118.0
VS Code: 1.98.0 

I did not try downgrading to 1.97. Using the pre-release version of Remote - SSH, 0.119.2025030615, did not work.

@YpsilonTM
Copy link

Same issue

@eliasbenb
Copy link

Same issue. Downgrading to v1.97.2 works on Windows.

winget install --id=Microsoft.VisualStudioCode -v "1.97.2" -e --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

9 participants