cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Remote-SSH fails to connect

Open rtaori opened this issue 2 years ago • 14 comments

  1. I installed Cursor and the remote-ssh plugin
  2. I try to connect to a remote server (which works flawlessly on VS Code) and it results in the following error logs:
[18:00:28.548] Log Level: 2
[18:00:28.556] SSH Resolver called for "ssh-remote+sc-cpu", attempt 1
[18:00:28.556] "remote.SSH.useLocalServer": true
[18:00:28.556] "remote.SSH.path": undefined
[18:00:28.556] "remote.SSH.configFile": undefined
[18:00:28.557] "remote.SSH.useFlock": true
[18:00:28.557] "remote.SSH.lockfilesInTmp": false
[18:00:28.557] "remote.SSH.localServerDownload": auto
[18:00:28.557] "remote.SSH.remoteServerListenOnSocket": false
[18:00:28.557] "remote.SSH.showLoginTerminal": false
[18:00:28.557] "remote.SSH.defaultExtensions": []
[18:00:28.557] "remote.SSH.loglevel": 2
[18:00:28.558] "remote.SSH.enableDynamicForwarding": true
[18:00:28.558] "remote.SSH.enableRemoteCommand": false
[18:00:28.558] "remote.SSH.serverPickPortsFromRange": {}
[18:00:28.558] "remote.SSH.serverInstallPath": {}
[18:00:28.564] VS Code version: 0.7.3
[18:00:28.564] Remote-SSH version: [email protected]
[18:00:28.564] darwin arm64
[18:00:28.565] SSH Resolver called for host: sc-cpu
[18:00:28.565] Setting up SSH remote "sc-cpu"
[18:00:28.567] Acquiring local install lock: /var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/vscode-remote-ssh-6c95c04c-install.lock
[18:00:28.568] Looking for existing server data file at /Users/rtaori/Library/Application Support/Cursor/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-6c95c04c-74f6148eb9ea00507ec113ec51c489d6ffb4b771-0.102.0/data.json
[18:00:28.568] Using commit id "74f6148eb9ea00507ec113ec51c489d6ffb4b771" and quality "stable" for server
[18:00:28.570] Install and start server if needed
[18:00:28.571] PATH: /Users/rtaori/opt/google-cloud-sdk/bin:/Users/rtaori/opt/miniconda3/envs/basev2/bin:/Users/rtaori/opt/miniconda3/condabin:/Users/rtaori/.oh-my-zsh/custom/plugins/git-open:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
[18:00:28.571] Checking ssh with "ssh -V"
[18:00:28.577] > OpenSSH_9.0p1, LibreSSL 3.3.6

