[Fleet] Don't fail on errors in 'update' or 'reupdate' operation in /setup#97404
Merged
skh merged 5 commits intoelastic:masterfrom Apr 19, 2021
Merged
Conversation
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
skh
commented
Apr 18, 2021
| if (setupStatus.nonFatalPackageUpgradeErrors.length > 0) { | ||
| body.nonFatalPackageUpgradeErrors = setupStatus.nonFatalPackageUpgradeErrors; | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
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
Contributor
There was a problem hiding this comment.
I remember some discussion around what should happen on errors. I'm sure @Zacqary will follow up if needed.
Contributor
💛 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 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 |
afgomez
approved these changes
Apr 19, 2021
Contributor
afgomez
left a comment
There was a problem hiding this comment.
Code LGTM. I downloaded the PR and it works as intended.
Good job 👍🎉!
skh
added a commit
to skh/kibana
that referenced
this pull request
Apr 19, 2021
…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.
1 task
This was referenced Apr 26, 2021
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.How to test this:
(NOTE: In all
curlcommands below, adjust or remove theBASEPATHportion of the URL.)Craft a
systempackage that has the newest version number of allsystempackages, 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.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 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/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.
Unit tests could be extended.