[Fleet] Don't fail on errors in 'update' or 'reupdate' operation in /setup#97402
Closed
skh wants to merge 15 commits intoelastic:masterfrom
Closed
[Fleet] Don't fail on errors in 'update' or 'reupdate' operation in /setup#97402skh wants to merge 15 commits intoelastic:masterfrom
skh wants to merge 15 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
Contributor
|
Pinging @elastic/fleet (Feature:Fleet) |
Contributor
Author
|
Closing in favor of #97404 because mess-up, sorry for the noise. |
Contributor
💔 Build Failed
Failed CI StepsTest FailuresKibana Pipeline / jest / Jest Tests.x-pack/plugins/fleet/server/services/epm/packages.ensureInstalledDefaultPackages should return an array of Installation objects when successfulStandard OutStack TraceMetrics [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 |
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
Completes first implementation of #91864
Follow-up to #95649
This changes
/api/fleet/setupsuch thatnonFatalPackageUpgradeErrorsthat reports all errors that have happened during package upgradeThis also changes the Fleet UI so that it shows an error toast when
nonFatalPackageUpgradeErrorsexists and is not empty.How to test this:
Craft a
systempackage that triggers an error during installation, serve it from a locally running registry. Do do so, edit any dashboard insystem/0.10.9to 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 the 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/setupimmediately. 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.