[18:00:28.578] askpass server listening on /var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/vscode-ssh-askpass-981fcde9206d6df8ae54ac9dcb636def62e73077.sock
[18:00:28.579] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/vscode-ssh-askpass-9ad557e29234b4cf9d22cea2ec15776e1505abb9.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","64267","-o","ConnectTimeout=15","sc-cpu"],"serverDataFolderName":".cursor-server","dataFilePath":"/Users/rtaori/Library/Application Support/Cursor/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-6c95c04c-74f6148eb9ea00507ec113ec51c489d6ffb4b771-0.102.0/data.json"}
[18:00:28.579] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.qsOtyim63u/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Cursor.app/Contents/Frameworks/Cursor Helper (Plugin).app/Contents/MacOS/Cursor Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/vscode-ssh-askpass-981fcde9206d6df8ae54ac9dcb636def62e73077.sock"}
[18:00:28.580] Spawned 11570
[18:00:28.652] > local-server-1> Running ssh connection command: "-v -T -D 64267 -o ConnectTimeout=15 sc-cpu"
[18:00:28.654] > local-server-1> Spawned ssh, pid=11579
[18:00:28.657] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[18:00:28.665] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[18:00:28.685] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[18:00:28.796] stderr> debug1: Server host key: ssh-ed25519 SHA256:JoSuzmo8xqRFDxwvUxrBppLQ9qIWieYb7viJKmlxUmc
[18:00:29.015] stderr> Authenticated to jamie.stanford.edu ([171.64.67.142]:22) using "gssapi-with-mic".
[18:00:29.136] stderr> debug1: Server host key: ssh-ed25519 SHA256:qI9pV3BBQp8ANIp7AMwnNkRaV1QpHQb3khLQcMjI13s
[18:00:29.235] stderr> Authenticated to sc.stanford.edu (via proxy) using "gssapi-with-mic".
[18:00:29.348] stderr> debug1: Server host key: ssh-ed25519 SHA256:RRnNK65btfB5bn1AqpuJnOY5JqvRpzuUOQyjP8E1lyE
[18:00:29.626] stderr> Authenticated to john1.stanford.edu (via proxy) using "gssapi-with-mic".
[18:00:29.720] > ready: 351943000191
[18:00:29.731] > Linux 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022
[18:00:29.731] Platform: linux
[18:00:29.750] > /bin/bash
[18:00:29.750] Shell: bash
[18:00:29.750] Creating bash subshell inside "bash"
[18:00:29.762] > bash version:  5.0.17(1)-release
[18:00:29.798] > 351943000191: running
[18:00:29.846] > Acquiring lock on /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/vscode-remote-lock.rtaori.74f6148eb9ea00507ec113ec51c489d6ffb4b771
[18:00:29.854] > Installing to /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771...
[18:00:29.861] > 351943000191%%1%%
[18:00:29.867] > Downloading with wget
[18:00:31.464] > Download complete
[18:00:31.473] > 351943000191%%2%%
> tar --version:
[18:00:31.480] > tar (GNU tar) 1.30
> Copyright (C) 2017 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.
[18:00:42.934] stderr> mv: cannot move 'vscode-server-linux-x64/bin' to './bin': Directory not empty
[18:00:42.953] stderr> mv: cannot move 'vscode-server-linux-x64/extensions' to './extensions': Directory not empty
[18:00:42.991] stderr> mv: cannot move 'vscode-server-linux-x64/node_modules' to './node_modules': Directory not empty
[18:00:42.998] stderr> mv: cannot move 'vscode-server-linux-x64/out' to './out': Directory not empty
[18:00:43.005] > ERROR: /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node or /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server don't exist
> Trigger local server download
> 351943000191:trigger_server_download
> platform==linux==
> vscodeArch==x64==
> destFolder==/sailhome/rtaori/.cursor-server/bin/==
> destFolder2==74f6148eb9ea00507ec113ec51c489d6ffb4b771==
> 351943000191:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/vscode-scp-done.flag and vscode-server.tar.gz to exist
>  
[18:00:43.005] Got request to download on client for {"platform":"linux","arch":"x64","destFolder":"/sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771"}
[18:00:43.006] Downloading VS Code server locally...
[18:00:46.009] >  
[18:00:49.011] >  
[18:00:52.011] >  
[18:00:53.858] Downloaded VS Code server to /var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/455bcc7b-3ac0-4d63-9db6-4b24eecee671
[18:00:53.859] Renamed VS Code server to /var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/vscode_server_1692320453858/vscode-server.tar.gz
[18:00:53.861] PATH: /Users/rtaori/opt/google-cloud-sdk/bin:/Users/rtaori/opt/miniconda3/envs/basev2/bin:/Users/rtaori/opt/miniconda3/condabin:/Users/rtaori/.oh-my-zsh/custom/plugins/git-open:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
[18:00:53.861] Checking ssh with "ssh -V"
[18:00:53.865] > OpenSSH_9.0p1, LibreSSL 3.3.6

[18:00:53.866] Testing scp with "scp"
[18:00:53.872] scp exited with code: 1
[18:00:53.872] Got stderr from scp: usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
           [-i identity_file] [-J destination] [-l limit]
           [-o ssh_option] [-P port] [-S program] source ... target
