Skip to content

ListDevices returns output of command executed using RunCommand with --reply argument #6743

Closed
@kubamaruszczak

Description

@kubamaruszczak

Describe the bug
I have production EC2 instance running Meshcentral server with DocumentDB as its database. There are over 2500 linux agents connected to the server. I've created a bash script which allows me to execute command on each of the agents synchronously and to get the output back. It lists all of the devices using ListDevices, iterates over all of them and executes command on each connected agent using RunCommand --reply. See the screenshot below:

Image

While the script is executing commands on the devices and I try to list device using ListDevices command, instead of the device I get output of the command executed on one of the devices like on the screenshot below:

Image

I can see is that this RunCommand --reply feature was added here -> #5932

To Reproduce
It's harder to reproduce in lower latency environment. However, I managed to do so with the below steps.

Steps to reproduce the behavior:

  1. In one terminal window run infinite loop which will execute echo hello command on one device using RunCommand with --reply option
  2. In a separate terminal window run infinite loop which will try to list that device using ListDevices --filter <agent-name> command
  3. Observe the output of ListDevices command while RunCommand is being constantly executed. For some of the calls it will return 'hello' instead of the actual device info.

Expected behavior
I would like ListDevices command to return device instead of output from RunCommand --reply command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions