Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meshrouter does not work for users who have individual devices assigned to them but not that device's group #4188

Closed
githubbiswb opened this issue Jun 28, 2022 · 21 comments

Comments

@githubbiswb
Copy link

githubbiswb commented Jun 28, 2022

Describe the bug
Meshrouter has no devices listed in the devices tab for most users and I haven't been able to find the difference.

EDIT: As I worked with si458 we found the bug can be summariezed better as this

If a user has permissions to a single device it wipes out their ability no matter their permissions to see ANY devices in MeshCentral Router

To Reproduce
Steps to reproduce the behavior:
Open MeshRouter with valid credeintals, and the devices tab is empty. But not for all users, one of my admins still has everything another has nothing

Expected behavior
Devices being listed in MeshRouter

Server Software (please complete the following information):

  • OS: Alpine
  • Virtualization: Docker
    • Network: WAN/Reverse Proxy NGINX for SSL
  • Version: 1.0.41
  • Node: Don't know
  • Browser: N/A

Remote Device (please complete the following information):

  • Device: All
  • OS: All
  • Version: All
  • Current Core Version (if known): All

Additional context
Happy to do more testing to try to find a pattern. Devices all show if you log in on the web interface. But MeshRouter is totally blank

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

have you tried downloading the latest version that was updated 22 days ago?
https://github.com/Ylianst/MeshCentral/raw/master/agents/MeshCentralRouter.exe

also what OS are you running the router on? mac/windows?

@githubbiswb
Copy link
Author

I am using the MeshCentral Router that is a part of the updated install of meshcentral and tried that one as well, same results, but I would expect that download to be the one included from the server

Windows is running MeshCentral Router

Again, some users are just fine, others are not, so it doesn't seem to be a software issue with the router, but instead a server setting keeping users from seeing what they need to see

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

what features are you assigning to the user?
also what permissions for groups or devices?
im just trialing here and i cannot get it to misbehave and not show any device, it always shows devices?

@githubbiswb
Copy link
Author

githubbiswb commented Jun 28, 2022

Yep, makes sense. Users have full administrator privileges and see nothing

Another user has full administrator privileges and sees everything

Another user has limited privileges, Control (No Terminal, No Files, No AMT) and sees nothing while being assinged to a specific group and/or specific device

Another user has limited privileges, Control (No Terminal, No Files, No AMT) and sees everything in the group they are assigned to when assigned to a specific group

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

can you take a screenshot of the user screen - showing the email, name, features, groups, etc from the web ui?
the user with limited control to specific group thats not showing anything
(blank sensitive stuff if needs be)

@githubbiswb
Copy link
Author

0zsbHCaMwX

@githubbiswb
Copy link
Author

I used to run with just the device, but then that broke, and I have another github issue about that, but the work around was make a group and give the user permissions to that group with the one device in it, but not that is broken too. Again, not for all users like this. I have another user, same permissions, and theirs works just fine. Full admin sees everything another full admin sees nothing.

@githubbiswb
Copy link
Author

Sorry, and also the users can all see what they need to see and should see in the web gui interface too, so they do have permissions that I can verify do work, its just they don't seem to work with MeshCentral Router

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

ok just tried your config and i can confirm the is indeed a bug,
if i add a group in ONLY, i see group of computers
if i add a single computer in and NO GROUPS, suddently i see nothing?
if i add a group of computers and a single computer, i also see nothing,
i believe the might be a bug them with meshrouter and single devices?

@githubbiswb
Copy link
Author

My friend, you gave me a workaround and found what I could not see! This is what makes the internet great, despite its flaws.

Okay, also confirm, if a user has permissions to a single device it wipes out their ability no matter their permissions to see ANY devices in MeshCentral Router

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

#3931

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

can you run meshcentralrouter.exe -debug from the command line?
it will output a debug.log file in the same folder after you login and close the app

mine shows the following

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at MeshCentralRouter.MainForm.Meshcentral_onNodesChanged(Boolean fullRefresh)
   at MeshCentralRouter.MeshCentralServer.processServerData(webSocketClient sender, String data, Int32 orglen)

@githubbiswb
Copy link
Author

I can't seem to make it write a log, I do have it in C:\Program Files\Mesh Agent\MeshRouter.exe and am running it as a normal user, so maybe it can't write that log there? But then I ran it as an Admin and that also didn't generate a log file

@githubbiswb
Copy link
Author

I also tried it from a temp location that I do have write access as a normal user, and nothing, you clearly got logs so I would say those would be the ones I trust since I can't seem to generate them

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

@githubbiswb i think i found the bug, spent time looking at the c# sourcecode from the other repo
https://github.com/Ylianst/MeshCentralRouter
ListViewGroup grp = devicesListView.Groups.Add(devicesListView.Groups.Count.ToString(), node.mesh.name);

basically its looking at the node (device) and then checking its mesh (group) name BUT because you arent sending the groups,
the is no name, so hense its crashing/erroring out

i have found away around but its a pain,

  1. assign the groups of those devices you want access too but give the group NO RIGHTS
  2. assign the common devices with permissions you want access too (must add each one you want control too, one by one)
  3. when you then connect, it will show the whole group and all the devices, BUT you cant connect to devices you dont have the individual device permissions too, only the ones you gave permission too

@githubbiswb
Copy link
Author

Ah, yep that makes sense and a good work around

The one I have implemented is moving the device off to a group all by itself and giving the user permissions to that group that only has the one device. I only state this for anyone that might come behind and want to work around this issue while its resolved.

@githubbiswb githubbiswb changed the title Meshrouter does not work for most users Meshrouter does not work for users who have individual devices assigned to them but not that device's group Jun 28, 2022
@kj7ice
Copy link
Contributor

kj7ice commented Jun 28, 2022

I am experiencing this exact issue as well for users only with permission to a single device, and the error in my debug log matches what was posted earlier. My MeshCentral server version is 1.0.38.

@si458
Copy link
Collaborator

si458 commented Jun 28, 2022

I am experiencing this exact issue as well for users only with permission to a single device, and the error in my debug log matches what was posted earlier. My MeshCentral server version is 1.0.38.

It's present the in the latest version too 1.0.41
It's a bug with meshcentralrouter I believe not the server side
Follow the issue here Ylianst/MeshCentralRouter#46

@Ylianst
Copy link
Owner

Ylianst commented Jul 1, 2022

I just put in a fix for this and seems to work. This was broken since the new UI. Will be in MeshCentral 1.0.45 which I will publish shortly.

@si458
Copy link
Collaborator

si458 commented Jul 2, 2022

this has indeed been fixed in 1.0.45, i can confirm here using installing new 1.0.45 and downloading new meshcentralrouter.exe from the web ui and using that, fixes the issue!
this issue can be closed now

@githubbiswb
Copy link
Author

Confirming and closing here as well, thank you everyone for all of your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants