Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elastic Agent Stays in "Healthy" State when it has been unenrolled/API Key invalidated #6707

Open
BenB196 opened this issue Feb 4, 2025 · 1 comment
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@BenB196
Copy link

BenB196 commented Feb 4, 2025

For confirmed bugs, please report:

  • Version: 8.17.1
  • Operating System: Container/Linux
  • Discuss Forum URL: N/A
  • Steps to Reproduce:
    1. Create an Elastic Agent fleet policy
    2. Enroll/install an Elastic Agent against the policy
    3. Wait for the agent to check-in and become "Healthy"
    4. Unenroll the agent
      • This can be done manually via Kibana UI/API
      • This can happen automatically if the Agent policy has an "Unenroll" time set
    5. Observe the following:
      • Elastic Agent logs "API key has been invalidated"
      • Elastic Agent when running elastic-agent status reports as healthy
    6. If you restart the agent/host after, the agent will then enter an unhealthy state

I would expect that once the agent starts to fail check-ins or sees it's API key has been invalidate, it should report an unhealthy state.

I've randomly run into this issue a few times (mainly from intermittent network connectivity issues that trigger the agent policy unenroll), but it becomes an issue when trying to detect when an agent is in an "unhealthy" state for things like; elastic/cloud-on-k8s#5376

@BenB196 BenB196 added the bug Something isn't working label Feb 4, 2025
@BenB196 BenB196 changed the title Elastic Agent Stays in "Healthy" State when its been unenrolled Elastic Agent Stays in "Healthy" State when it has been unenrolled/API Key invalidated Feb 4, 2025
@cmacknz cmacknz added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Feb 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

3 participants