-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] Fix exception in agents list when units field is missing from…
… components (#161360) ## Summary Fix an issue found in 8.8.2 with `8.7.1` inactive agents. The agents list endpoint was returning an exception, after some investigation it was found that the issue was a missing `units` property in the components field of the agents. This was a very specific edge case and in fact I could not reproduce locally, but it still happened in a minority of cases after upgrading to 8.8.2. The agents in this case have components that look like this: ``` "components": [ { "id": "http/metrics-monitoring", "type": "http/metrics", "message": "Starting", "status": "STARTING" }, ... ] ``` But this property was typed as mandatory so we didn't check for undefined. The actual bug was tracked here: https://github.com/elastic/kibana/blob/2070836060046aaec0ff28ddfcce91356cf98930/x-pack/plugins/fleet/server/services/agents/helpers.ts#L50 and was causing this error: https://github.com/elastic/kibana/assets/16084106/607b5aed-155b-4509-896a-ada7507e4dc3 I also updated the type to have `units` as optional and fixed a couple of other places where this could cause issues. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
6b52658
commit 36e7d60
Showing
6 changed files
with
154 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters