[Fleet] Update query in delete unenrolled agents task#224808
Merged
juliaElastic merged 1 commit intoelastic:mainfrom Jun 24, 2025
Merged
[Fleet] Update query in delete unenrolled agents task#224808juliaElastic merged 1 commit intoelastic:mainfrom
juliaElastic merged 1 commit intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
Contributor
💚 Build Succeeded
Metrics [docs]
|
Contributor
|
Starting backport for target branches: 8.17, 8.18, 8.19, 9.0 |
Contributor
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
juliaElastic
added a commit
to juliaElastic/kibana
that referenced
this pull request
Jun 24, 2025
Issue reported by users that some unenrolled agents on the UI are not being deleted by the background task. The cause turned out to be a discrepancy in how unenrolled agents are determined on the UI versus the background task. The UI shows agents as unenrolled if `active:false` field matches (logic [here](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/agents/build_status_runtime_field.ts#L115-L119)) The delete unenrolled agents task also queried on the existence of `unenrolled_at` field. It seems some agents don't have this field set, those should be deleted too.
This was referenced Jun 24, 2025
juliaElastic
added a commit
to juliaElastic/kibana
that referenced
this pull request
Jun 24, 2025
Issue reported by users that some unenrolled agents on the UI are not being deleted by the background task. The cause turned out to be a discrepancy in how unenrolled agents are determined on the UI versus the background task. The UI shows agents as unenrolled if `active:false` field matches (logic [here](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/agents/build_status_runtime_field.ts#L115-L119)) The delete unenrolled agents task also queried on the existence of `unenrolled_at` field. It seems some agents don't have this field set, those should be deleted too.
juliaElastic
added a commit
to juliaElastic/kibana
that referenced
this pull request
Jun 24, 2025
Issue reported by users that some unenrolled agents on the UI are not being deleted by the background task. The cause turned out to be a discrepancy in how unenrolled agents are determined on the UI versus the background task. The UI shows agents as unenrolled if `active:false` field matches (logic [here](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/agents/build_status_runtime_field.ts#L115-L119)) The delete unenrolled agents task also queried on the existence of `unenrolled_at` field. It seems some agents don't have this field set, those should be deleted too.
juliaElastic
added a commit
that referenced
this pull request
Jun 24, 2025
juliaElastic
added a commit
that referenced
this pull request
Jun 24, 2025
juliaElastic
added a commit
that referenced
this pull request
Jun 24, 2025
Contributor
|
This PR didn't make it on time for the latest v8.18.3 and v9.0.3 BC. Updating the labels |
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
Jun 25, 2025
## Summary Issue reported by users that some unenrolled agents on the UI are not being deleted by the background task. The cause turned out to be a discrepancy in how unenrolled agents are determined on the UI versus the background task. The UI shows agents as unenrolled if `active:false` field matches (logic [here](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/agents/build_status_runtime_field.ts#L115-L119)) The delete unenrolled agents task also queried on the existence of `unenrolled_at` field. It seems some agents don't have this field set, those should be deleted too.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue reported by users that some unenrolled agents on the UI are not being deleted by the background task.
The cause turned out to be a discrepancy in how unenrolled agents are determined on the UI versus the background task.
The UI shows agents as unenrolled if
active:falsefield matches (logic here)The delete unenrolled agents task also queried on the existence of
unenrolled_atfield.It seems some agents don't have this field set, those should be deleted too.