[18:00:53.872] Copying file to remote with scp -o ConnectTimeout=15 'vscode-server.tar.gz' 'vscode-scp-done.flag' 'sc-cpu':'/sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771'
[18:00:53.873] Using cwd: file:///var/folders/23/gl8qvqlj3pbf52257k3txfp00000gn/T/vscode_server_1692320453858
[18:00:55.013] >  
[18:00:55.031] > vscode-server.tar.gz                            0%    0     0.0KB/s   --:-- ETA
[18:00:56.036] > vscode-server.tar.gz                           12% 6656KB   6.5MB/s   00:07 ETA
[18:00:57.037] > vscode-server.tar.gz                           25%   14MB   6.6MB/s   00:06 ETA
[18:00:58.018] >  
[18:00:58.041] > vscode-server.tar.gz                           39%   21MB   6.6MB/s   00:04 ETA
[18:00:59.044] > vscode-server.tar.gz                           53%   29MB   6.7MB/s   00:03 ETA
[18:01:00.049] > vscode-server.tar.gz                           67%   36MB   6.8MB/s   00:02 ETA
[18:01:01.022] >  
[18:01:01.055] > vscode-server.tar.gz                           81%   43MB   6.8MB/s   00:01 ETA
[18:01:02.057] > vscode-server.tar.gz                           95%   51MB   6.9MB/s   00:00 ETA
[18:01:02.376] > vscode-server.tar.gz                          100%   53MB   7.3MB/s   00:07    
[18:01:03.040] > vscode-scp-done.flag                            0%    0     0.0KB/s   --:-- ETA
[18:01:03.054] > vscode-scp-done.flag                          100%    9     0.9KB/s   00:00    
[18:01:03.327] "Copy server to host" terminal command done
[18:01:04.044] > Found flag and server on host
[18:01:04.052] > 351943000191%%2%%
> tar --version:
> tar (GNU tar) 1.30
> Copyright (C) 2017 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.
[18:01:17.281] stderr> mv: cannot move 'vscode-server-linux-x64/bin' to './bin': Directory not empty
[18:01:17.296] stderr> mv: cannot move 'vscode-server-linux-x64/extensions' to './extensions': Directory not empty
[18:01:17.301] stderr> mv: cannot move 'vscode-server-linux-x64/node_modules' to './node_modules': Directory not empty
[18:01:17.309] stderr> mv: cannot move 'vscode-server-linux-x64/out' to './out': Directory not empty
[18:01:17.316] > ERROR: /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node or /sailhome/rtaori/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server don't exist
> Already attempted local download, failing
> 351943000191: start
> exitCode==37==
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult==missingFiles==
> didLocalDownload==1==
> downloadTime==1608==
> installTime==13246==
> extInstallTime====
> serverStartTime====
> 351943000191: end
[18:01:17.317] Received install output: 
exitCode==37==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/tmp==
platform==linux==
unpackResult==missingFiles==
didLocalDownload==1==
downloadTime==1608==
installTime==13246==
extInstallTime====
serverStartTime====

[18:01:17.317] Terminating local server
[18:01:17.322] Resolver error: Error: Failed to install the VS Code Server
	at m.ServerInstallError (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:584079)
	at f (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:578374)
	at t.handleInstallOutput (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:581161)
	at Object.e [as tryInstallWithLocalServer] (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:623656)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:643708
	at async t.withShowDetailsEvent (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:647428)
	at async /Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:622128
	at async C (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:618634)
	at async t.resolveWithLocalServer (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:621743)
	at async t.resolve (/Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:645036)
	at async /Users/rtaori/.cursor/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/extension.js:1:720916
[18:01:17.324] Local server exit: 15
[18:01:17.330] ------

rtaori avatar Aug 18 '23 01:08 rtaori

Seems to be possibly related to https://github.com/getcursor/cursor/issues/489

