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

Unpleasent behavior when enrolling to non existing policy #3609

Open
michalpristas opened this issue Jun 6, 2024 · 2 comments
Open

Unpleasent behavior when enrolling to non existing policy #3609

michalpristas opened this issue Jun 6, 2024 · 2 comments
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@michalpristas
Copy link
Contributor

michalpristas commented Jun 6, 2024

When agent we try to add fleet-server agent specifying -fleet-server-policy with an incorrect value (e.g typo) agent misbehaves.

It spins up fleet server, fleet server tries to read policy index with a specified policy which is empty, and retries and retries

behavior is not well defined:

m.reporter.UpdateState(client.UnitStateStarting, fmt.Sprintf("Waiting on policy with Fleet Server integration: %s", m.policyID), nil) //nolint:errcheck // not clear what to do in failure cases

there may be a memory leak involved

@michel-laterman
Copy link
Contributor

This is expected behaviour from fleet-server.
The (policy) self monitor is used by fleet-server to ensure that the policy index exists, and the specified policy can be found with a fleet-server integration in the index (https://github.com/elastic/fleet-server/blob/main/internal/pkg/policy/self.go#L70)

This is used during the bootstrapping process, the fleet-server will be starting indefinitely if it can't find it's policy.

The assumptions behind this were that fleet-server and kibana could startup concurrently in a cloud deployment and that fleet-server should retry in case the monitor is started before kibana finishes creating the policies index and writing the initial policy.

@jlind23
Copy link
Contributor

jlind23 commented Jul 8, 2024

Shall we then close as won't fix?

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

4 participants