MeshCentral icon indicating copy to clipboard operation
MeshCentral copied to clipboard

Issues with Windows Agent Features

Open jiynn opened this issue 2 years ago • 21 comments

My current setup is a Windows Server running IIS on the front, and a MeshCentral Server on an Ubuntu Virtual Server in the back. I have it running through a Reverse Proxy in IIS with the websockets working properly. Everything was working for a while.

My current issue: I can no longer gain access to Desktop, Terminal, Files, etc... I can only see General, Events, Details, and Console.

  • The agent will not respond to console commands
  • I have tried to clear core and upload both default and recovery cores
  • I have tried to uninstall and reinstall the agent
  • I have renamed node and did another npm pull
  • I have gone to latest version, and stable version
  • I have restarted the server (both linux and windows)
  • I have tried to install both from direct in mesh, and from invitation link
  • I have tried both 32bit and 64bit installs (just in case)

The only thing I see is the status of the agent connected, nothing else seems to respond. Interestingly enough, if I install the Assistant on the same machine, that allows me all features.

Please let me know if you have any ideas or solutions.

jiynn avatar Jul 03 '22 07:07 jiynn

please can you follow the bug report template in the future as it has critical information to help with your issue what version are you using? how are the windows server and ubuntu VM connected together? what hypervisor are you using?

si458 avatar Jul 03 '22 08:07 si458

My current MeshCentral version setting right now is Stable - 1.0.0, I was using Latest 1.0.45.

I am using VMWare Workstation on the Windows Server, the network connection is set to "Bridged" and set to replicate the physical network connection state.

jiynn avatar Jul 03 '22 14:07 jiynn

Here is my config.json

{
  "__comment__" : "This is a sample configuration file, edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "settings": {
    "Cert": "jiynn.xyz",
    "MongoDb": "mongodb://127.0.0.1:27017/meshcentral",
    "_MongoDbCol": "meshcentral",
    "WANonly": false,
    "LANonly": false,
    "_Minify": 1,
    "_SessionTime": 30,
    "_SessionKey": "MyReallySecretPassword",
    "Port": 4430,
    "RedirPort": 800,
    "AgentPong": 300,
    "AliasPort": 443,
    "_AllowLoginToken": true,
    "_AllowFraming": true,
    "_WebRTC": false,
    "_SelfUpdate": true,
    "_UserAllowedIP": "127.0.0.1,::1,192.168.0.100",
    "_LocalDiscovery": { "name": "Local server name", "info": "Information about this server" },
    "TlsOffload": "127.0.0.1,192.168.50.200,::1",
    "_MpsTlsOffload":  true
  },
  "domains": {
    "": {
      "title": "MeshCentral",
      "_title2": "Servername",
      "userQuota": 1048576,
      "meshQuota": 248576,
      "newAccounts": 1,
      "footer": "https://adamjtimmons.us.to",
      "certUrl": "jiynn.xyz:443",
      "image": "agent-logo.png"
    },
    "customer1": {
      "dns": "customer1.myserver.com",
      "title": "Customer1",
      "title2": "TestServer",
      "newAccounts": 1,
      "auth": "sspi",
      "footer": "Test",
      "_certUrl": "https://192.168.2.106:443/"
    },
    "info": {
      "share": "C:\\ExtraWebSite"
    }
  },
  "letsencrypt": {
    "email": "[email protected]",
    "names": "jiynn.xyz",
    "rsaKeySize": 3072,
    "production": false
  },
  "_peers": {
    "serverId": "server1",
    "servers": {
      "server1": { "url": "wss://192.168.2.133:443/" },
      "server2": { "url": "wss://192.168.1.106:443/" }
    }
  },
  "_smtp": {
    "host": "smtp.myserver.com",
    "port": 25,
    "from": "[email protected]",
    "tls": false
  }
}

jiynn avatar Jul 03 '22 14:07 jiynn

My current MeshCentral version setting right now is Stable - 1.0.0, I was using Latest 1.0.45.

i dont believe rolling back is possible as an upgrade might have database changes which an older version cant understand can you try running the latest version and see if you still have these issues?

si458 avatar Jul 03 '22 14:07 si458

I already have gone back and forth in order to see if the issues remained, uninstalling and reinstalling the agent as this was done. Still no luck

jiynn avatar Jul 03 '22 14:07 jiynn

can you try doing a complete fresh install of the server and the agent on another computer?

can you also go into the My Server tab, is the anything listed under the Server State section? like invalid signature

can you also see if the is any server errors using the show server error log in the My Server tab?