rtaori avatar Aug 18 '23 01:08 rtaori

Hey! I think this is because you have Microsoft's remote ssh installed. We ship an open source remote ssh extension that includes the same functionality. Does it work if you uninstall the microsoft extension?

truell20 avatar Aug 20 '23 05:08 truell20

I was having the same problem and this solved the issue immediately

Bernaljp avatar Aug 21 '23 12:08 Bernaljp

Ah thanks! Can confirm uninstalling the extension and using the built-in workflow works. I was initially confused bc I expected a dropdown just like VSCode, and when I didn't see it, I figured I needed to install the extension. I think adding support for the dropdown would be nice, but I've opened a separate issue for that: https://github.com/getcursor/cursor/issues/756 Marking this as resolved

rtaori avatar Aug 21 '23 16:08 rtaori

Reopening this issue as there seems to be a new bug. I just updated to the latest Cursor manually, and I'm now getting this error:

[Info  - 01:08:06.54] Resolving ssh remote authority 'ssh-remote+sc-cpu' (attemp #1)
[Trace  - 01:08:06.59] Identity keys:
/Users/rtaori/.ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Trace  - 01:08:06.62] Identity keys:
/Users/rtaori/.ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Error  - 01:09:06.70] Error resolving authority
Error: Timed out while waiting for handshake
	at Timeout.<anonymous> (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:147007)
	at listOnTimeout (node:internal/timers:559:17)
	at process.processTimers (node:internal/timers:502:7)

rtaori avatar Aug 25 '23 01:08 rtaori

Can we get an update?

jochenstu avatar Jan 21 '24 12:01 jochenstu

Reopening this issue as there seems to be a new bug. I just updated to the latest Cursor manually, and I'm now getting this error:

[Info  - 01:08:06.54] Resolving ssh remote authority 'ssh-remote+sc-cpu' (attemp #1)
[Trace  - 01:08:06.59] Identity keys:
/Users/rtaori/.ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Trace  - 01:08:06.62] Identity keys:
/Users/rtaori/.ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Error  - 01:09:06.70] Error resolving authority
Error: Timed out while waiting for handshake
	at Timeout.<anonymous> (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:147007)
	at listOnTimeout (node:internal/timers:559:17)
	at process.processTimers (node:internal/timers:502:7)

Getting this myself... Looks like Cursor just doesn't care?

mckzstudios avatar Jan 24 '24 00:01 mckzstudios

Did we get any update on this?

Bnjoroge1 avatar May 10 '24 19:05 Bnjoroge1

@truell20 hey, can we get an update on this? Error just keeps popping up on the recent version: Version: 0.33.4 VSCode Version: 1.86.2 Commit: 2dd5b2855ac68f3a3d3babee87d22b399a9db7d0 Date: 2024-05-11T02:05:08.197Z Electron: 27.2.3 ElectronBuildId: undefined Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.3.0

Bnjoroge1 avatar May 11 '24 19:05 Bnjoroge1

Is there a way to absolutely avoid using Cursor's remote SSH functionality? It's super buggy, and a huge blocker for getting anything done.

Bnjoroge1 avatar May 15 '24 00:05 Bnjoroge1

I agree here. The remote ssh build into cursor makes cursor unusable for any workload done on a remote machine, which IMO is a large chunk of the user base. It makes cursor mostly useless.

TheRealAlexV avatar Jul 22 '24 13:07 TheRealAlexV

Are y'all still having ssh problems? I removed all remote or ssh related extensions and can ssh into my machine everywhere but cursor. Which is super unfortunate.

Tedfulk avatar Jul 29 '24 00:07 Tedfulk

Yeah this is super broken and makes it completely useless. Works fine on VS code.

Marshall-Hallenbeck avatar Sep 07 '24 22:09 Marshall-Hallenbeck

Here's a youtube video on how to ssh into cursor. how to ssh into cursor

Tedfulk avatar Sep 13 '24 18:09 Tedfulk