-
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 UI] Improve fleet ui error message #109907
Comments
Pinging @elastic/fleet (Team:Fleet) |
Thanks for raising this! I can take a look at this as we're actively working on and testing this package policy validation code for 7.15/16. |
Hey @cauemarcondes I'm taking a look at this now. Could you provide an example of a change you made to that |
I believe if you change the key of one of the fields mapped here it will probably break https://github.com/elastic/kibana/blob/master/x-pack/plugins/apm/server/lib/fleet/get_apm_package_policy_definition.ts#L60. |
Thanks, @cauemarcondes. I'm having trouble triggering this error message off of 'apm-server.host-NEW': {
name: 'host-NEW',
type: 'text',
},
'apm-server.url-NEW': {
name: 'url0-NEW',
type: 'text',
getValue: ({ cloudPluginSetup }) => cloudPluginSetup?.apm?.url,
}, Maybe I am misunderstanding the context in which this error occurs? Let me know if you any further suggestions to ensure I can reproduce the initial error message here. I'm wondering if https://github.com/elastic/kibana/pull/109887/files#diff-e3331479a7af18c1c3f934373c854d6946f0c590498e9d649d4af03144cf9b44R163 may have inadvertently squashed this. |
Let me see if I can put together a PR with the error, so you can test it. |
@cauemarcondes - Thanks so much for this reproducible example. I have one more question if it's not too much trouble. How can I upgrade to version I see we declare the package version here, but is there another step to take in order to actually install this version from the package registry? kibana/x-pack/plugins/apm/server/lib/fleet/get_apm_package_policy_definition.ts Lines 16 to 39 in 6d874ca
Thanks again for all your help here, and please accept my apologies for my lack of familiarity with APM in this area 🙂 |
@kpollich can you try following these steps? How to test these changes and then I should start your local kibana pointing to the local package registry:
|
Thanks a ton, @cauemarcondes. I was able to follow those steps and get version I've copied the change from your PR, e.g. 'apm-server.rum.allow_service_names': {
name: 'rum_allow_service_names',
type: 'text',
} and unfortunately I'm not able to reproduce any error messages off of the latest from GitHub doesn't natively support |
hmmm that's odd. Do you have a PR where I can try? |
Sure. Here's a branch - it should be the same as your PR linked earlier: #110493 |
Here's something that might be useful. I was able to reproduce errors when attempting to upgrade a policy from APM
Throwing an error in this case results in an upgrade form that's "stuck", however, because the user can't actually edit the underlying policy to exclude these fields. If we just discard variables for which no |
Add debug log + logic to skip over any package variables that have been removed from the base policy object. Issue was initially surfaced testing upgrade from APM integration v0.3.0 to v0.4.0. Ref elastic#109907
I implemented the above debug change to the validation process in #110505. I think this addresses the initial issue raised by the PR, and also fixes the automatic upgrade process for APM |
* Fix policy upgrade from APM 0.3.0 to 0.4.0 Add debug log + logic to skip over any package variables that have been removed from the base policy object. Issue was initially surfaced testing upgrade from APM integration v0.3.0 to v0.4.0. Ref #109907 * Fix type error in test * Remove translation for validation debug log Co-authored-by: Kibana Machine <[email protected]>
* Fix policy upgrade from APM 0.3.0 to 0.4.0 Add debug log + logic to skip over any package variables that have been removed from the base policy object. Issue was initially surfaced testing upgrade from APM integration v0.3.0 to v0.4.0. Ref elastic#109907 * Fix type error in test * Remove translation for validation debug log Co-authored-by: Kibana Machine <[email protected]>
* Fix policy upgrade from APM 0.3.0 to 0.4.0 Add debug log + logic to skip over any package variables that have been removed from the base policy object. Issue was initially surfaced testing upgrade from APM integration v0.3.0 to v0.4.0. Ref elastic#109907 * Fix type error in test * Remove translation for validation debug log Co-authored-by: Kibana Machine <[email protected]>
* Fix policy upgrade from APM 0.3.0 to 0.4.0 Add debug log + logic to skip over any package variables that have been removed from the base policy object. Issue was initially surfaced testing upgrade from APM integration v0.3.0 to v0.4.0. Ref #109907 * Fix type error in test * Remove translation for validation debug log Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kyle Pollich <[email protected]>
* Fix policy upgrade from APM 0.3.0 to 0.4.0 Add debug log + logic to skip over any package variables that have been removed from the base policy object. Issue was initially surfaced testing upgrade from APM integration v0.3.0 to v0.4.0. Ref #109907 * Fix type error in test * Remove translation for validation debug log Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kyle Pollich <[email protected]>
It seems this specific error condition has been eliminated, but we may want some better high-level error messaging such as |
Going to close this one as #110505 is merged. @joshdover can you open an issue for improving the error message/handling in general? |
While implementing the feature #109516, I had to make some changes to the APM fields located at https://github.com/elastic/kibana/blob/master/x-pack/plugins/apm/server/lib/fleet/get_apm_package_policy_definition.ts#L60. But when I was trying to edit the APM integration, fleet threw this error:
VarDef is undefined
is very generic and hard to identify which field is causing the problem.I would like to improve this error message by adding the exact field that caused the problem. I debugged the fleet code and it would be a matter of adding an extra condition here https://github.com/elastic/kibana/blob/master/x-pack/plugins/fleet/common/services/validate_package_policy.ts#L136 that validates if
varDef
is defined, otherwise throw an error with the name of the field that caused the problem.The text was updated successfully, but these errors were encountered: