Skip to content

Handle schema incompatibility with Elastic Agent <8.16 #5164

@swiatekm

Description

@swiatekm

Versions of agent before 8.16 may report the download rate as a string, but in ES 8.16+ it is mapped as a double. This was originally reported here. The conclusion in that issue was that the problem was transitory, only came up during upgrades, and resolved itself as the upgrade finished. This is true as long as the upgrade is successful, but if it fails in the downloading or extracting stage, elastic-agent will continue to include the invalid data in the check-in, resulting in an inability to manage the agent from Fleet.

Instead, Fleet Server should detect this problem and set the offending field to 0 if the format is incorrect. This way, older agents can successfully report information about their upgrade state.

It's worth noting that Fleet Server actually sends the invalid data to Elasticsearch instead of rejecting it. The reason for this is that the validation Fleet Server does assumes the upgrade details are a union type, so only the fields relevant to a particular state are validated. This, however, is not exactly what elastic-agent sends. This is a bug in elastic-agent, but we need to deal with this in Fleet Server regardless.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions