Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse remote port from server output #10606

Closed
6 tasks done
pWoLiAn opened this issue Jan 6, 2025 · 2 comments
Closed
6 tasks done

Failed to parse remote port from server output #10606

pWoLiAn opened this issue Jan 6, 2025 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@pWoLiAn
Copy link

pWoLiAn commented Jan 6, 2025

Is there an existing issue for this bug?

  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.

Required Troubleshooting Steps

  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar

[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I did not try step 2 of the troubleshooting steps

Remote-SSH Log

Remote-SSH Log

[16:20:41.459] Log Level: 2
[16:20:41.481] SSH Resolver called for "ssh-remote+vm", attempt 1
[16:20:41.483] remote.SSH.useLocalServer = false
[16:20:41.484] remote.SSH.useExecServer = true
[16:20:41.484] remote.SSH.showLoginTerminal = false
[16:20:41.484] remote.SSH.remotePlatform = {"vm":"linux","10.189.72.139":"linux","10.22.184.135":"linux","10.189.72.241":"linux","10.189.64.144":"linux","10.189.72.206":"linux","10.189.73.56":"linux","10.189.72.226":"linux","10.189.64.121":"linux","10.189.73.76":"linux"}
[16:20:41.484] remote.SSH.path = C:\WINDOWS\System32\OpenSSH\ssh.exe
[16:20:41.484] remote.SSH.configFile = undefined
[16:20:41.484] remote.SSH.useFlock = true
[16:20:41.484] remote.SSH.lockfilesInTmp = false
[16:20:41.484] remote.SSH.localServerDownload = auto
[16:20:41.484] remote.SSH.remoteServerListenOnSocket = false
[16:20:41.484] remote.SSH.defaultExtensions = []
[16:20:41.484] remote.SSH.loglevel = 2
[16:20:41.484] remote.SSH.enableDynamicForwarding = true
[16:20:41.484] remote.SSH.enableRemoteCommand = false
[16:20:41.484] remote.SSH.serverPickPortsFromRange = {}
[16:20:41.484] remote.SSH.serverInstallPath = {}
[16:20:41.484] remote.SSH.permitPtyAllocation = false
[16:20:41.484] remote.SSH.preferredLocalPortRange = undefined
[16:20:41.484] remote.SSH.useCurlAndWgetConfigurationFiles = false
[16:20:41.485] remote.SSH.experimental.chat = false
[16:20:41.485] remote.SSH.experimental.enhancedSessionLogs = false
[16:20:41.494] VS Code version: 1.96.2
[16:20:41.494] Remote-SSH version: [email protected]
[16:20:41.494] win32 x64
[16:20:41.500] SSH Resolver called for host: vm
[16:20:41.501] Setting up SSH remote "vm"
[16:20:41.512] Using commit id "fabdb6a30b49f79a7aba0f2ad9df9b399473380f" and quality "stable" for server
[16:20:41.520] Script variables:
 {
  "ExitCode.0": "OK",
  "ExitCode.64": "LinuxPrereqs",
  "ExitCode.65": "ProxyAuthenticationRequired",
  "ExitCode.128": "UnparsableOutput",
  "ExitCode.129": "EmptyOutput",
  "ExitCode.131": "UnhandledResolverExitCode",
  "ExitCode.132": "OfflineError",
  "ExitCode.133": "SshInstall",
  "ExitCode.134": "FindLocalPort",
  "ExitCode.135": "Timeout",
  "ExitCode.136": "ExhaustedRetries",
  "ExitCode.137": "PermissionDenied",
  "ExitCode.138": "MitmPortForwardingDisabled",
  "ExitCode.139": "Canceled",
  "ExitCode.140": "BadLocalDownloadRequest",
  "ExitCode.141": "LocalDownloadFailed",
  "ExitCode.142": "LocalLockTimeout",
  "ExitCode.143": "NoBash",
  "ExitCode.144": "InvalidHostName",
  "ExitCode.145": "BadInstallScriptResult",
  "ExitCode.146": "ShellRequestFailedOnChannel",
  "ExitCode.147": "InvalidPortRange",
  "ExitCode.148": "SendDisconnectBrokenPipe",
  "ExitCode.149": "LocalServerCrashed",
  "ExitCode.150": "NoFreePortInRange",
  "ExitCode.151": "InvalidCustomServerPath",
  "ExitCode.192": "AlreadyInProgress",
  "ExitCode.193": "ServerDownloadFailed",
  "ExitCode.194": "NoDownloaderAvailable",
  "ExitCode.195": "NoDownloaderAvailableForStatusCheck",
  "ExitCode.196": "UnsupportedArch",
  "ExitCode.197": "StatusCheckFailed",
  "ExitCode.198": "NeedInsidersArch",
  "ExitCode.199": "ServerTransferFailed",
  "ExitCode.200": "ServerFailedToStart",
  "ExitCode.201": "NeedInsidersWindows",
  "ExitCode.202": "CreateInstallDirFailed",
  "ExitCode.203": "UnsupportedPlatform",
  "ExitCode.204": "ServerTerminatedCVE20201416",
  "ExitCode.205": "UnpackFailed",
  "ExitCode.206": "ChangeDirFailed",
  "ExitCode.1023": "UnclassifiedError",
  "ExitCode.OK": "0",
  "ExitCode.LinuxPrereqs": "64",
  "ExitCode.ProxyAuthenticationRequired": "65",
  "ExitCode.UnparsableOutput": "128",
  "ExitCode.EmptyOutput": "129",
  "ExitCode.UnhandledResolverExitCode": "131",
  "ExitCode.OfflineError": "132",
  "ExitCode.SshInstall": "133",
  "ExitCode.FindLocalPort": "134",
  "ExitCode.Timeout": "135",
  "ExitCode.ExhaustedRetries": "136",
  "ExitCode.PermissionDenied": "137",
  "ExitCode.MitmPortForwardingDisabled": "138",
  "ExitCode.Canceled": "139",
  "ExitCode.BadLocalDownloadRequest": "140",
  "ExitCode.LocalDownloadFailed": "141",
  "ExitCode.LocalLockTimeout": "142",
  "ExitCode.NoBash": "143",
  "ExitCode.InvalidHostName": "144",
  "ExitCode.BadInstallScriptResult": "145",
  "ExitCode.ShellRequestFailedOnChannel": "146",
  "ExitCode.InvalidPortRange": "147",
  "ExitCode.SendDisconnectBrokenPipe": "148",
  "ExitCode.LocalServerCrashed": "149",
  "ExitCode.NoFreePortInRange": "150",
  "ExitCode.InvalidCustomServerPath": "151",
  "ExitCode.AlreadyInProgress": "192",
  "ExitCode.ServerDownloadFailed": "193",
  "ExitCode.NoDownloaderAvailable": "194",
  "ExitCode.NoDownloaderAvailableForStatusCheck": "195",
  "ExitCode.UnsupportedArch": "196",
  "ExitCode.StatusCheckFailed": "197",
  "ExitCode.NeedInsidersArch": "198",
  "ExitCode.ServerTransferFailed": "199",
  "ExitCode.ServerFailedToStart": "200",
  "ExitCode.NeedInsidersWindows": "201",
  "ExitCode.CreateInstallDirFailed": "202",
  "ExitCode.UnsupportedPlatform": "203",
  "ExitCode.ServerTerminatedCVE20201416": "204",
  "ExitCode.UnpackFailed": "205",
  "ExitCode.ChangeDirFailed": "206",
  "ExitCode.UnclassifiedError": "1023",
  "InstallUnpackCode.Success": "success",
  "InstallUnpackCode.Error": "error",
  "InstallUnpackCode.MissingFiles": "missingFiles",
  "uuid": "be9fd77739fa",
  "startMarker": "be9fd77739fa: running",
  "commitId": "fabdb6a30b49f79a7aba0f2ad9df9b399473380f",
  "quality": "stable",
  "token": "1a11111a-1a11-111a-1a11-1111a11aa111",
  "vscodeAgentFolder": "$HOME/.vscode-server",
  "allowClientDownload": "1",
  "forceClientDownload": "0",
  "cliNameInArchive": "code",
  "ignoreWgetConfigFlag": " --no-config ",
  "ignoreCurlConfigFlag": " --disable ",
  "wgetTriesSegment": "--tries=1",
  "listenArgs": "--on-host=127.0.0.1 --on-port",
  "getDownloadServerStartTrigger": "be9fd77739fa:trigger_server_download",
  "getDownloadServerEndTrigger": "be9fd77739fa:trigger_server_download_end",
  "getProgressDownloading": "be9fd77739fa%%1%%",
  "getProgressInstalling": "be9fd77739fa%%2%%",
  "printVars": "echo \"SSH_AUTH_SOCK==$SSH_AUTH_SOCK==\"\necho \"DISPLAY==$DISPLAY==\""
}
[16:20:41.523] Install and start server if needed
[16:20:41.527] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[16:20:41.607] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

[16:20:41.614] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 63071 vm sh
[16:20:41.616] Generated SSH command: 'type "C:\Users\scariaj\AppData\Local\Temp\vscode-linux-multi-line-command-vm-532138446.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 63071 vm sh'
[16:20:41.617] Using connect timeout of 17 seconds
[16:20:41.618] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:20:42.280] > 
[16:20:42.281] Got some output, clearing connection timeout
[16:20:46.210] > be9fd77739fa: running
> Script executing under PID: 245953
[16:20:46.307] > Found existing installation at /root/.vscode-server...
[16:20:46.327] > Starting VS Code CLI...
> printenv:
[16:20:46.344] >     LANGUAGE=en_IN:en
>     USER=root
>     SSH_CLIENT=10.120.55.74 63077 22
>     XDG_SESSION_TYPE=tty
>     SHLVL=0
>     MOTD_SHOWN=pam
>     HOME=/root
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
>     LOGNAME=root
>     _=/bin/sh
>     XDG_SESSION_CLASS=user
>     XDG_SESSION_ID=23
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
>     XDG_RUNTIME_DIR=/run/user/0
>     LANG=en_IN
>     SHELL=/bin/bash
>     PWD=/root
>     SSH_CONNECTION=10.120.55.74 63077 10.189.73.30 22
> Removing old logfile at /root/.vscode-server/.cli.fabdb6a30b49f79a7aba0f2ad9df9b399473380f.log
[16:20:46.360] > Spawned remote CLI: 246005
[16:20:46.382] > Waiting for server log...
[16:20:46.404] > Waiting for server log...
[16:20:46.459] > Waiting for server log...
[16:20:46.496] > Waiting for server log...
[16:20:46.532] > Waiting for server log...
[16:20:46.559] > Waiting for server log...
[16:20:46.597] > Waiting for server log...
[16:20:46.618] > 
[16:20:46.644] > Waiting for server log...
[16:20:46.677] > Waiting for server log...
[16:20:46.716] > Waiting for server log...
[16:20:46.748] > Waiting for server log...
[16:20:46.786] > Waiting for server log...
[16:20:46.825] > Waiting for server log...
[16:20:46.856] > Waiting for server log...
[16:20:46.894] > Waiting for server log...
[16:20:46.932] > be9fd77739fa: start
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==601==
> execServerToken==1a11111a-1a11-111a-1a11-1111a11aa111==
> platformDownloadPath==cli-alpine-x64==
> SSH_AUTH_SOCK====
> DISPLAY====
> be9fd77739fa: end
[16:20:46.933] Received install output: 
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/0==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==601==
execServerToken==1a11111a-1a11-111a-1a11-1111a11aa111==
platformDownloadPath==cli-alpine-x64==
SSH_AUTH_SOCK====
DISPLAY====

