cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Error connecting to Remote SSH

Open shagunhexo opened this issue 8 months ago • 24 comments

Trying to connect to my EC2 instance using remote SSH and failing to do so. Getting the following error:

[Error  - 10:23:00.953] Error resolving authority
Error: All configured authentication methods failed
	at ye (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:143771)
	at /Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:442728
	at authHandler (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:438248)
	at Ee (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:146644)
	at USERAUTH_FAILURE (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:135448)
	at 51 (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:286953)
	at e.exports.D (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:157386)
	at D.decrypt (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:250538)
	at e.exports.U [as _parse] (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:156910)
	at e.exports.parse (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:160713)
	at Socket.<anonymous> (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:142511)
	at Socket.emit (node:events:513:28)
	at Socket.emit (node:domain:489:12)
	at addChunk (node:internal/streams/readable:324:12)
	at readableAddChunk (node:internal/streams/readable:297:9)
	at Readable.push (node:internal/streams/readable:234:10)
	at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Operating System: macOS Ventura 13.4.1 Cursor Version: 0.13.4

shagunhexo avatar Oct 30 '23 10:10 shagunhexo

Does it work in normal VSCode?

jakobFNF avatar Oct 30 '23 12:10 jakobFNF

Yes

shagunhexo avatar Oct 30 '23 12:10 shagunhexo

Are you using the exact same config for VSCode and SSH? On first glance, this looks like your key/ip/username/password/etc is off?

truell20 avatar Oct 30 '23 17:10 truell20

I am using the same config for VSCode and SSH. It's working fine with VSCode but giving errors with Cursor.

shagunhexo avatar Oct 31 '23 13:10 shagunhexo

Could you share a bit more about your SSH config for this server? Are you doing anything special? (e.g. using a proxy jump)

truell20 avatar Nov 01 '23 00:11 truell20

Not doing anything special Here is how my .ssh config file looks like:

Host ec2-chat-instance
    HostName *****.ap-south-1.compute.amazonaws.com
    User ec2-user
    IdentityFile ~/name.pem
    

shagunhexo avatar Nov 01 '23 09:11 shagunhexo

@truell20 the issue is the same as #915, either that you all aren't uploading the associated remote extensions with your updates or you're pointing Cursor to the wrong URLs to download the REH. I have no issues with VS Code SSH but I can't SSH into anything with Cursor because of this same issue as @shagunhexo

The URL that's expected to resolve with the installation script is https://cursor.blob.core.windows.net/remote-releases/0.13.4-fe924b35718993dc0821b4583f718e4cbe79b330/vscode-reh-win32-x64.tar.gz

It doesn't exist.

PLEASE fix this as soon as you can, I do most of my development on machines I SSH into and not being able to develop with Cursor this way is making me really frustrated. Sucks to go back to VS Code for this 😅😅

Here is what the full "Error resolving authority" error looks like, see the URL in REQUEST_ARGUMENTS

[Info  - 00:19:43.247] Trying no-auth authentication
[Info  - 00:19:43.300] Trying publickey authentication: /Users/jayhickey/.ssh/id_rsa ssh-ed25519 <REDACTED>
[Trace  - 00:19:43.487] Detected platform: windows, cmd
[Trace  - 00:19:43.488] Server install command:

# Server installation script

$TMP_DIR="$env:TEMP\$([System.IO.Path]::GetRandomFileName())"

$DISTRO_VERSION="0.13.4"
$DISTRO_COMMIT="fe924b35718993dc0821b4583f718e4cbe79b330"
$DISTRO_QUALITY="stable"

$SERVER_APP_NAME="cursor-server"
$SERVER_INITIAL_EXTENSIONS=""
$SERVER_LISTEN_FLAG="--port=0"
$SERVER_DATA_DIR="$(Resolve-Path ~)\.cursor-server"
$SERVER_DIR="$SERVER_DATA_DIR\bin\$DISTRO_VERSION-$DISTRO_COMMIT"
$SERVER_SCRIPT="$SERVER_DIR\bin\$SERVER_APP_NAME.cmd"
$SERVER_LOGFILE="$SERVER_DATA_DIR\.$DISTRO_COMMIT.log"
$SERVER_PIDFILE="$SERVER_DATA_DIR\.$DISTRO_COMMIT.pid"
$SERVER_TOKENFILE="$SERVER_DATA_DIR\.$DISTRO_COMMIT.token"
$SERVER_OS="win32"
$SERVER_ARCH=
$SERVER_CONNECTION_TOKEN=
$SERVER_DOWNLOAD_URL=

