ryanblenis / MeshCentral-WorkFromHome

Work From Home Plugin for the MeshCentral2 Project
Apache License 2.0
16 stars 4 forks source link

Disconnections #2

Closed vedran-dobos closed 4 years ago

vedran-dobos commented 4 years ago

Hi, and thanks for all your effort!

I manage to set the connections without any problem, but once I connect to a work computer the session immediately disconnects (within 0-2 seconds). I see the local RDP port changes, and the computers/agents list in Meshcentral at the same time blinks (some computers go offline and immediately back online).

I also experience similar issues with with the RoutePlus plugin, but not when I manually map ports with MeshCentral Router. Then everything works fine.

Have you experienced similar issues?

Thanks one more time!

V

ryanblenis commented 4 years ago

In this case, is the "Home" computer a Win7 machine by chance?

vedran-dobos commented 4 years ago

Sorry, I forgot this relevant info.

Windows 10 Pro x64 v1909 on both sides.

ryanblenis commented 4 years ago

Thanks, I found an issue where the agentCoreIsStable is called multiple times under certain circumstances. Working on a fix.

ryanblenis commented 4 years ago

Pushed version 0.0.4 with a fix for the port issue. I didn't see (or couldn't replicate) the agent disconnection issue, so let me know if that is fixed as well. Thank you.

vedran-dobos commented 4 years ago

Still getting disconnected after 1-5 seconds (it is a bit better though, longer) and the port does not change, which enables the RDP session to reconnect sometimes. But most times it gives up after a certain timeout period or a number of attempts.

RDC

I tried through different internet connection combinations (ADSL and 4G) thinking they were to blame. Still the same result.

Using MeshCentral Router directly (both through the Devices tab and adding a manual Mapping) works without these issues.

Is there a .log file I can send you to assist?

ryanblenis commented 4 years ago

If you change the debug_flag in the modules_meshcore/workfromhome.js on line 16 to true and refresh the core on that machine, it will generate a workfromhome.txt log in the MeshAgent directory with some diagnostic data on what the plugin is doing. If you can do that on one of the problem machines and send the log over that would be great. Thank you.

vedran-dobos commented 4 years ago

Here it is: workfromhome.txt

Thanks for your prompt response.

ryanblenis commented 4 years ago

Hi @vedran-dobos,

Thanks for that. It does seem like something is causing the connection to repeatedly rebuild itself in your case. I can't repeat it on my end, but I think I have a fix in mind. Just need to do some stability testing on my end.

In the mean time, do you notice the agent going offline quickly then coming back online during that time?

vedran-dobos commented 4 years ago

Yes, the agent "blinks", see my first message.

ryanblenis commented 4 years ago

I can't repeat that disconnection scenario, but I did just release version 0.0.5 with better detection of tearing down and rebuilding a connection if the connection already exists. Let me know how that works for you.

PS, for more testing of the agent "blinking", what version of MeshCentral server are you running?

vedran-dobos commented 4 years ago

The connection is up for 30 minutes and counting. Great job! :) I was running version 0.5.0-q up until now. Updated to -s and the plugin (v0.0.5) still works ok.

Thank you very much!

ryanblenis commented 4 years ago

Glad to hear. I'll leave this open for a few days and close if there's nothing further, or you can feel free to close / re-open as you see fit. Thank you.

vedran-dobos commented 4 years ago

Perhaps you can apply this very same fix/solution to your RoutePlus plugin, if you are interested in doing that. I experience the same issues while using it for RDP between agents. Or maybe that is a different issue all in itself.

Thanks again for this very quick fix.

ryanblenis commented 4 years ago

Closing this here, but opening on an issue on RoutePlus for followup. Thank you.