can you also go into the console on the My Server tab and type info and let us know the reply?

si458 avatar Jul 03 '22 15:07 si458

Server Has no Error Logs Nothing weird listed under server state

 

info{ "meshVersion": "v1.0.45", "nodeVersion": "v17.9.0", "runMode": "Hybrid (LAN + WAN) mode", "productionMode": true, "database": "MongoDB", "dbChangeStream": false, "dbBulkOperations": false, "platform": "linux", "arch": "x64", "pid": 16181, "uptime": 815.215707015, "cpuUsage": { "user": 6780659, "system": 4097983 }, "memoryUsage": { "rss": 156852224, "heapTotal": 43814912, "heapUsed": 41438128, "external": 48884378, "arrayBuffers": 47799412 }, "warnings": [ { "msg": "Redirection web server must be active on port 80 for Let's Encrypt to work." } ], "allDevGroupManagers": [] }

jiynn avatar Jul 03 '22 15:07 jiynn

What windows server version are you running?

krayon007 avatar Jul 03 '22 15:07 krayon007

Windows Server 2019 Standard v1809

jiynn avatar Jul 03 '22 15:07 jiynn

"warnings": [ { "msg": "Redirection web server must be active on port 80 for Let's Encrypt to work." } ],

how are you doing the SSL? you said its IIS doing reverse proxy to the Ubuntu VM?

EDIT:

"letsencrypt": { "email": "[email protected]", "names": "jiynn.xyz", "rsaKeySize": 3072, "production": false },

i think this can be commented out/removed if the IIS is doing the SSL certificate

si458 avatar Jul 03 '22 15:07 si458

I also run SSL through LetsEncrypt on my IIS server, I'll comment it out.

jiynn avatar Jul 03 '22 15:07 jiynn

https://discord.gg/2nmGP8hq - unoffical meshcentral discord might be easier chatting here, saves comment after comment after comment

si458 avatar Jul 03 '22 15:07 si458

One thing you can try is to stop the agent background service, then try to run the agent in console mode, to see what if any errors are reported.

You can run it this way: MeshAgent run

krayon007 avatar Jul 03 '22 15:07 krayon007

One thing you can try is to stop the agent background service, then try to run the agent in console mode, to see what if any errors are reported.

You can run it this way: MeshAgent run

OMG i never knew that, just tried that haha, amazing!

si458 avatar Jul 03 '22 15:07 si458

C:\Program Files\Mesh Agent>meshagent run Connecting to: wss://jiynn.xyz:443/agent.ashx Connected.

That's all I get

jiynn avatar Jul 03 '22 15:07 jiynn

There must be something the server doesn't like. It looks like the agent connects fine, but the server isn't sending a core to the agent. It looks like the control channel is not authenticating.

krayon007 avatar Jul 03 '22 15:07 krayon007

Well, interestingly enough, I started another computer I had installed an agent on before this issue showed up, and it works perfectly fine, all features available and responding to console commands... Not sure what has changed, but new installs don't work.

jiynn avatar Jul 03 '22 15:07 jiynn

So it seems the issue was the DB and MSH files... they are not generating correctly... I've had to take working DB and MSH files from another computer that connects properly and share those with the ones not working... Is there a way to fix these files for future installs?

jiynn avatar Jul 03 '22 22:07 jiynn

Do you know which entry in the msh file was causing the problem?

krayon007 avatar Jul 03 '22 22:07 krayon007

I think it was the Mesh ID, when running the server manually, I got this error message:

Agent connected with invalid domain/mesh, holding connection (192.168.50.199:61958, mesh//$pXomGb0tsgX743csZyZzRqEIr9Ab0pIEJ@8uc6u1Cx9$DlX0xTt6rxpyVZlvkpd).

I did have to replace the DB file as well

jiynn avatar Jul 03 '22 22:07 jiynn

I'm a little late to the party, however, I noticed a couple of things with your configuration file:

  1. I assume you're running your server in hybrid mode, so why don't you just comment out WANonly and LANonly?

  2. You appear to be offloading TLS to your IIS server, yet your TlsOffload setting appears to be pointing at the MC server itself. Shouldn't it be pointed at the IIS server?

kismetgerald avatar Jul 05 '22 09:07 kismetgerald

I have the same issue, while using IIS as a reverse proxy.

chk-mytoys avatar Feb 20 '24 20:02 chk-mytoys

@chk-mytoys I'm going to close this issue as its stale. Please can you open a fresh bug report, follow its template and include all the info it wants and I can have a fresh look!

si458 avatar Feb 20 '24 20:02 si458