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

Invalid api key error is observed in CLI on running uninstall command for unenrolled agent. #6711

Open
amolnater-qasource opened this issue Feb 5, 2025 · 7 comments · May be fixed by #6735
Assignees
Labels
bug Something isn't working impact:medium Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@amolnater-qasource
Copy link

Kibana Build details:

VERSION: 9.0.0 beta1 BC1
BUILD: 83348
COMMIT: fd1f8b62137f14e93716e298e4e931b576e2ca13

Preconditions:

  1. 9.0.0 beta BC1 Kibana cloud environment should be available.
  2. A few agents should be installed.

Steps to reproduce:

  1. Navigate to Fleet>Agents tab.
  2. Unenroll the agent from UI.
  3. Run agent uninstall command: sudo elastic-agent uninstall
  4. Observe invalid api key error on running uninstall command.

NOTE:

  • Agent is uninstalled successfully.

Expected Result:
Invalid api key error should not be displayed in CLI on running uninstall command for unenrolled agent.

Screenshot:

Image

@amolnater-qasource amolnater-qasource added bug Something isn't working impact:medium Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Feb 5, 2025
@elasticmachine
Copy link
Contributor

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

@amolnater-qasource
Copy link
Author

@muskangulati-qasource Please review.

@muskangulati-qasource
Copy link

Secondary review is Done for this ticket!

@pierrehilbert
Copy link
Contributor

Hey folks,
Are you able to reproduce the same issue for 8.x versions?
Could you please confirm the agent is still getting uninstalled even with this error?

@amolnater-qasource
Copy link
Author

Hi @pierrehilbert

Thank you for looking into this issue.
Yes the issue is also reproducible on 8.16.1 agent.

  • If the agent is unenrolled from the UI, and then uninstalled, we observe this Invalid api key error.

Screenshot:

Image

Could you please confirm the agent is still getting uninstalled even with this error?

Yes, the agent gets uninstalled even with this error.

Please let us know if anything else is required from our end.
Thanks!!

@cmacknz
Copy link
Member

cmacknz commented Feb 6, 2025

Yes if agent was unenrolled from Fleet, agent's attempt at an uninstall notification will fail.

We should probably modify this error to indicate it isn't a problem if agent was already unenrolled, perhaps we need to special case the invalid api key error in this case. CC @michel-laterman

@michel-laterman michel-laterman self-assigned this Feb 6, 2025
@michel-laterman michel-laterman linked a pull request Feb 6, 2025 that will close this issue
5 tasks
@pierrehilbert
Copy link
Contributor

Thanks @amolnater-qasource for the additional information.
Glad to read this is not something new and to see that @michel-laterman is already having a PR that will make the error clearer.

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

Successfully merging a pull request may close this issue.

6 participants