SSH not working in latest update

Is anyone else having issues connecting to ssh after installing the latest update? It was literally working fine this morning, then I installed the update and suddenly it won’t connect anymore.

For context, I get this error:
[Error - 19:30:28.382] Error resolving authority
Error: Couldn’t install vscode server on remote server, install script returned non-zero exit status

1 Like

We’ll have a look. Thank you for reporting.

1 Like

a cursor dev here. would love to help this get solved. we tested SSH and would love help replicating the issue. are you using tunnels or dev containers? Is this normal ssh?

This is a normal ssh to my university’s linux servers.

Thanks for reporting! Could you paste the entire log?

Ah unfortunately I reverted back to an older version of cursor and it works, and my project is due in two days lol so I don’t want to install the newer version again. Sorry! I’ll post it again as soon as I get my code to work and can install the latest update again.

Here is mine – I am using tailscale – but then opened up regular sshd and copied my key over and got the same result.
edit: I can download the url just fine with wget and curl so I’m very confused about what is going no…

[Info  - 22:34:48.536] Resolving ssh remote authority 'ssh-remote+nimbus@pako' (attemp #1)
[Trace  - 22:34:48.544] Identity keys:
/Users/kevinjoyce/.ssh/id_ed25519 ssh-ed25519 SHA256:kGSUUPQRGj8jtw3APByQSNC0y3bZS9YFE7saRanBnhY=
[Info  - 22:34:48.592] Trying no-auth authentication
[Trace  - 22:34:48.631] Server install command:

# Server installation script

TMP_DIR="${XDG_RUNTIME_DIR:-"/tmp"}"

DISTRO_VERSION="0.13.0"
DISTRO_COMMIT="e4dfb063f60fbbb889ccfa43d4d2ba3b118c8830"
DISTRO_QUALITY="stable"

SERVER_APP_NAME="cursor-server"
SERVER_INITIAL_EXTENSIONS=""
SERVER_LISTEN_FLAG="--port=0"
SERVER_DATA_DIR="$HOME/.cursor-server"
SERVER_DIR="$SERVER_DATA_DIR/bin/$DISTRO_VERSION-$DISTRO_COMMIT"
SERVER_SCRIPT="$SERVER_DIR/bin/$SERVER_APP_NAME"
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=
SERVER_ARCH=
SERVER_CONNECTION_TOKEN=
SERVER_DOWNLOAD_URL=

LISTENING_ON=
OS_RELEASE_ID=
ARCH=
PLATFORM=

# Mimic output from logs of remote-ssh extension
print_install_results_and_exit() {
    echo "5ddea4f54ae88abe246dc11e: start"
    echo "exitCode==$1=="
    echo "listeningOn==$LISTENING_ON=="
    echo "connectionToken==$SERVER_CONNECTION_TOKEN=="
    echo "logFile==$SERVER_LOGFILE=="
    echo "osReleaseId==$OS_RELEASE_ID=="
    echo "arch==$ARCH=="
    echo "platform==$PLATFORM=="
    echo "tmpDir==$TMP_DIR=="
    
    echo "5ddea4f54ae88abe246dc11e: end"
    exit 0
}

# Check if platform is supported
PLATFORM="$(uname -s)"
case $PLATFORM in
    Darwin)
        SERVER_OS="darwin"
        ;;
    Linux)
        SERVER_OS="linux"
        ;;
    FreeBSD)
        SERVER_OS="freebsd"
        ;;
    DragonFly)
        SERVER_OS="dragonfly"
        ;;
    *)
        echo "Error platform not supported: $PLATFORM"
        print_install_results_and_exit 1
        ;;
esac

# Check machine architecture
ARCH="$(uname -m)"
case $ARCH in
    x86_64 | amd64)
        SERVER_ARCH="x64"
        ;;
    armv7l | armv8l)
        SERVER_ARCH="armhf"
        ;;
    arm64 | aarch64)
        SERVER_ARCH="arm64"
        ;;
    ppc64le)
        SERVER_ARCH="ppc64le"
        ;;
    *)
        echo "Error architecture not supported: $ARCH"
        print_install_results_and_exit 1
        ;;
esac

# https://www.freedesktop.org/software/systemd/man/os-release.html
OS_RELEASE_ID="$(grep -i '^ID=' /etc/os-release 2>/dev/null | sed 's/^ID=//gi' | sed 's/"//g')"
if [[ -z $OS_RELEASE_ID ]]; then
    OS_RELEASE_ID="$(grep -i '^ID=' /usr/lib/os-release 2>/dev/null | sed 's/^ID=//gi' | sed 's/"//g')"
    if [[ -z $OS_RELEASE_ID ]]; then
        OS_RELEASE_ID="unknown"
    fi
