-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] added fleet setup before installing integration #121379
[Fleet] added fleet setup before installing integration #121379
Conversation
Pinging @elastic/fleet (Team:Fleet) |
@juliaElastic The error you get seems to happens some time locally I think due to a race condition. That PR fix it in 8.0 but we should probably backport it to 7.16.x too #120819 |
toggleInstallModal(); | ||
await sendPostFleetSetup({ forceRecreate: false }); |
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.
We may want to handle the error happening in sendPostFleetSetup
we probably want to close the install modal and show the error in a toast notification as we do in other place what do you think?
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.
good point! do you think the installPackage should continue if setup fails? to fall back to the existing logic
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.
Sure we can just catch the error add a toast and try to install the package 👍
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.
const handleClickInstall = useCallback(async () => { | ||
setFleetSetupInProgress(true); | ||
toggleInstallModal(); | ||
await sendPostFleetSetup({ forceRecreate: false }); | ||
const res = await sendPostFleetSetup({ forceRecreate: false }); |
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.
a little nitpick but I would put this in a try catch to avoid uncaught exception here.
try {
const res = await sendPostFleetSetup({ forceRecreate: false });
if (res.error) {
throw res.error;
}
} catch (e) {
// show toast
}
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
FYI moved the target branch to 7.17 |
@juliaElastic in case we have another 7.16.x release, can we backport this there as well? |
Hi @joshdover & @juliaElastic
Build details: Further, we have also validated the same on latest 8.0 self-managed environment and we have found it fixed there.
Build details: Thanks |
@joshdover sorry I missed you comment earlier. I'll backport to 7.16 branch |
💔 Some backports could not be created
| To backport manually run: |
1 similar comment
💔 Some backports could not be created
| To backport manually run: |
* added fleet setup before installing integration * added fleet setup error toast message * added try catch
Summary
Fix #120358
Calling setup fleet first when clicking on integration install button.
Steps to verify:
Repeat the above with another integration and verify that setup is called and returning quickly.
What is alarming though is that first time the setup call takes almost 2 mins, and I see a few errors in kibana logs as well:
The same errors come when I navigate to Fleet to trigger setup first (on 7.16 branch)