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

[Fleet] Unchecking Enable HTTP endpoint at /liveness does not stop Agent from listening on 6791. #201459

Open
jerrac opened this issue Nov 22, 2024 · 6 comments
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@jerrac
Copy link

jerrac commented Nov 22, 2024

Kibana version:
8.16.1
Elasticsearch version:
8.16.1
Server OS version:
Ubuntu 22.04
Browser version:
N/A
Browser OS version:
N/A
Original install method (e.g. download page, yum, from source, etc.):
APT
Describe the bug:
Disabling /liveness via agent policy does not stop Agent from listening on localhost:6791
Steps to reproduce:

  1. Upgrade to 8.16.1 (Maybe install from scratch as well.)
  2. Modify (or create) a policy that does not have Enable HTTP endpoint at /liveness checked.
  3. Save the policy and wait long enough for it to be deployed.
  4. On the server running agent, run while true; do netstat pln | grep -E '(6791|27910)'; echo '..' ;sleep 5; done;
  5. You will see that something is listening on 6791.

FYI, I tried enabling and moving the port to 27910. That worked. It started listening on localhost:27910. But disabling resulted in Agent returning to listening on 6791 like before.

Expected behavior:
Nothing should be listening on 6791.

Screenshots (if relevant):
Image

Any additional context:
For now I can just work around by pointing at an unused port. But still, if the box is unchecked, there should not be anything listening on that port.

BTW, I really appreciate that you added that UI. Being able to change the port is an immense help. Thanks @kpollich for your work!

@jerrac jerrac added the bug Fixes for quality problems that affect the customer experience label Nov 22, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Nov 22, 2024
@jsanz jsanz added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 29, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Nov 29, 2024
@kpollich
Copy link
Member

kpollich commented Dec 2, 2024

@elastic/elastic-agent - I think we might need some help from the agent team in understanding how to disable listening on this port from this setting.

@fearful-symmetry
Copy link

FYI, I tried enabling and moving the port to 27910. That worked. It started listening on localhost:27910. But disabling resulted in Agent returning to listening on 6791 like before.

Interesting. So, it's picking up the config, but not the config to disable it? I'm kind of busy today, but I'll see if I can find time to figure out if this is an agent-side bug or just a config issue between Kibana and agent,.

@fearful-symmetry
Copy link

So, I suspect the problem here is that kibana isn't explicitly setting agent.monitoring.http.enabled to false; because agent's default behavior is to enable the monitoring endpoint, it will continue to run unless explicitly disabled. I assume that if we want to actually disable agent from listening on that port, we need to add some checkbox or something that actually sets enabled to false.

@kpollich
Copy link
Member

kpollich commented Dec 3, 2024

Thanks for looking into this @fearful-symmetry. I think we should explicitly include agent.monitoring.http.enabled: true by default in agent policies generated by Fleet, and then upon unchecking this checkbox swap to explicitly including agent.monitoring.http.enabled: false. Narrowing this down to two possible states instead of true/false/undefined seems like the right thing to do to fix this.

@fearful-symmetry
Copy link

@kpollich yeah, agreed, it seems like adding a checkbox or something that defaults to true is the best solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

No branches or pull requests

5 participants