amidaware / tacticalrmm

A remote monitoring & management tool, built with Django, Vue and Go.
https://docs.tacticalrmm.com
Other
2.92k stars 422 forks source link

Error getting mesh device id : did not receive a valid HTTP response #1848

Closed zagub59 closed 2 months ago

zagub59 commented 2 months ago

Server Info (please complete the following information):

Installation Method:

Agent Info (please complete the following information):

Describe the bug TacticalRMM is set up on a Debian 12 VM behind Nginx Proxy Manager and was working fine on v0.17.

After updating to 0.18.2 and running script "TacticalRMM - Install Mesh Agent if it's not installed", an error is thrown : Caught exception while downloading 'MeshAgent.exe' from API: "Unable to connect to mesh to get group id information" ===== Stacktrace ===== System.Net.WebException: Le serveur distant a retourn une erreur: (400) Demande incorrecte. Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

This was working before updating to 0.18.2.

When launching /rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py check_mesh from SSH, I have this error : Mesh device group: TacticalRMM Auth token ok:***** Mesh url ok: ws://127.0.0.1:4430/control.ashx?auth=**** Error getting mesh device id: did not receive a valid HTTP response

I also had to disable the option "Sync Mesh Perms with TRMM:" as I was not able to login to MeshCentral anymore.

To Reproduce Steps to reproduce the behavior:

  1. Go to an agent in Tactical
  2. Click on Run script
  3. Scroll down to TacticalRMM - Install Mesh Agent if it's not installed and add TRMM_API_KEY in env vars
  4. See error

Expected behavior Mesh agent downloaded as expected No error thrown when testing with /rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py check_mesh

Any idea how to deal with it ?

Thank you very much for your help!

zagub59 commented 2 months ago

Maybe config.json from meshcentral could be useful to debug so here it is 👍 { "settings": { "cert": "mesh.*.com", "mongoDb": "mongodb://127.0.0.1:27017", "mongoDbName": "meshcentral", "WANonly": true, "minify": 1, "port": 4430, "aliasPort": 443, "redirPort": 800, "allowLoginToken": true, "allowFraming": true, "_agentPing": 60, "agentPong": 300, "allowHighQualityDesktop": true, "_trustedproxy": "CloudFlare,192.168.50.50", "_tlsOffload": "192.168.50.50", "agentCoreDump": false, "compression": true, "wsCompression": true, "agentWsCompression": true, "maxInvalidLogin": { "time": 5, "count": 5, "coolofftime": 30 } }, "domains": { "": { "title": "", "title2": "", "titlePicture": "*", "welcomePicture": "*", "welcomeText": "**", "footer": "***", "newAccounts": false, "certUrl": "https://mesh.****.com", "geoLocation": true, "cookieIpCheck": false, "mstsc": true } } }

zagub59 commented 2 months ago

For those who might encounter this issue, I had the answer on Discord : you have to follow steps 4 and 5 of this doc : https://docs.tacticalrmm.com/mesh_integration/#running-your-own-existing-or-separate-meshcentral-server Thanks again @wh1te909 !