You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During wazuh/wazuh#27765, I've modified the commands action args field to use an object instead of a list. However, when I tried sending commands with the new format, the commands manager failed to parse them.
gasti@gasti:~/work/wazuh/apis/tools/env$ curl -H "Content-Type: application/json" -ksu admin:admin -X POST https://localhost:9200/_plugins/_command_manager/commands -d '{"commands": [{"source": "Users/Services", "user": "Management API", "target": {"id": "0a96a0ab-5bef-415c-bb3c-ea3e294215a0", "type": "agent"}, "action": {"name": "set-group","version": "5.0.0", "args": {"groups": ["group1"]}}, "timeout": 100}]}'| jq{ "error": { "root_cause": [ { "type": "illegal_state_exception", "reason": "Can't get text on a START_ARRAY at 1:215" } ], "type": "illegal_state_exception", "reason": "Can't get text on a START_ARRAY at 1:215" }, "status": 500}
As the error message indicates, the parser is expecting args.groups to have a string value instead of an array.
I tried replacing the array with a string and the commands manager parsed it successfully
I also tried indexing the command directly to see if there was an issue with the template. It didn't fail, so the issue must be in the commands manager parsing
Description
During wazuh/wazuh#27765, I've modified the commands action
args
field to use an object instead of a list. However, when I tried sending commands with the new format, the commands manager failed to parse them.As the error message indicates, the parser is expecting
args.groups
to have a string value instead of an array.I tried replacing the array with a string and the commands manager parsed it successfully
String value
I also tried indexing the command directly to see if there was an issue with the template. It didn't fail, so the issue must be in the commands manager parsing
Index command
The same error was received when I tried using another object as the
groups
key valueObject value
This issue aims at fixing the parsing for it to accept any kind of nested values.
The text was updated successfully, but these errors were encountered: