Issue Description
Steps to Reprodu[Info - 01:30:26.519] Resolving wsl remote authority ‘wsl+archlinux’ (attemp #1)
[Trace - 01:30:26.523] Running WSL command: wsl.exe --distribution archlinux – bash -c ’
# Server installation script
TMP_DIR=“${XDG_RUNTIME_DIR:-”/tmp"}"
DISTRO_VERSION=“0.2.18”
DISTRO_COMMIT=“64312bada73944b4197ec4d2b3faba6ed3ea290b”
DISTRO_QUALITY=“stable”
DISTRO_VSCODIUM_RELEASE=“1.100.0”
SERVER_APP_NAME=“qoder-server”
SERVER_INITIAL_EXTENSIONS=“”
SERVER_LISTEN_FLAG=“–port=0”
SERVER_DATA_DIR=“$HOME/.qoder-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_OS=
SERVER_ARCH=
SERVER_CONNECTION_TOKEN=
SERVER_DOWNLOAD_URL=
LISTENING_ON=
OS_RELEASE_ID=
ARCH=
PLATFORM=
SERVER_STARTUP_TIME=
# Mimic output from logs of remote-ssh extension
print_install_results_and_exit() {
echo "37509dcbd1254bf7556e7c97: 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 "serverStartupTime==$SERVER_STARTUP_TIME=="
echo "37509dcbd1254bf7556e7c97: end"
exit 0
}
# Check if platform is supported
PLATFORM=“$(uname -s)”
case $PLATFORM in
Linux)
SERVER_OS="linux"
;;
\*)
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"
;;
\*)
echo "Error architecture not supported: $ARCH"
print_install_results_and_exit 1
;;
esac
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://download.qoder.com/server/\${version}/qoder-reh-\${os}-\${arch}-\${version}.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” | sed “s/\${release}/$DISTRO_VSCODIUM_RELEASE/g”)”
echo “Downloading Qoder 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
if \[\[ ! -z $(which wget) \]\]; then
wget --tries=3 --timeout=10 --continue --no-verbose -O qoder-server.tar.gz $SERVER_DOWNLOAD_URL
elif \[\[ ! -z $(which curl) \]\]; then
curl --retry 3 --connect-timeout 10 --location --show-error --silent --output qoder-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 qoder-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/qoder/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 qoder-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="6bea867a-a982-4b07-a754-f6987e16559a"
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 --use-host-proxy --disable-websocket-compression --without-browser-env-var --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
\# Record start time for server startup monitoring
START_TIME=$SECONDS
for i in {1..120}; 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
\# Calculate and log server startup time
SERVER_STARTUP_TIME=$((SECONDS - START_TIME))
echo "Server startup time: $SERVER_STARTUP_TIME""s"
if \[\[ -z $LISTENING_ON \]\]; then
echo "Error server did not start sucessfully"
print_install_results_and_exit 1
fi
\# Warn if server startup took longer than 30 seconds
if \[\[ $SERVER_STARTUP_TIME -gt 30 \]\]; then
echo "Warning: Server startup took $SERVER_STARTUP_TIME""s (>30s). The remote machine may have limited performance."
fi
else
echo "Error server log file not found $SERVER_LOGFILE"
print_install_results_and_exit 1
fi
# Finish server setup and keep script running
if [[ -z $SERVER_RUNNING_PROCESS ]]; then
echo "37509dcbd1254bf7556e7c97: start"
echo "exitCode==0=="
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 "serverStartupTime==$SERVER_STARTUP_TIME=="
echo "37509dcbd1254bf7556e7c97: end"
echo "37509dcbd1254bf7556e7c97: Server installation script done"
SERVER_PID="$(cat $SERVER_PIDFILE)"
SERVER_RUNNING_PROCESS="$(ps -o pid,args -p $SERVER_PID | grep $SERVER_SCRIPT)"
while \[\[ -n $SERVER_RUNNING_PROCESS \]\]; do
sleep 300;
SERVER_RUNNING_PROCESS="$(ps -o pid,args -p $SERVER_PID | grep $SERVER_SCRIPT)"
done
else
print_install_results_and_exit 0
fi
’
[Trace - 01:30:29.189] Server install command stdout:
Downloading Qoder server from: https://download.qoder.com/server/0.2.18/qoder-reh-linux-x64-0.2.18.tar.gz
Error no tool to download server binary
37509dcbd1254bf7556e7c97: start
exitCode==1==
listeningOn====
connectionToken====
logFile==/root/.qoder-server/.64312bada73944b4197ec4d2b3faba6ed3ea290b.log==
osReleaseId==arch==
arch==x86_64==
platform==Linux==
tmpDir==/run/user/0/==
serverStartupTime====
37509dcbd1254bf7556e7c97: end
[Error - 01:30:29.190] Error resolving authority
Error: Couldn’t install Qoder server on remote server, install script returned non-zero exit status
at t.installCodeServer (d:\\Qoder\\resources\\app\\extensions\\open-remote-wsl\\dist\\extension.js:1:29405)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async d:\\Qoder\\resources\\app\\extensions\\open-remote-wsl\\dist\\extension.js:1:2154ce