$LISTENING_ON=
$OS_RELEASE_ID=
$ARCH=

function printInstallResults($code) {
    "9587bede0a1d9a9ae539f3dc: start"
    "exitCode==$code=="
    "listeningOn==$LISTENING_ON=="
    "connectionToken==$SERVER_CONNECTION_TOKEN=="
    "logFile==$SERVER_LOGFILE=="
    "osReleaseId==$OS_RELEASE_ID=="
    "arch==$ARCH=="
    "platform==windows=="
    "tmpDir==$TMP_DIR=="
    
    "9587bede0a1d9a9ae539f3dc: end"
}

# Check machine architecture
$ARCH=$env:PROCESSOR_ARCHITECTURE
if(($ARCH -eq "AMD64") -or ($ARCH -eq "IA64")) {
    $SERVER_ARCH="x64"
}
else {
    "Error architecture not supported: $ARCH"
    printInstallResults 1
    exit 0
}

# Create installation folder
if(!(Test-Path $SERVER_DIR)) {
    try {
        ni -it d $SERVER_DIR -f -ea si
    } catch {
        "Error creating server install directory - $($_.ToString())"
        exit 1
    }

    if(!(Test-Path $SERVER_DIR)) {
        "Error creating server install directory"
        exit 1
    }
}

cd $SERVER_DIR

# Check if server script is already installed
if(!(Test-Path $SERVER_SCRIPT)) {
    del vscode-server.tar.gz

    $REQUEST_ARGUMENTS = @{
        Uri="https://cursor.blob.core.windows.net/remote-releases/0.13.4-fe924b35718993dc0821b4583f718e4cbe79b330/vscode-reh-win32-x64.tar.gz"
        TimeoutSec=20
        OutFile="vscode-server.tar.gz"
        UseBasicParsing=$True
    }

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

    Invoke-RestMethod @REQUEST_ARGUMENTS

    if(Test-Path "vscode-server.tar.gz") {
        tar -xf vscode-server.tar.gz --strip-components 1

        del vscode-server.tar.gz
    }

    if(!(Test-Path $SERVER_SCRIPT)) {
        "Error while installing the server binary"
        exit 1
    }
}
else {
    "Server script already installed in $SERVER_SCRIPT"
}

# Try to find if server is already running
if(Get-Process node -ErrorAction SilentlyContinue | Where-Object Path -Like "$SERVER_DIR\*") {
    echo "Server script is already running $SERVER_SCRIPT"
}
else {
    if(Test-Path $SERVER_LOGFILE) {
        del $SERVER_LOGFILE
    }
    if(Test-Path $SERVER_PIDFILE) {
        del $SERVER_PIDFILE
    }
    if(Test-Path $SERVER_TOKENFILE) {
        del $SERVER_TOKENFILE
    }

    $SERVER_CONNECTION_TOKEN="447d4c38-dd03-47d9-853b-6b97fe1a0188"
    [System.IO.File]::WriteAllLines($SERVER_TOKENFILE, $SERVER_CONNECTION_TOKEN)

    $SCRIPT_ARGUMENTS="--start-server --host=127.0.0.1 $SERVER_LISTEN_FLAG $SERVER_INITIAL_EXTENSIONS --connection-token-file $SERVER_TOKENFILE --telemetry-level off --enable-remote-auto-shutdown --accept-server-license-terms *> '$SERVER_LOGFILE'"

    $START_ARGUMENTS = @{
        FilePath = "powershell.exe"
        WindowStyle = "hidden"
        ArgumentList = @(
            "-ExecutionPolicy", "Unrestricted", "-NoLogo", "-NoProfile", "-NonInteractive", "-c", "$SERVER_SCRIPT $SCRIPT_ARGUMENTS"
        )
        PassThru = $True
    }

    $SERVER_ID = (start @START_ARGUMENTS).ID

    if($SERVER_ID) {
        [System.IO.File]::WriteAllLines($SERVER_PIDFILE, $SERVER_ID)
    }
}