fi

# Create installation folder
if [[ ! -d $SERVER_DIR ]]; then
    mkdir -p $SERVER_DIR
    if (( $? > 0 )); then
        echo "Error creating server install directory"
        print_install_results_and_exit 1
    fi
fi

SERVER_DOWNLOAD_URL="$(echo "https://cursor.blob.core.windows.net/remote-releases/\${version}-\${commit}/vscode-reh-\${os}-\${arch}.tar.gz" | sed "s/\${quality}/$DISTRO_QUALITY/g" | sed "s/\${version}/$DISTRO_VERSION/g" | sed "s/\${commit}/$DISTRO_COMMIT/g" | sed "s/\${os}/$SERVER_OS/g" | sed "s/\${arch}/$SERVER_ARCH/g")"

echo "Downloading server from '$SERVER_DOWNLOAD_URL'"

# Check if server script is already installed
if [[ ! -f $SERVER_SCRIPT ]]; then
    if [[ "$SERVER_OS" = "dragonfly" ]] || [[ "$SERVER_OS" = "freebsd" ]]; then
        echo "Error "$SERVER_OS" needs manual installation of remote extension host"
        print_install_results_and_exit 1
    fi

    pushd $SERVER_DIR > /dev/null

    # Generate a random filename to avoid collisions
    RANDOM_FILENAME="vscode-server-9f132773-f74a-4695-995a-ee4a551c6946.tar.gz"

    if [[ ! -z $(which wget) ]]; then
        wget --tries=3 --timeout=10 --continue --no-verbose -O $RANDOM_FILENAME $SERVER_DOWNLOAD_URL
    elif [[ ! -z $(which curl) ]]; then
        curl --retry 3 --connect-timeout 10 --location --show-error --silent --output $RANDOM_FILENAME $SERVER_DOWNLOAD_URL
    else
        echo "Error no tool to download server binary"
        print_install_results_and_exit 1
    fi

    if (( $? > 0 )); then
        echo "Error downloading server from $SERVER_DOWNLOAD_URL"
        print_install_results_and_exit 1
    fi

    tar -xf $RANDOM_FILENAME --strip-components 1
    if (( $? > 0 )); then
        echo "Error while extracting server contents"
        print_install_results_and_exit 1
    fi

    if [[ ! -f $SERVER_SCRIPT ]]; then
        echo "Error server contents are corrupted"
        print_install_results_and_exit 1
    fi

    rm -f $RANDOM_FILENAME

    popd > /dev/null
else
    echo "Server script already installed in $SERVER_SCRIPT"
fi

# Try to find if server is already running
if [[ -f $SERVER_PIDFILE ]]; then
    SERVER_PID="$(cat $SERVER_PIDFILE)"
    echo "Server PID: $SERVER_PID"
    echo "Server script: $SERVER_SCRIPT"
    SERVER_RUNNING_PROCESS="$(ps -o pid,args -p $SERVER_PID | grep $SERVER_SCRIPT)"
else
    echo "Server script: $SERVER_SCRIPT"
    SERVER_RUNNING_PROCESS="$(ps -o pid,args -A | grep $SERVER_SCRIPT | grep -v grep)"
fi

echo "Server running process: $SERVER_RUNNING_PROCESS"

SERVER_IS_RUNNING=$([[ ! -z $SERVER_RUNNING_PROCESS ]] && echo true || echo false)
if [[ -z $SERVER_RUNNING_PROCESS ]]; then
    if [[ -f $SERVER_LOGFILE ]]; then
        rm $SERVER_LOGFILE
    fi
    if [[ -f $SERVER_TOKENFILE ]]; then
        rm $SERVER_TOKENFILE
    fi

    touch $SERVER_TOKENFILE
    chmod 600 $SERVER_TOKENFILE
    SERVER_CONNECTION_TOKEN="ed76a126-f62d-4fb0-9e6c-03679b751a77"
    echo $SERVER_CONNECTION_TOKEN > $SERVER_TOKENFILE

    $SERVER_SCRIPT --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 &
    echo $! > $SERVER_PIDFILE
else
    echo "Server script is already running $SERVER_SCRIPT"
fi

