Sysprogs forums › Forums › VisualGDB › SSH Connection Failure Locks Project
- This topic has 6 replies, 2 voices, and was last updated 2 years, 5 months ago by michael127001.
-
AuthorPosts
-
June 13, 2022 at 14:03 #32752michael127001Participant
Hi, all:
I’m working on a Visual Studio 2022 project using VisualGDB to SSH into a virtual machine to build my source code. However, the IP of my VM changed. This caused VS to be stuck in a loop of attempting to SSH in the following process:
- Open my .sln file from VS splash screen
- VisualGDB attempts to establish SSH connection
- Connection times out with the error System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xxx.xxx.xxx.xx:xx.
- VisualGDB attempts again to reconnect (2.)
- I hit Cancel in the SSH dialog:
- Hitting ok returns to the SSH dialog (2.)
- Terminate VS to exit loop
Somewhere between step 7 and 2 I may get this dialog:
However, waiting 15 seconds goes to (2.) and OK returns to the same dialog.
It seems there is no way out of this connection loop. My source code is stored on my Windows 11 machine along with the entire solution. The files are SCP-ed to the remote to build. Is there I way I can break from this loop and set the IP to a different address without configuring a new project?
Thanks!
June 13, 2022 at 14:15 #32754supportKeymasterHi,
This looks like an issue with your network settings. Please try checking if running “ping <VM name>” picks up the new IP address of the VM. If not, VisualGDB would not pick it up either.
June 14, 2022 at 06:43 #32757michael127001ParticipantHi- thanks for the reply.
I was never able to ping a hostname (which is also the Hyper-V name) of the VM i.e. “ping centos7”. However, I can ping and SSH in at its IP 192.168.x.x, which is how I set the project up. The IP starts with 172.x.x.x in my screenshots, so the IP definitely changed. At some point I had to swap the network switch from an internal to external network which may have forced this change, along with DHCP. Using the previous internal switch generates a new 172 address, but not the same as what VisualGDB is trying to connect to.
I had issues trying to order a static IP to the VM that VisualGDB is trying to connect, so I really believed I could just edit the VisualGDB project properties any time the IP changed. As far as I can tell, I have the following options:
- Continue trying to order the IP of the VM to match what VisualGDB is trying to connect to.
- Edit the VisualGDB project properties somehow.
- Setup a new project.
Any advice?
June 14, 2022 at 08:50 #32758supportKeymasterHi,
VisualGDB uses the same API for resolving host names as other Windows commands. So if the “ping” command doesn’t see your host names, VisualGDB won’t see them either.
Specifying the IP address manually and changing it via project settings should work just fine – clicking “Cancel” in the connection progress dialog should stop the project from loading, but should not prevent you from changing the settings.
If it still doesn’t work, please provide complete and detailed steps to reproduce the issue as described below:
- The steps should begin with launching Visual Studio. They should include every step necessary to create the project from scratch and reproduce the issue.
- Please make sure the steps do not involve any 3rd-party code as we will not be able to review it. If the problem only happens with a specific project, please make sure you can reproduce it on a clean project created from scratch.
- The steps should include uncropped screenshots of all wizard pages, VisualGDB Project Properties pages and any other GUI involved in reproducing the problem. This is critical for us to be able to reproduce the problem on our side. Please do not block parts of the screenshots showing the values of different settings. They are critical to finding the cause of many issues. If you do not wish to share sensitive information, please reproduce the problem on a simplified setup involving test projects and computers.
You can read more about the best way to report VisualGDB issues in our problem reporting guidelines, If you do not wish to document the repro steps and save the screenshots, please consider recording a screen video instead and sending us a link to it.
Please note that many VisualGDB issues are caused by selecting an incompatible combination of settings at some point. We are generally not able to review specific projects and find the specific settings that were set incorrectly. We recommend checking the projects into source control and keeping a track of all changed settings to avoid breaking the projects.
June 14, 2022 at 12:25 #32760michael127001ParticipantI believe I have nailed the source of error. You are correct in that “many VisualGDB issues are caused by selecting an incompatible combination of settings at some point.” Though, I think this warrants a fix of sorts. The source of the issue comes from Synchronized Directories where, if set to sync on opening the project, VisualGDB gets stuck in a loop attempting to connect and synchronize, even if many attempts have failed. Steps:
- Create a new Visual Studio 2022 project with VisualGDB Linux Project Wizard template:
<hr />
- Create a new SSH connection when setting remote computer:
<hr />
- Save host key
- Fix mismatching environment:
<hr />
- Set source files directory (I think source code access can be set to default):
<hr />
- Finish project setup. At this point Visual Studio can run and debug “Hello, World!” on the Virtual Machine (at this point I think it is remote source agnostic)
- Add shared folder:
<hr />
- Exit Visual Studio and re-assign IP (or disconnect) remote source
- Open Visual Studio and load solution
- Visual Studio attempts to connect:
<hr />
- Clicking OK then Cancel opens a dialog box saying the operation was cancelled
- Clicking OK in that dialog box in under 15 seconds goes to this dialog:
<hr />
- Clicking (14.) after 15 seconds goes back to (12.)
- Clicking (15.) after 15 seconds goes back to (12.)
- Clicking (15.) under 15 seconds goes back to (15.)
- Repeat (12.) and (15.) ad. infinitum (kill with Task Manager to exit)
Fortunately I have found a workaround! In a different VisualGDB project I loaded the project settings and deleted the remote source for the repo I am trying to fix:
Then when I load my original project I get the prompt to set the remote host again:
<hr />
Hopefully this is enough information to reproduce the error. It would be nice if after a couple attempts of failing to SSH in and sync directories the Resolve Project Load Issues dialog was available.
Thanks!
June 15, 2022 at 12:07 #32761supportKeymasterThanks, we have confirmed that configuring VisualGDB to synchronize a directory with a specific IP address during project loading (as opposed to building) and then changing that IP address without updating the VisualGDB project indeed prevents the project from loading correctly.
As the issue is only triggered under a very specific configuration, we will fix it in one of the upcoming VisualGDB updates and will not produce an immediate hotfix.
As a workaround, please consider using the hosts file to define persistent names for your VMs so that you won’t need to change the project settings every time.
June 16, 2022 at 07:23 #32763michael127001ParticipantWow, thanks for the tip! I’ve been trying to figure out how to reference my VM by name for a while now 😁
-
AuthorPosts
- You must be logged in to reply to this topic.