Conversation
441c9ae to
15355ba
Compare
DProvinciani
reviewed
Oct 7, 2020
|
|
||
| if (index = OS_IsAllowedID(&keys, id), index < 0) { | ||
| merror("ERROR %d: %s.", ERRORS[ENOAGENT].code, ERRORS[ENOAGENT].message); | ||
| mdebug1("Error code %d: %s.", ERRORS[ENOAGENT].code, ERRORS[ENOAGENT].message); |
Contributor
There was a problem hiding this comment.
I would remove the word code. Usually, this kind of logs just say Error X: message
8bf2d8f to
79b33fa
Compare
e4ee276 to
1927fad
Compare
|
|
||
| if (index = OS_IsAllowedID(&keys, id), index < 0) { | ||
| merror("ERROR %d: %s.", ERRORS[ENOAGENT].code, ERRORS[ENOAGENT].message); | ||
| mdebug1("Error %d: %s.", ERRORS[ENOAGENT].code, ERRORS[ENOAGENT].message); |
Contributor
There was a problem hiding this comment.
Line 433 of local-server.c has the same log for the get option. I think that log should be a debug too.
And both messages can be identical.
palaciosjeremias
approved these changes
Nov 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
It was found that Wazuh Manager v4.0 prints an ERROR message like the following one due to a race condition trying to delete an agent:
2020/10/02 20:11:00 ossec-authd[23049] local-server.c:414 at local_remove(): ERROR: ERROR 9011: Agent ID not found.It happens because the auth daemon received a message from remoted to remove an agent, but it can't find it because it was already erased before.
This situation isn't considered an error, and a double try to delete the agent will be printed only as a debug message.
How to reproduce it
If we activate the mond.delete_old_agents option and after the selected time expires, the old disconnected agents will be removed. Then, we can find that error log.
Tests