[16:20:46.933] Failed to parse remote port from server output
[16:20:46.935] Resolver error: Error: 
	at v.Create (c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:696499)
	at t.handleInstallOutput (c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:694580)
	at t.tryInstall (c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:812473)
	at async c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:771431
	at async t.withShowDetailsEvent (c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:774668)
	at async x (c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:768087)
	at async t.resolve (c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:772083)
	at async c:\Users\scariaj\.vscode\extensions\ms-vscode-remote.remote-ssh-0.116.1\out\extension.js:2:1055245
[16:20:46.940] ------




[16:20:46.941] No hints found in the recent session.
[16:20:47.413] > 

Expected Behavior

If I had connected to a remote machine during my previous session, the next time I open VSCode, it automatically tries to connect to the same machine and errors out

Actual Behavior

VSCode should not error out on the second connection

Steps To Reproduce

  1. Connect to a remote machine via ssh
  2. Connection establishes successfully and vscode functions as expected
  3. Close VSCode
  4. Open VScode again. VScode automatically tries to connect to the previously connected machine
  5. This time, connection is aborted with above mentioned error
  6. When I close the connection and try to connect to the same machine again manually, connection is established successfully

Anything else?

No response

@pWoLiAn pWoLiAn added the ssh Issue in vscode-remote SSH label Jan 6, 2025
@joshspicer
Copy link
Member

Thanks for taking the time to open an issue.

Interesting - if you disconnect with > Close Remote Connection instead of exiting VS Code while connected, does the issue persist?

On the second time around, would you be able to grab and share the contents of the /root/.vscode-server/.cli.fabdb6a30b49f79a7aba0f2ad9df9b399473380f.log log file on the remote. Note that the name might not match exactly if the commit has changed from fabd....

Lastly, could you share a bit about the remote machine? Is the filesystem where /root exists on a remote file share (cifs) or similar? We've seen issues in the past of funky filesystems and writing to this log file.

@joshspicer joshspicer added the info-needed Issue requires more information from poster label Feb 4, 2025
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

2 participants