elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
124 stars 134 forks source link

Agent comes back online after unenroll due to too many authentication failures #5433

Closed AndersonQ closed 2 weeks ago

AndersonQ commented 2 weeks ago

Users have reported to have several agents were not coming back online after a Fleet Server outage. Those agents had tried to unenroll themselves due to many authentication failures, they logged: retrieved an invalid api key error '7' times. Starting to unenroll the elastic agent.. However restarting the agents brought them back online. That shows the agent did not persist its unenroll.

It happens because as it's a self-inflicted unenroll the agent does not want to trigger a policyChange ack and sets the action to nil

however a nil action isn't persisted. Actually the agent panics when trying to persist a nil action

as the action ins't persisted, next time the agent For confirmed bugs, please report:

cmacknz commented 2 weeks ago

We should just not unenroll instead: https://github.com/elastic/elastic-agent/issues/5428

ycombinator commented 2 weeks ago

Closing in favor of https://github.com/elastic/elastic-agent/issues/5428