-
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] Don't fail on errors in 'update' or 'reupdate' operation in /setup #97404
[Fleet] Don't fail on errors in 'update' or 'reupdate' operation in /setup #97404
Conversation
Pinging @elastic/fleet (Team:Fleet) |
|
||
if (setupStatus.nonFatalPackageUpgradeErrors.length > 0) { | ||
body.nonFatalPackageUpgradeErrors = setupStatus.nonFatalPackageUpgradeErrors; | ||
} | ||
|
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.
This is unrelated to my change, but I noticed that preconfigurationError
is not returned here. I didn't have time to dig into it but I'm not sure this is intentional. cc @Zacqary
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.
I remember some discussion around what should happen on errors. I'm sure @Zacqary will follow up if needed.
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/sync_colors·ts.dashboard sync colors should sync colors on dashboard by defaultStandard Out
Stack Trace
Metrics [docs]Async chunks
Unknown metric groupsAPI count
API count missing comments
History
To update your PR or re-run it, just comment with: cc @skh |
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.
Code LGTM. I downloaded the PR and it works as intended.
Good job 👍🎉!
…setup (elastic#97404) * Don't fail on, just report, update and reupdate errors. * Show error toast on update and reupdate errors. * Don't return empty error array. * Adjust mock. * Adjust test.
Summary
Completes first implementation of #91864
Follow-up to #95649
This changes
/api/fleet/setup
such thatnonFatalPackageUpgradeErrors
that reports all errors that have happened during package upgradeThis also changes the Fleet UI so that it shows an error toast when
nonFatalPackageUpgradeErrors
exists.How to test this:
(NOTE: In all
curl
commands below, adjust or remove theBASEPATH
portion of the URL.)Craft a
system
package that has the newest version number of allsystem
packages, and that triggers an error during installation. Serve it from a locally running registry. To do so at the moment of this writing, edit any dashboard insystem/0.10.9
to includeinstead of
7.3.0
.Start Kibana. Do NOT open the UI yet.
Install a previous, non-broken version of the package with
Call the setup API endpoint with
Observe that the return value contains a package upgrade error, but also
isInitialized: true
.Now navigate to the Fleet UI. Observe that you see the full Fleet UI, with an error toast like this:
In dev tools / network, verify that you see the error contained in the response:
Now uninstall the nonbroken package (or restart your dev setup to start with an empty database) and call
/api/fleet/setup
immediately. Verify that it still returns an error (because the error happens during installation, not upgrade).Open the Fleet UI and verify that you can't use it because the error during installation.
Test against the official registry to verify that setup with good packages still works as expected.
Known issues
When you click on "Show the full error" in the error toast, the next modal is empty. I couldn't find a way to pass the error array to the toast notification in the correct form, any help would be appreciated. The full error is visible in dev tools, so I'd suggest this can be fixed in a follow-up change unless I missed something trivial.
When testing that installation of a broken package still blocks the whole UI, #97401 happens.
Unit tests could be extended.