function try_running() {
    if [[ -f $SERVER_TOKENFILE ]]; then
        SERVER_CONNECTION_TOKEN="$(cat $SERVER_TOKENFILE)"

    else
        echo "Error server token file not found $SERVER_TOKENFILE"
        return 1
    fi

    if [[ -f $SERVER_PIDFILE ]]; then
        SERVER_PID="$(cat $SERVER_PIDFILE)"
        SERVER_RUNNING_PROCESS="$(ps -o pid,args -p $SERVER_PID | grep $SERVER_SCRIPT)"
    else
        SERVER_RUNNING_PROCESS="$(ps -o pid,args -A | grep $SERVER_SCRIPT | grep -v grep)"
    fi
    if [[ -f $SERVER_LOGFILE ]]; then
        for i in {1..5}; do
            LISTENING_ON="$(cat $SERVER_LOGFILE | grep -E 'Extension host agent listening on .+' | sed 's/Extension host agent listening on //')"
            if [[ -n $LISTENING_ON ]]; then
                break
            fi
            sleep 0.5
        done

        if [[ -z $LISTENING_ON ]]; then
            echo "Error server did not start sucessfully"
            return 1
        fi
    else
        echo "Error server log file not found $SERVER_LOGFILE"
        return 1
    fi

    return 0
}

# Finish server setup
if ! try_running; then
    echo "Failed once $SERVER_IS_RUNNING"
    if [[ $SERVER_IS_RUNNING == true ]]; then
        echo "Retry"
        if [[ -f $SERVER_LOGFILE ]]; then
            rm $SERVER_LOGFILE
        fi
        if [[ -f $SERVER_TOKENFILE ]]; then
            rm $SERVER_TOKENFILE
        fi

        touch $SERVER_TOKENFILE
        chmod 600 $SERVER_TOKENFILE
        SERVER_CONNECTION_TOKEN="3f5a7778-73f2-40e6-85cb-f430a0df0af3"
        echo $SERVER_CONNECTION_TOKEN > $SERVER_TOKENFILE

        $SERVER_SCRIPT --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 &
        echo $! > $SERVER_PIDFILE
        if ! try_running; then
            echo "Exiting after retry"
            print_install_results_and_exit 1
        fi
    else
        echo "Exiting without"
        print_install_results_and_exit 1
    fi
fi

print_install_results_and_exit 0

[Trace  - 22:34:48.977] Server install command stderr:
failed: Network is unreachable.

[Trace  - 22:34:48.977] Server install command stdout:
Downloading server from 'https://cursor.blob.core.windows.net/remote-releases/0.13.0-e4dfb063f60fbbb889ccfa43d4d2ba3b118c8830/vscode-reh-linux-x64.tar.gz'
Error downloading server from https://cursor.blob.core.windows.net/remote-releases/0.13.0-e4dfb063f60fbbb889ccfa43d4d2ba3b118c8830/vscode-reh-linux-x64.tar.gz
5ddea4f54ae88abe246dc11e: start
exitCode==1==
listeningOn====
connectionToken====
logFile==/home/nimbus/.cursor-server/.e4dfb063f60fbbb889ccfa43d4d2ba3b118c8830.log==
osReleaseId==debian==
arch==x86_64==
platform==Linux==
tmpDir==/tmp==
5ddea4f54ae88abe246dc11e: end

[Error  - 22:34:48.979] 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:817365)
	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

EDIT: OK, I guess the script turns off ipv6 or something?? I had no ipv4 default gateway set and that was the issue here. So it downloaded fine via ipv6 manually but I had to add that gateway back before the script worked.

Mine also has a network error and claims it can’t download the server which is weird because from the cli as the ‘nimbus’ user I can copy/paste the url and download with wget or curl with no issues.

It seems with copy/pasting the code my messages vanish so here is a link to the logs on github

Oh huh… and this didn’t happen on the last version?

Believe this is a problem with our using a higher glibc version than Ubuntu 18.04 can support. Should have a patch out asap.

1 Like

Btw the fix for this is live!

1 Like

It works! Thanks guys. You’re the best. You’ve got a loyal Pro user for this :saluting_face:

1 Like

I still get a similar issue. Here is the full stack trace:

[Info  - 03:23:48.767] Resolving ssh remote authority 'ssh-remote+ec2-instance' (attemp #1)
[Trace  - 03:23:48.818] Identity keys:
/Users/ian/.ssh/aws-ec2-key-us-east-1.pem ssh-rsa SHA256:HJLgjK52kCzdr5gYRC3ZQDfGcS2ZwaCLdOXbmoOCrBc=
[Info  - 03:23:48.996] Trying no-auth authentication
[Info  - 03:23:49.37] Trying publickey authentication: /Users/ian/.ssh/aws-ec2-key-us-east-1.pem ssh-rsa SHA256:HJLgjK52kCzdr5gYRC3ZQDfGcS2ZwaCLdOXbmoOCrBc=
[Error  - 03:23:49.118] 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:438250)
	at ye (/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.J (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:157386)
	at J.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)