if(Test-Path $SERVER_TOKENFILE) {
    $SERVER_CONNECTION_TOKEN="$(cat $SERVER_TOKENFILE)"
}
else {
    "Error server token file not found $SERVER_TOKENFILE"
    printInstallResults 1
    exit 0
}

sleep -Milliseconds 500

$SELECT_ARGUMENTS = @{
    Path = $SERVER_LOGFILE
    Pattern = "Extension host agent listening on (\d+)"
}

for($I = 1; $I -le 5; $I++) {
    if(Test-Path $SERVER_LOGFILE) {
        $GROUPS = (Select-String @SELECT_ARGUMENTS).Matches.Groups

        if($GROUPS) {
            $LISTENING_ON = $GROUPS[1].Value
            break
        }
    }

    sleep -Milliseconds 500
}

if(!(Test-Path $SERVER_LOGFILE)) {
    "Error server log file not found $SERVER_LOGFILE"
    printInstallResults 1
    exit 0
}

# Finish server setup
printInstallResults 0

if($SERVER_ID) {
    while($True) {
        if(!(gps -Id $SERVER_ID)) {
            "server died, exit"
            exit 0
        }

        sleep 30
    }
}

[Trace  - 00:19:43.488] Command length (8191 max):
4888
[Trace  - 00:19:44.781] Server install command stderr:
del : Cannot find path 
'C:\Users\jay\.cursor-server\bin\0.13.4-fe924b35718993dc0821b4583f718e4cbe79b330\vscode-server.tar.gz' because it does 
not exist.
At C:\Users\jay\.cursor-server\install\fe924b35718993dc0821b4583f718e4cbe79b330.ps1:57 char:1
+ del vscode-server.tar.gz
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\jay\.c...e-server.tar.gz:String) [Remove-Item], ItemNotFoundEx 
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
 
Invoke-RestMethod : BlobNotFoundThe specified blob does not exist.
RequestId:a85d7540-f01e-0028-46eb-0d020c000000
Time:2023-11-03T00:19:44.7704982Z
At C:\Users\jay\.cursor-server\install\fe924b35718993dc0821b4583f718e4cbe79b330.ps1:65 char:1
+ Invoke-RestMethod @REQUEST_ARGUMENTS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc 
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

[Trace  - 00:19:44.781] Server install command stdout:


    Directory: C:\Users\jay\.cursor-server


Mode                 LastWriteTime         Length Name                                                                 
----                 -------------         ------ ----                                                                 
d-----         11/1/2023  10:58 AM                install                                                              


Error while installing the server binary

[Error  - 00:19:44.781] Error resolving authority
Error: Failed parsing install script output
	at t.installCodeServer (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:821319)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async /Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:438341

jayhickey avatar Nov 03 '23 00:11 jayhickey

@jayhickey Am I correct that you're trying to SSH into a windows machine? Unfortunately, we don't currently support SSHing into Mac or Windows machines.

truell20 avatar Nov 03 '23 02:11 truell20

Oh wow I didn't know they aren't supported. Yeah Windows and Macs are what I SSH into.

Any plans to add support or is it possible to fallback to the VS Code SSH host extension?

jayhickey avatar Nov 03 '23 03:11 jayhickey

Hi,

I just ran into this issue (SSH into a Windows machine). I wish I had known this before I upgraded to Pro.

Is there any ETA for SSH into Windows being supported?

poupas avatar Nov 10 '23 10:11 poupas

I am having this issue connecting to a ubuntu server. Same problems as OP. Works in VSCode. Even works SSHing into a different server, just not this particular one. I deleted .cursor-server on the host, no change.

[Trace  - 19:31:01.665] Server install command stdout:
Downloading server from 'https://cursor.blob.core.windows.net/remote-releases/0.18.5-23e4a35b958128d799597f309a7f42dd50d007c0/vscode-reh-linux-x64.tar.gz'
Error downloading server from https://cursor.blob.core.windows.net/remote-releases/0.18.5-23e4a35b958128d799597f309a7f42dd50d007c0/vscode-reh-linux-x64.tar.gz
322d62b053e1e0a8d265678c: start
exitCode==1==
listeningOn====
connectionToken====
logFile==/home/davisac1/.cursor-server/.23e4a35b958128d799597f309a7f42dd50d007c0.log==
osReleaseId==rhel==
arch==x86_64==
platform==Linux==
tmpDir==/run/user/1034==
322d62b053e1e0a8d265678c: end

