Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.98k stars 535 forks source link

Mesh agent 1.0.0.0 running in end machine but showing offline in mesh portal #4387

Open knkumar93 opened 2 years ago

knkumar93 commented 2 years ago

Describe the bug For some endpoints mesh central shows offline and not able to take remote. But in end machine the mesh agent service is running and port is reachable from client machine. Another observation is, when i run netstat command, it gives 3 established connection (screenshot mentioned in upcoming section).

To Reproduce Not able to reproduce with any specific action, problem automatically occurs in random interval

Expected behavior Expecting the mesh agent to communicate properly unless really there is a service stop or machine down or network connection is not there.

Screenshots Mesh portal screenshot:

List view: image

Inside view: image

Netstat output from server filtered with end machine IP (Same result I can from end machine also, but currently dont have that screenshot): image

Netstat output after meshcentral service restart: image

Server Software:

Client Device: I assume this section is for browser level issue, but here issue is between server and end point, however in all browsers it is showing offline only.

Remote Device:

Additional context When we restart mesh central service, those 3 connections are getting re-established on different client port, however the end machine is still offline.

We have tried setting the agentPong:35 value to verify if server is able to send traffic on those established ports, but it is not sending any traffic, apart from connection re-establishment.

When restarting mesh agent service in end machine, the agent is able to communicate and then netstat is giving single port in established state.

Your config.json file

{
  "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
  "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
  "settings": {
    "cert": "myserver.com",
    "_WANonly": true,
    "mongodb": "mongodb://127.0.0.1:27017",
    "mongodbname": "meshcentral",
    "mongodbcol": "meshcentral",
    "mongoDBDatabse": "meshcentral",
    "_LANonly": true,
    "_sessionKey": "MyReallySecretPassword1",
    "port": 8443,   
    "_aliasPort": 443,
    "_redirPort": 80,
    "_redirAliasPort": 80,
    "_browserPong": 60,
    "agentPong": 35,
    "NoAgentUpdate" : 1,
    "CookieIpCheck": false,
    "IgnoreAgentHashCheck": true,
    "autoBackup": {
        "mongoDumpPath": "C:\\Program Files\\MongoDB\\Server\\5.0\\bin\\mongodump.exe",
        "backupIntervalHours": 24,
        "keepLastDaysBackup": 15,
        "zipPassword": "TestPassword"   
      }
  },
  "domains": {
    "": {
      "title": "Mesh",
      "title2": "Remote Control",
      "_minify": true,
      "_newAccounts": true,
      "_userNameIsEmail": true,
      "welcomeText": "Mesh Remote control Management Integration Tool",
      "welcomePicture": "mainwelcome.jpg",
      "_hide": 16,
      "consentMessages": {
        "title": "Mesh RemoteControl Request",
        "desktop": "{0} requesting remote desktop access. Grant access?",
        "terminal": "{0} requesting remote terminal access. Grant access?",
        "files": "{0} requesting remote files access. Grant access?"
      },
       "notificationMessages": {
        "title": "Mesh RemoteControl Request",
        "desktop": "{0} started a remote desktop session.",
        "terminal": "{0} started a remote terminal session.",
        "files": "{0} started a remote files session."
      }
    }
  },
  "_letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
    "email": "myemail@mydomain.com",
    "names": "myserver.mydomain.com",
    "production": false
  }
}
si458 commented 2 years ago

not sure if it matters but you are running the 32bit version of the agent on Windows 11 Pro you need to run the 64 bit version!

knkumar93 commented 2 years ago

Hi @si458, understood, however in other environment we run in same way but not observing this behavior. Just wanted to verify if any way to debug this problem, hence posted.

Adding one more point which might be helpful - End machine uses Sophos endpoint security and antivirus exclusion is added for the mesh agent folder.

knkumar93 commented 2 years ago

Hi @Ylianst, any better way to check this problem? whether upgrading to latest version will solve the behavior which I explained?

knkumar93 commented 2 years ago

In addition to what I have reported above, we found another machine, where mesh agent exe is running in windows 10 OS, and 3 connections in ESTABLISHED state, but in server side for that client no connection is present. Both server and client present in same LAN. One suspect is, issue started in the evening time upon analysing end machine event logs, it is found that they have shut down the machine (Fast startup enabled - Hibernate) and started next day morning.

knkumar93 commented 1 year ago

Observed this issue present in v1.0.76 as well. Very rare to reproduce. Suspect is when network switches or when system goes to hibernate and wake up it could be happening. But not able to reproduce it easily.

AymanAnsari commented 11 months ago

Hi, I am getting Mesh central offline when I restart my mac. So I have o reinstall it again and again to make it work after restart. Do someone know why is this happening. FYI- I have installed it from binary file. As .mpkg package is not letting me control even when I have given screen recording permission and Accessibility.

si458 commented 11 months ago

@AymanAnsari the is a bug with Macs and startups not running the MeshAgent #4849 #4822

AymanAnsari commented 11 months ago

@si458 Thanks For the Help...It works.

AymanAnsari commented 11 months ago

Although I am getting the Mesh agent online now after restart. But on the login screen it was showing blank screen. Only when I logged in can the Mesh agent shows the screen properly. Does anyone know why?

si458 commented 11 months ago

@AymanAnsari i think the binary files are User based control not SYSTEM based control, so i dont think you can control the login screen? sadly i dont have a mac to test but do search the issues as the is loads of different issues about mac - https://github.com/Ylianst/MeshCentral/issues?q=mac

mdshoaibumer commented 6 months ago

Hi @Ylianst , Any update on this issue?

si458 commented 6 months ago

@mdshoaibumer what was your issue? as this is an old stale issue, might be better you create a new issue