Here the relevant entry in my ~/.ssh/config file

Host ec2-instance
  HostName <my_ip>
  User ec2-user
  IdentityFile /Users/ian/.ssh/aws-ec2-key-us-east-1.pem

Note that the command

ssh -i ~/.ssh/aws-ec2-key-us-east-1.pem ec2-user@<my_ip>

works just fine from the terminal inside Cursor.

Finally, here is the info from “About Cursor”

Version: 0.16.0
VSCode Version: 1.84.2
Commit: 62c4c972aa5e76a3f5b465c2e07bce967ffb2e80
Date: 2023-11-16T22:43:05.957Z
Electron: 25.9.2
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin x64 23.1.0

What happens if you run just ssh ec2-instance in a terminal?

ssh ec2-instance works just fine, either in iTerm or from the Cursor terminal.

To pile on, trying to connect to a Hetzner Ubuntu SSH Host using Cursor (now 17, but was an issue with 16) on Mac OS I get:

[Info - XX:XX:XX.XXX] Resolving ssh remote authority ‘ssh-remote+XXX.XXX.XXX.XXX’ (attemp #X)
[Trace - XX:XX:XX.XXX] Identity keys:
/Users/XXX/.ssh/id_rsa ssh-rsa SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=
[Info - XX:XX:XX.XXX] Trying no-auth authentication
[Info - XX:XX:XX.XXX] Trying publickey authentication: /Users/XXX/.ssh/id_rsa ssh-rsa SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=
[Info - XX:XX:XX.XXX] Trying password authentication
[Error - XX:XX:XX.XXX] Error resolving authority
Error: All configured authentication methods failed
at _e (/Applications/XXX.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:X:XXXXXX)
at /Applications/XXX.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:X:XXXXXX```

It’s working with VS Code.

1 Like

Having this same issue. On Mac OS, trying to connect to EC2. Works on VSCode, works in iTerm, works in cursor terminal

Can we please get this marked as unresolved so we know somebody is actually looking at it? If this should be submitted somewhere else, let me know.

2 Likes

Having the same issue. Mac OS 13.6.2.

Note we are using Foxpass to manage our keys (described, roughly, here). But I don’t think that’s an issue because I can connect fine in VS Code and iTerm2.

Cursor info:

Version: 0.20.2
VSCode Version: 1.84.2
Commit: 33c8b08492b48664cb00a8ab054f2d60697bbf90
Date: 2023-12-19T02:08:30.362Z
Electron: 25.9.2
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0

Relevant parts of ~/.ssh/config:

Host *
 ServerAliveInterval 60
 TCPKeepAlive yes
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa
 IdentityFile ~/.ssh/id_rsa_foxpass_work_computer
Host localcloud
    User REDACTED
    Hostname REDACTED
    ForwardAgent yes

Cursor logs:

[Info  - 21:31:08.306] Resolving ssh remote authority 'ssh-remote+localcloud' (attemp #1)
[Trace  - 21:31:08.321] Identity keys:
/Users/REDACTED/.ssh/id_rsa ssh-rsa SHA256:REDACTED
/Users/REDACTED/.ssh/id_rsa_foxpass_work_computer ssh-rsa SHA256:REDACTED
[Info  - 21:31:08.420] Trying no-auth authentication
[Info  - 21:31:08.445] Trying publickey authentication: /Users/REDACTED/.ssh/id_rsa ssh-rsa SHA256:REDACTED
[Info  - 21:31:08.465] Trying publickey authentication: /Users/REDACTED/.ssh/id_rsa_foxpass_work_computer ssh-rsa SHA256:REDACTED
[Error  - 21:31:08.570] 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:438250)
	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.J (/Applications/Cursor.app/Contents/Resources/app/extensions/open-remote-ssh/dist/main.js:1:157386)
	at J.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)

1 Like

i’m having the same issue too and it’s quite blocking as i use remote containers for my work. Is there an ETA for when this will be fixed? i bought the pro subscription but i can’t use it for work it’s quite disappointing :sweat_smile:

edit: ended up cancelling my subscription, i love Cursor but really need containers working to do my job. i’ll subscribe again once it’s fixed :pray:

in any case, thanks team for the great work!