Remote - SSH session failed on macOS - UnpackFailed
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.128.1
- OS Version: Linux x64 7.1.2-arch3-1
Steps to Reproduce:
1. Attempt to use SSH Remote to a Macbook
I've attempted this from both a windows 11 and Linux (as above) client VSCode install - both fail in the same way with the Unpack Failed error. Log file embedded at the bottom of the post, but the issue is simple: In the course of attempting to set up the vscode-server bin on the remote, the extension downloads the server from this url: `https://update.code.visualstudio.com/commit:5264f2156cbcd7aea5fd004d29eaa10209155d66/cli-darwin-arm64/stable` and names the resulting download with a .tar.gz extension. It then attempts to extract that assuming it **is** a gzipped tar file.
But the file which is downloaded is NOT a gzipped tar file - it is a zip file - confirmed with this on the Macbook:
```
$ pwd
/Users/Bryan.Childs/.vscode-server/bin/5264f2156cbcd7aea5fd004d29eaa10209155d66
$ ls -l
.rw-r--r-- 175M Bryan.Childs 15 Jul 07:55 vscode-server.tar.gz
$ file vscode-server.tar.gz
vscode-server.tar.gz: Zip archive data, at least v1.0 to extract, compression method=store
$ unzip -t vscode-server.tar.gz | head -10
Archive: vscode-server.tar.gz
testing: vscode-server-darwin-arm64/ OK
testing: vscode-server-darwin-arm64/LICENSE OK
testing: vscode-server-darwin-arm64/bin/ OK
testing: vscode-server-darwin-arm64/bin/remote-cli/ OK
testing: vscode-server-darwin-arm64/bin/remote-cli/code OK
testing: vscode-server-darwin-arm64/bin/code-server OK
testing: vscode-server-darwin-arm64/bin/helpers/ OK
testing: vscode-server-darwin-arm64/bin/helpers/browser.sh OK
testing: vscode-server-darwin-arm64/out/ OK
```
Output log from the extension:
```
[07:55:06.909] Log Level: 2
[07:55:06.919] SSH Resolver called for "ssh-remote+macbook", attempt 1
[07:55:06.922] remote.SSH.useLocalServer = false
[07:55:06.923] remote.SSH.useExecServer = false
[07:55:06.923] remote.SSH.bindHost = {}
[07:55:06.923] remote.SSH.showLoginTerminal = false
[07:55:06.923] remote.SSH.remotePlatform = {"macbook":"macOS"}
[07:55:06.924] remote.SSH.path =
[07:55:06.924] remote.SSH.configFile =
[07:55:06.924] remote.SSH.useFlock = true
[07:55:06.924] remote.SSH.lockfilesInTmp = false
[07:55:06.924] remote.SSH.localServerDownload = off
[07:55:06.924] remote.SSH.remoteServerListenOnSocket = false
[07:55:06.925] remote.SSH.defaultExtensions = []
[07:55:06.925] remote.SSH.defaultExtensionsIfInstalledLocally = []
[07:55:06.925] remote.SSH.loglevel = 2
[07:55:06.925] remote.SSH.enableDynamicForwarding = true
[07:55:06.925] remote.SSH.enableRemoteCommand = false
[07:55:06.925] remote.SSH.serverPickPortsFromRange = {}
[07:55:06.926] remote.SSH.serverInstallPath = {}
[07:55:06.926] remote.SSH.permitPtyAllocation = false
[07:55:06.926] remote.SSH.preferredLocalPortRange = undefined
[07:55:06.926] remote.SSH.useCurlAndWgetConfigurationFiles = false
[07:55:06.926] remote.SSH.experimental.chat = true
[07:55:06.926] remote.SSH.experimental.enhancedSessionLogs = true
[07:55:06.927] remote.SSH.httpProxy = {"*":""}
[07:55:06.927] remote.SSH.httpsProxy = {"*":""}
[07:55:06.935] VS Code version: 1.128.1
[07:55:06.935] Remote-SSH version: remote-ssh@0.124.0
[07:55:06.935] linux x64
[07:55:06.938] SSH Resolver called for host: macbook
[07:55:06.938] Setting up SSH remote "macbook"
[07:55:06.942] Using commit id "5264f2156cbcd7aea5fd004d29eaa10209155d66" and quality "stable" for server
[07:55:06.942] Extensions to install:
[07:55:06.947] Install and start server if needed
[07:55:06.949] PATH: /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin
[07:55:06.949] Checking ssh with "ssh -V"
[07:55:06.955] > OpenSSH_10.4p1, OpenSSL 3.6.3 9 Jun 2026
[07:55:06.958] Running script with connection command: ssh -T -D 40491 -o ConnectTimeout=15 macbook bash
[07:55:06.958] Generated SSH command: 'ssh -T -D 40491 -o ConnectTimeout=15 macbook bash << 'EOSSH'
echo "fc85ab364194: running"
#
# Setup
#
VSC_TMP="${XDG_RUNTIME_DIR:-`echo /tmp`}"
COMMIT_ID="5264f2156cbcd7aea5fd004d29eaa10209155d66"
SERVER_APP_NAME="code-server"
EXTENSIONS=""
TELEMETRY="--telemetry-level all"
VSCODE_AGENT_FOLDER=$HOME/.vscode-server
ALLOW_CLIENT_DOWNLOAD="0"
FORCE_CLIENT_DOWNLOAD="0"
MANUAL_BOOTSTRAP="0"
now=`date +%s`
VERBOSE="0"
PORT_FLAG=--port=0
SERVER_LISTEN_FLAG=
RECONNECTION_GRACE_TIME_FLAG=
UNPACK_RESULT=
DID_LOCAL_DOWNLOAD=0
DOWNLOAD_TIME=
INSTALL_TIME=
EXT_INSTALL_TIME=
SERVER_START_TIME=
CONNECTION_TOKEN=
VSCH_DIR="$VSCODE_AGENT_FOLDER/bin/$COMMIT_ID"
VSCH_SERVER_SCRIPT="$VSCH_DIR/bin/$SERVER_APP_NAME"
VSCH_SERVER_PREREQ_SCRIPT="$VSCH_DIR/bin/helpers/check-requirements.sh"
VSCH_LOGFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.log"
VSCH_PIDFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.pid"
VSCH_TOKENFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.token"
fail_with_exitcode() {
echo "fc85ab364194: start"
echo "exitCode==$1=="
echo_common_results
echo "fc85ab364194: end"
exit 0
}
echo_common_results() {
echo "listeningOn==$LISTENING_ON=="
echo "osReleaseId==$OSRELEASEID=="
echo "arch==$ARCH=="
echo "vscodeArch==$VSCODE_ARCH=="
echo "bitness==$BITNESS=="
echo "tmpDir==$VSC_TMP=="
echo "platform==$PLATFORM=="
echo "unpackResult==$UNPACK_RESULT=="
echo "didLocalDownload==$DID_LOCAL_DOWNLOAD=="
echo "downloadTime==$DOWNLOAD_TIME=="
echo "installTime==$INSTALL_TIME=="
echo "extInstallTime==$EXT_INSTALL_TIME=="
echo "serverStartTime==$SERVER_START_TIME=="
}
millis() {
if [[ $PLATFORM == linux ]]; then
echo $(($(date +%s%N)/1000000))
else
# Can't get actual millis on mac
echo $(($(date +%s)*1000))
fi
}
elapsed() {
echo $(($(millis) - $1))
}
do_create_install_dir() {
if [[ ! -d "$VSCH_DIR" ]]; then
mkdir -p "$VSCH_DIR"
if (( $? > 0 ))
then
echo "Creating the server install dir failed..."
fail_with_exitcode 202
fi
fi
}
do_create_install_dir
printenv_indent() {
if [[ $VERBOSE == "1" ]]; then
echo "printenv:"
printenv | sed 's/^/ /'
fi
}
#
# Get OS name
#
OSRELEASEID=`cat /etc/os-release 2>/dev/null | grep -a -E '^ID=' | sed 's/^[Ii][Dd]=//g' | sed 's/"//g'`
if [[ -z $OSRELEASEID ]]
then
OSRELEASEID=`cat /usr/lib/os-release 2>/dev/null | grep -a -E '^ID=' | sed 's/^[Ii][Dd]=//g' | sed 's/"//g'`
if [[ -z $OSRELEASEID ]]
then
OSRELEASEID=`uname -s`
fi
fi
#
# Get host platform/architecture
#
UNAME=$(uname -s)
case $UNAME in
Linux) PLATFORM=linux;;
Darwin) PLATFORM=macOS;;
*)
echo "Unsupported platform: $UNAME"
fail_with_exitcode 203
;;
esac
BITNESS=$(getconf LONG_BIT)
ARCH=$(uname -m)
case $ARCH in
x86_64) VSCODE_ARCH="x64";;
armv7l | armv8l)
VSCODE_ARCH="armhf"
;;
arm64 | aarch64)
if [[ $BITNESS == 32 ]]; then
# Can have 32-bit userland on 64-bit kernel
VSCODE_ARCH="armhf"
else
VSCODE_ARCH="arm64"
fi
;;
*)
OSRELEASE=$(uname -r)
case $OSRELEASE in
*x86_64*) VSCODE_ARCH="x64";;
*)
echo "Unsupported architecture: $ARCH"
fail_with_exitcode 196
;;
esac
;;
esac
if [[ $PLATFORM == linux ]]; then
PLATFORM_DOWNLOAD_PATH=server-linux-$VSCODE_ARCH
elif [[ $VSCODE_ARCH == "arm64" ]]; then
PLATFORM_DOWNLOAD_PATH=server-darwin-arm64
else
PLATFORM_DOWNLOAD_PATH=server-darwin
fi
#
# Acquire install lock
#
MAIN_LOCKFD=99
CLEANUP_LOCKFD=98
use_flock=1
if [[ $PLATFORM == "macOS" ]]; then
use_flock=0
fi
## Copyright (C) 2009 Przemyslaw Pawelczyk
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
get_lockfile() {
lockfiles_in_tmp=0
lockfile_name=vscode-remote-lock.$USER.$1
if [[ $lockfiles_in_tmp == "1" ]]; then
echo "$VSC_TMP/$lockfile_name"
else
echo "$VSCODE_AGENT_FOLDER/bin/$1/$lockfile_name"
fi
}
# PRIVATE
_lock() { flock -$1 $2; }
_no_more_locking() {
if [[ $use_flock == "1" ]]; then
_lock u $2
_lock xn $2 && rm -f $(get_lockfile $1)
else
lockfile_name=$(get_lockfile $1)
rm -f "$lockfile_name"
rm -f "$lockfile_name.target"
fi
}
# PUBLIC - all take lock FD
setup_locking() {
if [[ $use_flock == "1" ]]; then
eval "exec $2>\"$(get_lockfile $1)\"";
trap "_no_more_locking $1 $2" EXIT
fi
}
setup_lock_cleanup() {
if [[ $use_flock == "0" ]]; then
trap "_no_more_locking $1" EXIT
fi
}
# obtain an exclusive lock immediately or fail
exlock_now() {
if [[ $use_flock == "1" ]]; then
_lock xn $1
else
lockfile_name=$(get_lockfile $2)
touch "$lockfile_name.target"
echo \\ln \"$lockfile_name.target\" \"$lockfile_name\"
\ln "$lockfile_name.target" "$lockfile_name"
fi
}
# drop a lock
unlock() {
if [[ $use_flock == "1" ]]; then
_lock u $1
else
_no_more_locking $2
fi
}
setup_locking $COMMIT_ID $MAIN_LOCKFD
echo "Acquiring lock on `get_lockfile $COMMIT_ID`"
exlock_now $MAIN_LOCKFD $COMMIT_ID
if (( $? > 0 ))
then
echo "Installation already in progress..."
echo "If you continue to see this message, you can try toggling the remote.SSH.useFlock setting"
fail_with_exitcode 192
fi
setup_lock_cleanup $COMMIT_ID $MAIN_LOCKFD
#
# Delete old servers if needed
#
TO_DELETE=$(ls -1 -t "$VSCODE_AGENT_FOLDER/bin" | tail -n +6)
for COMMIT_TO_DELETE in $TO_DELETE; do
echo "Found old VS Code install $COMMIT_TO_DELETE, attempting to clean up"
setup_locking $COMMIT_TO_DELETE $CLEANUP_LOCKFD
exlock_now $CLEANUP_LOCKFD $COMMIT_TO_DELETE
if (( $? == 0 )); then
setup_lock_cleanup $COMMIT_TO_DELETE $CLEANUP_LOCKFD
RUNNING="`ps ax | grep $COMMIT_TO_DELETE | grep -v grep | wc -l | tr -d '[:space:]'`"
if [[ $RUNNING == 0 ]]; then
echo "Deleting old install from $VSCODE_AGENT_FOLDER/bin/$COMMIT_TO_DELETE"
rm -rf "$VSCODE_AGENT_FOLDER/bin/$COMMIT_TO_DELETE"
echo "Deleting old log file from $VSCODE_AGENT_FOLDER/.$COMMIT_TO_DELETE.log"
rm "$VSCODE_AGENT_FOLDER/.$COMMIT_TO_DELETE.log"
if [[ -f "$VSCODE_AGENT_FOLDER/.$COMMIT_TO_DELETE.pid" ]]; then
rm "$VSCODE_AGENT_FOLDER/.$COMMIT_TO_DELETE.pid"
fi
if [[ -f "$VSCODE_AGENT_FOLDER/.$COMMIT_TO_DELETE.token" ]]; then
rm "$VSCODE_AGENT_FOLDER/.$COMMIT_TO_DELETE.token"
fi
else
echo "Install still has running processes, not deleting: $COMMIT_TO_DELETE"
fi
else
echo "Failed to acquire lock for install, not deleting: $COMMIT_TO_DELETE"
fi
done
do_manual_bootstrap() {
ALLOW_CLIENT_DOWNLOAD="0"
FORCE_CLIENT_DOWNLOAD="0"
DID_LOCAL_DOWNLOAD="1"
echo "Trigger local (bootstrap) server download"
echo fc85ab364194:trigger_server_download
echo artifact==$PLATFORM_DOWNLOAD_PATH==
echo destFolder==$VSCODE_AGENT_FOLDER/bin/==
echo destFolder2==$COMMIT_ID/vscode-server.tar.gz==
echo fc85ab364194:trigger_server_download_end
echo "Waiting for client to transfer server archive..."
echo "Waiting for $VSCH_DIR/vscode-server.tar.gz.done and vscode-server.tar.gz to exist"
while true; do
if [[ -f "$VSCH_DIR/vscode-server.tar.gz.done" ]]; then
if [[ ! -f "$VSCH_DIR/vscode-server.tar.gz" ]]; then
echo "Found flag but not server tar - server transfer failed"
fail_with_exitcode 199
fi
echo "Found flag and server on host"
rm "$VSCH_DIR/vscode-server.tar.gz.done"
break
else
echo -n ' '
sleep 3
fi
done
}
do_client_download() {
DID_LOCAL_DOWNLOAD=1
echo "Trigger local server download"
echo fc85ab364194:trigger_server_download
echo artifact==$PLATFORM_DOWNLOAD_PATH==
echo destFolder==$VSCODE_AGENT_FOLDER/bin/==
echo destFolder2==$COMMIT_ID/vscode-server.tar.gz==
echo fc85ab364194:trigger_server_download_end
echo "Waiting for client to transfer server archive..."
echo "Waiting for $VSCH_DIR/vscode-server.tar.gz.done and vscode-server.tar.gz to exist"
while true; do
if [[ -f "$VSCH_DIR/vscode-server.tar.gz.done" ]]; then
if [[ ! -f "$VSCH_DIR/vscode-server.tar.gz" ]]; then
echo "Found flag but not server tar - server transfer failed"
fail_with_exitcode 199
fi
echo "Found flag and server on host"
rm "$VSCH_DIR/vscode-server.tar.gz.done"
break
else
echo -n ' '
sleep 3
fi
done
}
do_client_download_or_fail() {
if [[ $DID_LOCAL_DOWNLOAD == "1" ]]; then
echo "Already attempted local download, failing"
fail_with_exitcode $1
elif [[ $ALLOW_CLIENT_DOWNLOAD == "1" ]]; then
do_client_download
LOCAL_DOWNLOAD_RESULT=success
else
fail_with_exitcode $1
fi
}
do_host_download() {
start=$(millis)
echo 'fc85ab364194%%1%%'
UPDATE_URL="https://update.code.visualstudio.com"
DOWNLOAD_URL=$UPDATE_URL/commit:$COMMIT_ID/$PLATFORM_DOWNLOAD_PATH/stable
wget --version &> /dev/null
if (( $? == 0 ))
then
echo "Downloading with wget"
WGET_ERRORS=$(2>&1 wget --no-config --connect-timeout=7 --dns-timeout=7 -nv -O vscode-server.tar.gz $DOWNLOAD_URL)
if (( $? != 0 ))
then
echo "wget download failed"
echo $WGET_ERRORS
printenv_indent
do_client_download_or_fail 193
else
echo "Download complete"
DOWNLOAD_TIME=$(elapsed $start)
fi
else
curl --version &> /dev/null
if (( $? == 0 ))
then
echo "Downloading with curl"
CURL_OUTPUT=$(curl --disable --connect-timeout 7 -L $DOWNLOAD_URL --output vscode-server.tar.gz -w "%{http_code}")
if [[ ($? != 0) || ($CURL_OUTPUT != 2??) ]]
then
echo "curl download failed"
echo $CURL_OUTPUT
printenv_indent
do_client_download_or_fail 193
else
echo "Download complete"
DOWNLOAD_TIME=$(elapsed $start)
fi
else
printenv_indent
echo "Neither wget nor curl is installed"
do_client_download_or_fail 194
fi
fi
}
do_install() {
start=$(millis)
echo 'fc85ab364194%%2%%'
UNPACK_RESULT=success
echo 'tar --version:'
tar --version
tar -xf vscode-server.tar.gz --no-same-owner
TAR_EXIT=$?
INSTALL_TIME=$(elapsed $start)
if (( $TAR_EXIT > 0 ))
then
echo "ERROR: tar exited with non-0 exit code: $?"
UNPACK_RESULT=error
do_client_download_or_fail 205
do_install
return
fi
mv vscode-server*/* .
# cheap sanity check
if [[ ! -f "$VSCH_DIR/node" || ! -f "$VSCH_SERVER_SCRIPT" ]]
then
UNPACK_RESULT=missingFiles
echo "ERROR: $VSCH_DIR/node or $VSCH_SERVER_SCRIPT don't exist"
do_client_download_or_fail 205
do_install
return
fi
if [[ "$PLATFORM" == "linux" && ! -f "$VSCH_SERVER_PREREQ_SCRIPT" ]]
then
UNPACK_RESULT=missingFiles
echo "ERROR: $VSCH_SERVER_PREREQ_SCRIPT doesn't exist"
do_client_download_or_fail 205
do_install
return
fi
# Delete the leftover folder which might have -web prefix, and the .tar.gz
rm -rf vscode-server*
}
do_extension_install() {
# install extensions
if [[ ! -z $EXTENSIONS ]]
then
echo "Installing extensions..."
start=$(millis)
"$VSCH_SERVER_SCRIPT" $TELEMETRY $EXTENSIONS
EXT_INSTALL_TIME=$(elapsed $start)
fi
}
#
# Install if needed
#
if [[ ! -f "$VSCH_SERVER_SCRIPT" ]]
then
echo "Installing to $VSCH_DIR..."
STASHED_WORKING_DIR="`pwd`"
cd "$VSCH_DIR"
if [[ $MANUAL_BOOTSTRAP == "1" ]]; then
do_manual_bootstrap
else
if [[ $FORCE_CLIENT_DOWNLOAD == "1" ]]; then
do_client_download
else
do_host_download
fi
fi
do_install
#
# Verify linux prereqs
#
if [[ $PLATFORM == linux ]]; then
cd "$STASHED_WORKING_DIR"
"$VSCH_SERVER_PREREQ_SCRIPT"
PREREQ_EXIT_CODE=$?
if (( $PREREQ_EXIT_CODE == 99 )); then
fail_with_exitcode 207
elif (( $PREREQ_EXIT_CODE == 100 )); then
if [[ $FORCE_CLIENT_DOWNLOAD != "1" ]]; then
PLATFORM_DOWNLOAD_PATH=server-linux-legacy-$VSCODE_ARCH
rm -rf "$VSCH_DIR"
do_create_install_dir
cd "$VSCH_DIR"
do_host_download
do_install
fi
fi
fi
cd "$STASHED_WORKING_DIR"
else
echo "Found existing installation at $VSCH_DIR..."
fi
#
# Generate a new connection token
#
write_connection_token() {
rm "$VSCH_TOKENFILE"
CONNECTION_TOKEN="d443d511-b014-46b7-be46-39c2943cd714"
touch "$VSCH_TOKENFILE"
chmod 0700 "$VSCH_TOKENFILE"
echo $CONNECTION_TOKEN > "$VSCH_TOKENFILE"
}
#
# Start the server
#
start_server() {
echo "Starting VS Code Server... \"$VSCH_SERVER_SCRIPT\" --start-server --server-data-dir \"$VSCODE_AGENT_FOLDER\" --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown $RECONNECTION_GRACE_TIME_FLAG $PORT_FLAG $TELEMETRY $SERVER_LISTEN_FLAG $EXTENSIONS &> \"$VSCH_LOGFILE\" < /dev/null"
echo "The VS Code Server log file is $VSCH_LOGFILE"
printenv_indent
start=$(millis)
write_connection_token
if [[ -f $VSCH_LOGFILE ]]; then
echo "Removing old logfile at $VSCH_LOGFILE"
rm "$VSCH_LOGFILE" # See #6265
fi
"$VSCH_SERVER_SCRIPT" --start-server --server-data-dir "$VSCODE_AGENT_FOLDER" --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown $RECONNECTION_GRACE_TIME_FLAG $PORT_FLAG $TELEMETRY $SERVER_LISTEN_FLAG $EXTENSIONS --connection-token-file "$VSCH_TOKENFILE" &> "$VSCH_LOGFILE" < /dev/null &
echo $! > "$VSCH_PIDFILE"
echo "Spawned remote server: $!"
stopTime=$((SECONDS+15))
while (($SECONDS < $stopTime))
do
LISTENING_ON=`cat "$VSCH_LOGFILE" | grep -a -E 'Extension host agent listening on .+' | grep -v grep | sed 's/Extension host agent listening on //'`
if [[ $LISTENING_ON != '' ]]
then
break
fi
echo "Waiting for server log..."
sleep .03 || sleep 1
done
SERVER_START_TIME=$(elapsed $start)
}
echo "Checking $VSCH_LOGFILE and $VSCH_PIDFILE for a running server"
if [[ -f "$VSCH_PIDFILE" ]]; then
SERVER_PID=`cat "$VSCH_PIDFILE"`
echo "Looking for server with pid: $SERVER_PID"
ALL_PROCS=`ps ax | grep "^\s*$SERVER_PID\s"`
else
ALL_PROCS=`ps ax`
fi
RUNNING="`echo $ALL_PROCS | grep "$VSCH_SERVER_SCRIPT" | grep -v grep | wc -l | tr -d '[:space:]'`"
if [[ $RUNNING == 0 ]]; then
start_server
elif [[ ! -f "$VSCH_LOGFILE" ]]; then
echo "WARNING: VS Code Server is running but its logfile is missing. Don't delete the VS Code Server manually, run the command 'Uninstall VS Code Server'."
start_server
else
echo "Found running server..."
do_extension_install
if [[ -f "$VSCH_TOKENFILE" ]]; then
CONNECTION_TOKEN=`cat "$VSCH_TOKENFILE"`
fi
fi
echo " "
echo "*"
echo "* Visual Studio Code Server"
echo "*"
echo "* By using the software, you agree to"
echo "* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and"
echo "* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement)."
echo "*"
echo " "
LISTENING_ON=`cat "$VSCH_LOGFILE" | grep -a -E 'Extension host agent listening on .+' | grep -v grep | sed 's/Extension host agent listening on //'`
WEBUITOKEN=`cat "$VSCH_LOGFILE" | grep -a -E 'Web UI available at' | grep -o -E 'tkn=[0-9a-f-]+' | grep -o -E '[0-9a-f-]+'`
if [[ -z $LISTENING_ON ]]
then
echo "Server did not start successfully. Full server log at $VSCH_LOGFILE >>>"
cat "$VSCH_LOGFILE"
echo "<<< End of server log"
fail_with_exitcode 200
fi
#
# If the server was already running, ensure that it won't shut down in the near future
#
if [[ $RUNNING != 0 ]]; then
# In case the server is close to timing out and shutting down, ask it to delay shutdown
wget --version &> /dev/null
if [[ $? == 0 && $LISTENING_ON =~ (^[[:digit:]]+$) ]]
then
echo "Checking server status on port $LISTENING_ON with wget"
WGET_OUT=$(wget --no-config --no-proxy -nv -O - http://127.0.0.1:$LISTENING_ON/delay-shutdown 2>&1)
if [[ $? != 0 ]]; then
echo $WGET_OUT
fail_with_exitcode 197
fi
else
curl --version &> /dev/null
if (( $? == 0 ))
then
if [[ $LISTENING_ON =~ (^[[:digit:]]+$) ]]
then
echo "Checking server status on port $LISTENING_ON with curl"
CURL_OUTPUT=$(curl --disable --noproxy 127.0.0.1 -s http://127.0.0.1:$LISTENING_ON/delay-shutdown -w " %{http_code}")
else
echo "Checking server status on socket $LISTENING_ON with curl"
CURL_OUTPUT=$(curl --disable --noproxy 127.0.0.1 -s --unix-socket $LISTENING_ON http://127.0.0.1/delay-shutdown -w " %{http_code}")
fi
if [[ ($? != 0) || ($CURL_OUTPUT != "OK 200") ]]; then
echo $CURL_OUTPUT
fail_with_exitcode 197
fi
else
echo "Neither wget nor curl is installed"
fail_with_exitcode 194
fi
fi
fi
# What we echo below cannot be wider than 80 characters
echo "fc85ab364194: start"
echo "webUiAccessToken==$WEBUITOKEN=="
echo_common_results
echo "connectionToken==$CONNECTION_TOKEN=="
echo "fc85ab364194: end"
unlock $MAIN_LOCKFD $COMMIT_ID
while true; do sleep 180; echo -n ' '; done
EOSSH'
[07:55:06.959] Using connect timeout of 17 seconds
[07:55:07.339] > fc85ab364194: running
[07:55:07.340] Got some output, clearing connection timeout
[07:55:07.379] > Acquiring lock on /Users/Bryan.Childs/.vscode-server/bin/5264f2156cbcd7aea5fd004d29eaa10209155d66/vscode-remote-lock.Bryan.Childs.5264f2156cbcd7aea5fd004d29eaa10209155d66
> \ln "/Users/Bryan.Childs/.vscode-server/bin/5264f2156cbcd7aea5fd004d29eaa10209155d66/vscode-remote-lock.Bryan.Childs.5264f2156cbcd7aea5fd004d29eaa10209155d66.target" "/Users/Bryan.Childs/.vscode-server/bin/5264f2156cbcd7aea5fd004d29eaa10209155d66/vscode-remote-lock.Bryan.Childs.5264f2156cbcd7aea5fd004d29eaa10209155d66"
[07:55:07.397] > Installing to /Users/Bryan.Childs/.vscode-server/bin/5264f2156cbcd7aea5fd004d29eaa10209155d66...
[07:55:07.404] > fc85ab364194%%1%%
[07:55:07.416] > Downloading with curl
[07:55:07.422] > % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[07:55:07.685] > 100 160 100 160 0 0 615 0 --:--:-- --:--:-- --:--:-- 617
[07:55:07.728] > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[07:55:08.921] > 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
[07:55:09.924] > 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
[07:55:10.932] > 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
[07:55:11.720] > 14 166M 14 24.2M 0 0 5769k 0 0:00:29 0:00:04 0:00:25 6206k
[07:55:12.720] > 47 166M 47 79.1M 0 0 14.9M 0 0:00:11 0:00:05 0:00:06 15.8M
[07:55:13.721] > 80 166M 80 133M 0 0 21.2M 0 0:00:07 0:00:06 0:00:01 27.8M
[07:55:14.195] > 100 166M 100 166M 0 0 24.5M 0 0:00:06 0:00:06 --:--:-- 38.9M
> Download complete
[07:55:14.213] > fc85ab364194%%2%%
> tar --version:
[07:55:14.228] > tar (GNU tar) 1.35
> Copyright (C) 2023 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later .
> 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.
[07:55:14.243] > gzip: unknown compression format
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
[07:55:14.250] > ERROR: tar exited with non-0 exit code: 0
> fc85ab364194: start
> exitCode==205==
> listeningOn====
> osReleaseId==Darwin==
> arch==arm64==
> vscodeArch==arm64==
> bitness==64==
> tmpDir==/tmp==
> platform==macOS==
> unpackResult==error==
> didLocalDownload==0==
> downloadTime==7000==
> installTime==0==
> extInstallTime====
> serverStartTime====
> fc85ab364194: end
[07:55:14.251] Received install output:
exitCode==205==
listeningOn====
osReleaseId==Darwin==
arch==arm64==
vscodeArch==arm64==
bitness==64==
tmpDir==/tmp==
platform==macOS==
unpackResult==error==
didLocalDownload==0==
downloadTime==7000==
installTime==0==
extInstallTime====
serverStartTime====
[07:55:14.253] Resolver error: Error: Failed to install the VS Code Server
at y.ServerInstallError (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:722178)
at p (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:716436)
at t.handleInstallOutput (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:718073)
at t.tryInstall (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:842913)
at async /home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:801927
at async t.withShowDetailsEvent (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:805164)
at async A (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:798392)
at async t.resolve (/home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:802578)
at async /home/bryan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.124.0/out/extension.js:2:1095642
[07:55:14.263] ------
[07:55:14.264] ---------- [Session Summary] -----------
[07:55:14.264] [UnpackFailed]: Error: UnpackFailed (Failed to install the VS Code Server)
[07:55:14.264] ----------------------------------------
[07:55:14.559] "install" terminal command done
[07:55:14.559] Install terminal quit with output:
```
Contributor guide
Research direction
Start by reproducing the Remote-SSH connection to macOS using the update URL and the logged server installation flow. Inspect how the downloaded vscode-server.tar.gz archive is identified and unpacked; done means the macOS server installs and the SSH session starts successfully without UnpackFailed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100