Skip to content

[Fleet] Unable to enroll a Fleet server in a policy with more than 10 inactive enrollment tokens #2029

@nchaulet

Description

@nchaulet

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)

Metadata

Metadata

Labels

Team:FleetLabel for the Fleet teambugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions