[Fleet] Fix fleet server policy creation with non es default output#214590
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/dashboards --update'
...public/applications/fleet/components/fleet_server_instructions/hooks/use_quick_start_form.ts
Outdated
Show resolved
Hide resolved
jen-huang
left a comment
There was a problem hiding this comment.
Agree on the approach here where we explicitly tell the user what went wrong. I think we should backport to all open branches.
LGTM 🚀
…ub.com:nchaulet/kibana into fix-fleet-server-policy-creation-logstash-host
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
cc @nchaulet |
|
Starting backport for target branches: 8.18, 9.0 https://github.com/elastic/kibana/actions/runs/13907951013 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
9 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
5 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…lastic#214590) (cherry picked from commit 6ed6d02) # Conflicts: # x-pack/platform/plugins/shared/fleet/public/hooks/use_request/agent_policy.ts # x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…lastic#214590) (cherry picked from commit 6ed6d02) # Conflicts: # oas_docs/bundle.json # oas_docs/bundle.serverless.json # oas_docs/output/kibana.yaml # x-pack/platform/plugins/shared/fleet/public/hooks/use_request/agent_policy.ts # x-pack/platform/plugins/shared/fleet/server/routes/schema/errors.ts # x-pack/platform/plugins/shared/fleet/server/services/agent_policy.ts # x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
…utput (#214590) (#218656) # Backport This will backport the following commits from `main` to `8.18`: - [[Fleet] Fix fleet server policy creation with non es default output (#214590)](#214590) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-03-17T19:14:25Z","message":"[Fleet] Fix fleet server policy creation with non es default output (#214590)","sha":"6ed6d02f37c67935cfb25aa9bb075096d4b6351a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","Team:Fleet","backport:prev-minor","backport:version","v9.1.0","v8.18.1"],"title":"[Fleet] Fix fleet server policy creation with non es default output","number":214590,"url":"https://github.com/elastic/kibana/pull/214590","mergeCommit":{"message":"[Fleet] Fix fleet server policy creation with non es default output (#214590)","sha":"6ed6d02f37c67935cfb25aa9bb075096d4b6351a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214590","number":214590,"mergeCommit":{"message":"[Fleet] Fix fleet server policy creation with non es default output (#214590)","sha":"6ed6d02f37c67935cfb25aa9bb075096d4b6351a"}},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…tput (#214590) (#218655) # Backport This will backport the following commits from `main` to `9.0`: - [[Fleet] Fix fleet server policy creation with non es default output (#214590)](#214590) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-03-17T19:14:25Z","message":"[Fleet] Fix fleet server policy creation with non es default output (#214590)","sha":"6ed6d02f37c67935cfb25aa9bb075096d4b6351a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","Team:Fleet","backport:prev-minor","backport:version","v9.1.0","v8.18.1"],"title":"[Fleet] Fix fleet server policy creation with non es default output","number":214590,"url":"https://github.com/elastic/kibana/pull/214590","mergeCommit":{"message":"[Fleet] Fix fleet server policy creation with non es default output (#214590)","sha":"6ed6d02f37c67935cfb25aa9bb075096d4b6351a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214590","number":214590,"mergeCommit":{"message":"[Fleet] Fix fleet server policy creation with non es default output (#214590)","sha":"6ed6d02f37c67935cfb25aa9bb075096d4b6351a"}},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Resolve #208024
User were not able to create a fleet server policy when using a default logstash output without an enterprise license, this was due to a few bug in our validations, and no errors were displayed as we were missing error handling here.
That PR fix that by showing error message, and fixing the validation rules to allow a user to be able to create a fleet server policy in the advanced section with a custom output.
I considered trying to "magically" fix this by creating a ES output if none exists or trying to select one, but it seems to me we should probably not make that decision for the user, and having a better error reporting and fixing bugs in our form should do it. In my mind if they want to use a logstash output, they are a little familiar on how to create/select output.
Where should we backport that one? 9.0 and 8.18?
How to tests
With 2 outputs, one default logstash and one es, and no enterprise license
Trying to create a policy with the quick start fail with an explict message
Trying to create a policy from the advanced section also display an error message
The error is correctable and we allow to select an ES output
Todo