win10灵码ide无法直连wsl, 通过remote ssh也无法连接到wsl服务器;trae可以

重装试过了
使用最新安装器试过了
删除.lingma目录试过了

报错:

无法连接到远程扩展主机服务器 (错误: Couldn't install vscode server on remote server, install script returned non-zero exit status)

[Info  - 05:54:00.840] Resolving ssh remote authority 'ssh-remote+172.19.101.150' (attemp #1)
[Error  - 05:54:00.873] Couldn't get identities from OpenSSH agent
Error: Failed to connect to agent
    at Socket.n (c:\Program Files\Lingma\resources\app\extensions\Alibaba-Cloud.open-remote-ssh\out\extension.js:1:126951)
    at Socket.emit (node:events:524:28)
    at Socket.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[Trace  - 05:54:00.873] Identity keys:
C:\Users\test\.ssh\id_rsa ssh-rsa SHA256:zzOt2QdcvWw0lTfaCyAZ/xL+PSqNKjq164Y91C/9tiE=
[Info  - 05:54:00.979] Trying no-auth authentication
[Info  - 05:54:01.30] Trying publickey authentication: C:\Users\test\.ssh\id_rsa ssh-rsa SHA256:zzOt2QdcvWw0lTfaCyAZ/xL+PSqNKjq164Y91C/9tiE=
[Trace  - 05:54:01.589] Server install command:

# Server installation script

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

DISTRO_VERSION="0.1.5"
DISTRO_COMMIT="7d0c9147a7f10d16a2dd9bc9f72456b87d51be27"
DISTRO_QUALITY="stable"
DISTRO_VSCODIUM_RELEASE=""

SERVER_APP_NAME="lingma-server"
SERVER_INITIAL_EXTENSIONS=""
SERVER_LISTEN_FLAG="--port=0"
SERVER_DATA_DIR="$HOME/.lingma-server"
SERVER_DIR="$SERVER_DATA_DIR/bin/$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_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 "9c93c887f904dbeca1534361: 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 "9c93c887f904dbeca1534361: end"
    exit 0
}

# Check if platform is supported
KERNEL="$(uname -s)"
case $KERNEL in
    Darwin)
        PLATFORM="darwin"
        ;;
    Linux)
        PLATFORM="linux"
        ;;
    FreeBSD)
        PLATFORM="freebsd"
        ;;
    DragonFly)
        PLATFORM="dragonfly"
        ;;
    *)
        echo "Error platform not supported: $KERNEL"
        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"
        ;;
    riscv64)
        SERVER_ARCH="riscv64"
        ;;
    loongarch64)
        SERVER_ARCH="loong64"
        ;;
    s390x)
        SERVER_ARCH="s390x"
        ;;
    *)
        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

# adjust platform for vscodium download, if needed
if [[ $OS_RELEASE_ID = alpine ]]; then
    PLATFORM=$OS_RELEASE_ID
fi

SERVER_DOWNLOAD_URL="$(echo "https://lingma-ide.oss-rg-china-mainland.aliyuncs.com/server/\${version}.\${release}/vscodium-reh-\${os}-\${arch}-\${version}.\${release}.tar.gz" | sed "s/\${quality}/$DISTRO_QUALITY/g" | sed "s/\${version}/$DISTRO_VERSION/g" | sed "s/\${commit}/$DISTRO_COMMIT/g" | sed "s/\${os}/$PLATFORM/g" | sed "s/\${arch}/$SERVER_ARCH/g" | sed "s/\${release}/$DISTRO_VSCODIUM_RELEASE/g")"

echo "Downloading vscode server from: $SERVER_DOWNLOAD_URL"

