-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Return empty agents list when submitting a kuery with no keys #93844
Conversation
Pinging @elastic/fleet (Feature:Fleet) |
Pinging @elastic/fleet (Team:Fleet) |
I think this is a regression coming from where we used to wrap the kuery keys with the SO name. We did this for all our endpoints which accepted
@nchaulet This looks like it was removed as part of #86179, was this intentional? Is this fix still needed with the incoming changes to Fleet server (since we move to ES indices instead of SOs, but do we need to keep SO kuerying for migration)? Edit: I think we should put this wrapping back at least for 7.12, regardless of what happens with Fleet server in 7.13. |
We are still be doing the I guess the error was always present but before 7.11 we were swallowing errors happening when we fetch agents, if you search for |
@Zacqary I am wondering if it's better to handle 400 errors client side here and swallow the error, or mark the search bar as invalid as there is a user error and the user can potentially fix that kuery |
@nchaulet In 7.13 a query without keys doesn't throw a 400 error at all, now that it's not querying SavedObjects. This PR, as-is, would replicate that same behavior in 7.12. Do we want to change 7.13 so that it throws a 400 error for a keyless query, and handle that on the client side by turning the search bar red? |
I think the fix is correct for 7.12 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
…-emptykey # Conflicts: # x-pack/test/fleet_api_integration/apis/agents/list.ts
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @Zacqary |
Summary
Fixes #92853
When submitting a query string that would result in a
The key is empty
error, the SavedObjects API instead swallows the error and returns no results.The syntax to actually filter agents by name in the SavedObject system is very complicated and not suggested by autocomplete (
fleet-agents.local_metadata.host.hostname
), but given that this syntax is going to change in Fleet Server, I'm not sure if it's worth the engineering complexity to convert raw string input to a field lookup.