Hi,
Let me clarify a few points.
If you are trying to enroll two agents with the same name, you must delete one of them, as this will result in a duplicate agent name error.
However, if the same agent is repeatedly trying to enroll because the Wazuh manager was temporarily unreachable, it may attempt to re-register itself as a new agent. In that case, we should first review the logs before deleting any agent.
With that said, could you please clarify which scenario applies to your case?
Additionally, please share the following details:
Manager and agent versions
You mentioned that both the manager and agent are on v4.14, but the logs indicate the agent version is v4.14.1. If the agent version is higher than the manager, this can cause issues. Please ensure the manager version is the same as or higher than the agent version for stable communication.
Agent hostname or name configuration
Ensure the agent name is unique and does not match an already enrolled agent. You can explicitly set a unique agent name in ossec.conf:
Agent removal method
Please let us know how the agent was removed.
Current agent list
Share the output of the following command:
/var/ossec/bin/agent_control -l
Network connectivity
Verify that all required ports are open by following the documentation below:
https://documentation.wazuh.com/current/user-manual/agent/agent-enrollment/troubleshooting.html#verifying-communication-with-the-wazuh-manager
Once we have these details, we can better identify the root cause and guide you accordingly.