# Check if server script is already installed
if [[ ! -f $SERVER_SCRIPT ]]; then
    case "$PLATFORM" in
        darwin | linux | alpine )
            ;;
        *)
            echo "Error '$PLATFORM' needs manual installation of remote extension host"
            print_install_results_and_exit 1
            ;;
    esac

    pushd $SERVER_DIR > /dev/null

    if [[ ! -z $(which wget) ]]; then
        wget --tries=3 --timeout=10 --continue --no-verbose -O vscode-server.tar.gz $SERVER_DOWNLOAD_URL
    elif [[ ! -z $(which curl) ]]; then
        curl --retry 3 --connect-timeout 10 --location --show-error --silent --output vscode-server.tar.gz $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 vscode-server.tar.gz --strip-components 1
    if (( $? > 0 )); then
        echo "Error while extracting server contents"
        print_install_results_and_exit 1
    fi

    # Get old commit from product.json and replace with new commit
    if [[ -f "$SERVER_DIR/product.json" ]]; then
        OLD_COMMIT=$(grep -o '"commit": *"[^"]*"' "$SERVER_DIR/product.json" | cut -d'"' -f4)
        if [[ ! -z "$OLD_COMMIT" ]]; then
            find "$SERVER_DIR" -type f -exec perl -pi -e "s/$OLD_COMMIT/$DISTRO_COMMIT/g" {} +
        fi
    fi

    # Rename all files containing 'codium' in bin directory
    find "$SERVER_DIR/bin" -type f -name "*codium*" | while read file; do
        new_name=$(echo "$file" | sed 's/codium/lingma/g')
        mv "$file" "$new_name"
    done

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

    rm -f vscode-server.tar.gz

    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)"
    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 [[ -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="1a0ac77c-67f4-437b-8853-6695efe75cea"
    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

if [[ -f $SERVER_TOKENFILE ]]; then
    SERVER_CONNECTION_TOKEN="$(cat $SERVER_TOKENFILE)"
else
    echo "Error server token file not found $SERVER_TOKENFILE"
    print_install_results_and_exit 1
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 successfully"
        print_install_results_and_exit 1
    fi
else
    echo "Error server log file not found $SERVER_LOGFILE"
    print_install_results_and_exit 1
fi

# Finish server setup
print_install_results_and_exit 0

[Trace  - 05:54:04.721] Server install command stderr:

gzip: stdin: invalid compressed data--format violated
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

[Trace  - 05:54:04.721] Server install command stdout:
Downloading vscode server from: https://lingma-ide.oss-rg-china-mainland.aliyuncs.com/server/0.1.5./vscodium-reh-linux-x64-0.1.5..tar.gz
Error while extracting server contents
9c93c887f904dbeca1534361: start
exitCode==1==
listeningOn====
connectionToken====
logFile==/root/.lingma-server/.7d0c9147a7f10d16a2dd9bc9f72456b87d51be27.log==
osReleaseId==ubuntu==
arch==x86_64==
platform==linux==
tmpDir==/run/user/0==
9c93c887f904dbeca1534361: end

[Error  - 05:54:04.722] Error resolving authority
Error: Couldn't install vscode server on remote server, install script returned non-zero exit status
    at t.installCodeServer (c:\Program Files\Lingma\resources\app\extensions\Alibaba-Cloud.open-remote-ssh\out\extension.js:1:443254)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async c:\Program Files\Lingma\resources\app\extensions\Alibaba-Cloud.open-remote-ssh\out\extension.js:1:404904

展开
收起
rvc4tglwwryvs 2025-07-15 14:03:04 183 分享 版权
0 条回答
写回答
取消 提交回答

通义灵码是基于通义大模型的 AI 研发辅助工具,提供代码生成、研发问答、任务执行等能力,为开发者带来智能化研发体验,引领 AI 原生研发新范式。通义灵码兼容 Visual Studio Code、Visual Studio、JetBrains IDEs 等主流编程工具,并提供 Lingma IDE,开发者可以自由选择。 更多信息欢迎加入通义灵码用户交流群(钉钉群号53770000738)

热门讨论

热门文章

还有其他疑问?
咨询AI助理