Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Fleet] Fix UI error when agent goes to orphaned state (#207746) (
#207836) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Fix UI error when agent goes to orphaned state (#207746)](#207746) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-22T14:20:03Z","message":"[Fleet] Fix UI error when agent goes to orphaned state (#207746)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/207017\r\n\r\nIt seems that when the orphaned agent service is restarted, it briefly\r\nhas a component state string, instead of array, that's why the error.\r\nThe fix checks that the components is an array before calling map.\r\n\r\nTo verify:\r\n1. Enroll an agent to an agent policy with endpoint integration.\r\n2. Stop agent service so that agent gets into orphaned state.\r\n3. Now restart the service and observe that the error\r\n`_hit$_source4.components.map is not a function` no longer appears.\r\n\r\n<img width=\"1531\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c9a957d7-a0d3-4831-90f9-a57479193ee0\"\r\n/>\r\n<img width=\"1530\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c0aa62f0-708b-463e-9184-01d8641c8f21\"\r\n/>","sha":"9800147681323f95f5e951328f9f56a399796350","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet] Fix UI error when agent goes to orphaned state","number":207746,"url":"https://github.com/elastic/kibana/pull/207746","mergeCommit":{"message":"[Fleet] Fix UI error when agent goes to orphaned state (#207746)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/207017\r\n\r\nIt seems that when the orphaned agent service is restarted, it briefly\r\nhas a component state string, instead of array, that's why the error.\r\nThe fix checks that the components is an array before calling map.\r\n\r\nTo verify:\r\n1. Enroll an agent to an agent policy with endpoint integration.\r\n2. Stop agent service so that agent gets into orphaned state.\r\n3. Now restart the service and observe that the error\r\n`_hit$_source4.components.map is not a function` no longer appears.\r\n\r\n<img width=\"1531\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c9a957d7-a0d3-4831-90f9-a57479193ee0\"\r\n/>\r\n<img width=\"1530\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c0aa62f0-708b-463e-9184-01d8641c8f21\"\r\n/>","sha":"9800147681323f95f5e951328f9f56a399796350"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207746","number":207746,"mergeCommit":{"message":"[Fleet] Fix UI error when agent goes to orphaned state (#207746)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/207017\r\n\r\nIt seems that when the orphaned agent service is restarted, it briefly\r\nhas a component state string, instead of array, that's why the error.\r\nThe fix checks that the components is an array before calling map.\r\n\r\nTo verify:\r\n1. Enroll an agent to an agent policy with endpoint integration.\r\n2. Stop agent service so that agent gets into orphaned state.\r\n3. Now restart the service and observe that the error\r\n`_hit$_source4.components.map is not a function` no longer appears.\r\n\r\n<img width=\"1531\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c9a957d7-a0d3-4831-90f9-a57479193ee0\"\r\n/>\r\n<img width=\"1530\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c0aa62f0-708b-463e-9184-01d8641c8f21\"\r\n/>","sha":"9800147681323f95f5e951328f9f56a399796350"}}]}] BACKPORT--> Co-authored-by: Julia Bardi <[email protected]>
- Loading branch information