SSH Connection Failure Locks Project

Sysprogs forums Forums VisualGDB SSH Connection Failure Locks Project

This topic contains 6 replies, has 2 voices, and was last updated by  michael127001 2 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #32752

    michael127001
    Participant

    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:

     

    1. Open my .sln file from VS splash screen
    2. VisualGDB attempts to establish SSH connection
    3. 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.
    4. VisualGDB attempts again to reconnect (2.)
    5. I hit Cancel in the SSH dialog:
    6.  The operation was canceled.
    7. Hitting ok returns to the SSH dialog (2.)
    8. 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!

    #32754

    support
    Keymaster

    Hi,

    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.

    #32757

    michael127001
    Participant

    Hi- 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?

    #32758

    support
    Keymaster

    Hi,

    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:

    1. The steps should begin with launching Visual Studio. They should include every step necessary to create the project from scratch and reproduce the issue.
    2. 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.
    3. 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.

    #32760

    michael127001
    Participant

    I 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:

    1. Create a new Visual Studio 2022 project with VisualGDB Linux Project Wizard template:

      <hr />

    2. Create a new SSH connection when setting remote computer:

      <hr />

    3. Save host key
    4. Fix mismatching environment:

      <hr />

    5. Set source files directory (I think source code access can be set to default):

      <hr />

    6. 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)
    7. Add shared folder:

      <hr />

    8. Exit Visual Studio and re-assign IP (or disconnect) remote source
    9. Open Visual Studio and load solution
    10. Visual Studio attempts to connect:

      <hr />

    11. Clicking OK then Cancel opens a dialog box saying the operation was cancelled
    12. Clicking OK in that dialog box in under 15 seconds goes to this dialog:

      <hr />

    13. Clicking (14.) after 15 seconds goes back to (12.)
    14. Clicking (15.) after 15 seconds goes back to (12.)
    15. Clicking (15.) under 15 seconds goes back to (15.)
    16. 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!

    #32761

    support
    Keymaster

    Thanks, 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.

    #32763

    michael127001
    Participant

    Wow, thanks for the tip! I’ve been trying to figure out how to reference my VM by name for a while now 😁

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.