microsoft / VSDebugAdapterHost

Visual Studio Debug Adapter Host
MIT License
77 stars 20 forks source link

Visual Studio 2022 unable to connect to remote Linux-Arm #26

Closed jbatt33 closed 2 years ago

jbatt33 commented 2 years ago

I'm attempting to have Visual Studio 2022 remote connect to my linux-arm over SSH. I'm getting some errors, but I can't seem to determine what is missing on the remote side to resolve. Below are the logs from visual studio, but from what I can see all the command commands issues from visual studio are successful, but it seems to be failing to find the home folder?

When I attach I'm able to run the GetVsDbg script manually, so I'm not too sure what to debug at this point,

`Failure Location: LaunchingProcess Determining user folder on remote system... Failed: No such file Inner Exception: IOException: No such file

liblinux.IO.RemoteFileSystemImpl.GetPermissions(String remotePath) liblinux.IO.RemoteFileSystemInfo..ctor(IRemoteFileSystem fs, String remotePath) liblinux.IO.RemoteFileSystemImpl.GetDirectory(String remotePath) liblinux.IO.RemoteFileSystemImpl.GetDirectory(SpecialDirectory directory) Microsoft.SSHDebugPS.SSH.SSHConnection.GetUserHomeDirectory() Microsoft.VisualStudio.Debugger.VsDbg.Integration.AdapterLauncher.VsDbgRemoteUnixLauncher.Microsoft.VisualStudio.Debugger.DebugAdapterHost.Interfaces.IAdapterLauncher.LaunchAdapter(IAdapterLaunchInfo launchInfo, ITargetHostInterop targetInterop) Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.AdapterHosting.DebugAdapterProcessConnection..ctor(ConfigurationWrapper configuration, IDiagnosticLogger log, IAdapterLaunchInfo launchInfo, ITargetHostInterop targetInterop, IAdapterLauncher launcher) Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.AdapterHosting.DebugAdapterHostFactory.CreateDebugAdapterHost(ConfigurationWrapper configuration, IDiagnosticLogger log, ExtensibilityManager extensibilityManager, IAdapterLaunchInfo launchInfo, ITargetHostInterop targetInterop, Boolean registerStandardHandlers, DebugProtocolOptions options, Action`1 syncRequestErrorHandler) Inner Exception: SftpPathNotFoundException: No such file

Renci.SshNet.Sftp.SftpSession.RequestLStat(String path) Renci.SshNet.SftpClient.Get(String path) liblinux.IO.RemoteFileSystemImpl.GetPermissions(String remotePath)

1> ERROR: Failed to launch debug adapter. Additional information may be available in the output window.

No such file

No such file `

Here is also the Crossplatform log: 1:18:08.3865072 [Info, Thread 140] liblinux.RemoteSystemBase: Connecting over SSH to 192.168.4.130:2222 11:18:08.8195047 [Info, Thread 27] liblinux.Shell.CommonCommandBase: Command "sh -c "id -u -n"" finished with exit code 0 after 102.2694ms 11:18:08.8589404 [Info, Thread 27] liblinux.Shell.CommonCommandBase: Command "sh -c "uname -m"" finished with exit code 0 after 39.0496ms 11:18:08.9225611 [Info, Thread 27] liblinux.Shell.CommonCommandBase: Command "sh -c "ps axww -o pid=pppppppppp -o flags=ffffffff -o ruser=rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr -o args"" finished with exit code 0 after 63.4433ms 11:18:19.4110476 [Info, Thread 88] liblinux.Shell.CommonCommandBase: Command "sh -c "id -u -n"" finished with exit code 0 after 37.5707ms 11:18:19.4494788 [Info, Thread 88] liblinux.Shell.CommonCommandBase: Command "sh -c "uname -m"" finished with exit code 0 after 38.4838ms 11:18:19.5133604 [Info, Thread 88] liblinux.Shell.CommonCommandBase: Command "sh -c "ps axww -o pid=pppppppppp -o flags=ffffffff -o ruser=rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr -o args"" finished with exit code 0 after 62.8721ms 11:18:23.6271048 [Info, Thread 1] liblinux.Shell.CommonCommandBase: Command "sh -c "uname"" finished with exit code 0 after 42.2677ms 11:18:23.6271048 [Info, Thread 1] liblinux.IO.RemoteFileSystemImpl: Connecting over SFTP to 192.168.4.130:2222 11:18:24.1352705 [Info, Thread 1] liblinux.Shell.CommonCommandBase: Command "sh -c "echo $HOME"" finished with exit code 0 after 35.9084ms 11:18:24.1721788 [Info, Thread 1] liblinux.Shell.CommonCommandBase: Command "sh -c "basename '/ftp'"" finished with exit code 0 after 36.2109ms

andrewcrawley commented 2 years ago

From the logs, it looks like the SSH infrastructure in VS is failing to determine your home directory on the remote system.

Could you check to be sure that your remote system is setting $HOME to a valid path that your user can write to?

jbatt33 commented 2 years ago

@andrewcrawley Yes, so I attached another visual studio to the one that was attempting to attach to determine what path it couldn't find. I determined that the issue is that my home directory is present over the SSH connections, however the SFTP connections show a different directory structure causing the SFTP library to toss a fit. While it would have been nice if the exception message included the path that it couldn't find. I'm going to close this out as invalid since this is a setup issue and nothing wrong with the main library. Thanks for responding quickly.