[Error  - 19:31:01.667] Error resolving authority
Error: Couldn't install vscode server on remote server, install script returned non-zero exit status
	at t.installCodeServer (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:847175)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async /Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:

Edit: Not sure what happened but this seemed to have spontaneously fixed itself.

tonydavis629 avatar Dec 08 '23 19:12 tonydavis629

I have the same issue trying to SSH into an Ubuntu Machine from a Mac. That is the only reason I still use VSCode

ufkhan97 avatar Dec 10 '23 15:12 ufkhan97

Same (Trying to SSH from MacOS -> Ubuntu, working in vscode)

jochenstu avatar Jan 18 '24 07:01 jochenstu

Also trying to SSH from MacOS to Ubuntu. Working fine in vscode.

zakwatts avatar Jan 19 '24 12:01 zakwatts

I have the same issue

ChaostixZix avatar Jan 28 '24 17:01 ChaostixZix

Is there any workaround for this yet?

ChaostixZix avatar Feb 13 '24 03:02 ChaostixZix

I have the same issue

[Info  - 09:36:14.870] Resolving ssh remote authority 'ssh-remote+red-husky-1' (attemp #1)
[Trace  - 09:36:14.975] Identity keys:
/Users/cheptsov/.dstack/ssh/id_rsa ssh-rsa SHA256:<REDACTED>
/Users/cheptsov/.dstack/ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Trace  - 09:36:14.979] Identity keys:
/Users/cheptsov/.dstack/ssh/id_rsa ssh-rsa SHA256:<REDACTED>
/Users/cheptsov/.dstack/ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Info  - 09:36:15.563] Trying no-auth authentication
[Info  - 09:36:15.681] Trying publickey authentication: /Users/cheptsov/.dstack/ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Info  - 09:36:15.685] Trying publickey authentication: /Users/cheptsov/.dstack/ssh/id_rsa ssh-rsa SHA256:<REDACTED>
[Error  - 09:36:15.804] Error resolving authority
Error: All configured authentication methods failed
	at _e (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:143771)
	at /Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:442730
	at authHandler (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:437542)
	at Ee (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:146644)
	at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

VSCode works like a charm. Any update on this?

peterschmidt85 avatar Mar 23 '24 09:03 peterschmidt85

I have the same issue. It is surprising that it has not yet been resolved.

vitrun avatar Mar 28 '24 12:03 vitrun

Also having this issue.

simonleandergrimm avatar Apr 01 '24 17:04 simonleandergrimm

+1

avocardio avatar Apr 03 '24 12:04 avocardio

Cursor is much better than VS Code, but unfortunately I cannot completely migrate due to this issue. :'(

askrauthein avatar Apr 08 '24 22:04 askrauthein

Also having this issue. I routinely connect to 2 servers via ssh, everything works well with VS Code, but Cursor can only connect to one server. For the other, it fails key auth, asks for password, fails again.

[Info  - 21:36:36.539] Resolving ssh remote authority 'ssh-remote+remote.address' (attemp #1)
[Trace  - 21:36:36.548] Identity keys:
/Users/pierre/.ssh/sshkey1 ssh-rsa SHA256:<REDACTED>
/Users/pierre/.ssh/sshkey2 ssh-ed25519 SHA256:<REDACTED>
[Info  - 21:36:36.589] Trying no-auth authentication
[Info  - 21:36:36.604] Trying publickey authentication: /Users/pierre/.ssh/sshkey1 ssh-rsa SHA256:<REDACTED>
[Info  - 21:36:36.644] Trying password authentication
## This fails, even if provided with the correct password

pierre-nedelec avatar Apr 11 '24 21:04 pierre-nedelec

also having the same issue

adamlin120 avatar Apr 23 '24 02:04 adamlin120

same :((

Cursor Version: 0.29.1 VSCode Version: 1.86.2 MAC OS 14.4.1

I-zattak-I avatar May 09 '24 10:05 I-zattak-I