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] Unable to enroll a Fleet server in a policy with more than 10 inactive enrollment tokens #2029

Closed
nchaulet opened this issue Oct 26, 2022 · 2 comments · Fixed by #2044
Assignees
Labels
bug Something isn't working Team:Fleet Label for the Fleet team

Comments

@nchaulet
Copy link
Member

It's not possible to install a Fleet server in a policy with more than 10 inactive enrollment tokens.

let say you have a fleet-server-policy with 10 inactive enrollment tokens and 1 active installing Fleet server results in Fleet stuck in the following state

{"log.level":"info","@timestamp":"2022-10-26T14:14:32.693Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":792},"message":"Fleet Server - Waiting on active enrollment keys to be created in policy with Fleet Server integration: fleet-server-policy","ecs.version":"1.6.0"}

I think the issue is because we fetch all enrollment token (active or not) in a policy without size parameter, by default ES search return only the 10 first document matching the search, so the active token could not be returned.

Potential solutions

We should probably pass a size paramter when fetching enrollment tokens, we could also filter on active tokens in the query instead of doing the filtering on Fleet sever here

tokens = filterActiveTokens(tokens)

@nchaulet nchaulet added the bug Something isn't working label Oct 26, 2022
@michel-laterman michel-laterman self-assigned this Oct 31, 2022
@michel-laterman
Copy link
Contributor

It should be pretty straightforward to query for active tokens, @kpollich should we backport a fix to 8.5?

@michel-laterman michel-laterman added the Team:Fleet Label for the Fleet team label Oct 31, 2022
@kpollich
Copy link
Member

Yes let's look to backport this for sure.

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:Fleet Label for the Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants