Open kubamaruszczak opened 1 month ago
i have noticed quite a lot of problems with the peering so im working my way through fixing them ill add this to my list to try look at next week! 👍
@si458 hi! any progress regarding peering issues?
@kubamaruszczak im still looking into this, im a little slow at the moment as i have my 'work' to do first
I can confirm this issue as well. Commands will run fine from one peer, but not necessarily another. I have yet to identify a rhyme or reason.
One thing catches my attention. I have one peer running and it has peers
section in its config. I've tried to track RunCommand
flow and it turns out that when peering is configured commands are sent to agents using the DispatchMessage
function:
https://github.com/Ylianst/MeshCentral/blob/aa7767f37cb91aeb6f3511c03877c92c9e3dfe62/meshuser.js#L3035
Tracking that further... in multiserver.js
the DispatchMessage
function iterates over and send commands to all peers in obj.peerServers
:
https://github.com/Ylianst/MeshCentral/blob/aa7767f37cb91aeb6f3511c03877c92c9e3dfe62/multiserver.js#L412
When only one peer is used this object is empty which results in not sending commands at all. This might be the reason why executing command from another peer works fine. When second peer is connected it has first peer in obj.peerServers
and command is sent.
Describe the bug After this feature have been added https://github.com/Ylianst/MeshCentral/issues/6404 Send Commands seemed to work in peering environment. I started to use it and I still encounter issue when passing commands to agents connected to peer I'm executing commands from. When I execute below command on peer agent is connected to I receive
OK
in the output. However, command is not executed on the device and if I add--reply
flag to the command it gets stucked. If I would do the same on the other peer it will work all fine.To Reproduce Steps to reproduce the behavior:
Expected behavior RunCommand should work no matter which host is used to execute command on a device
Server Software:
Your config.json file