-
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
Don't throw exception when refreshing fields of an indexpattern #55836
Don't throw exception when refreshing fields of an indexpattern #55836
Conversation
- Condition: Indexpattern without indices and a refresh of fields is triggered - this caused an empty discover screen - and you couldn't remove the index pattern in management
Pinging @elastic/kibana-app (Team:KibanaApp) |
try { | ||
if (forceFieldRefresh || this.isFieldRefreshRequired()) { | ||
await this.refreshFields(); | ||
} | ||
} catch (e) { | ||
// eslint-disable-next-line no-console | ||
console.error(`Refreshing fields of index pattern ${this.id} failed`, { | ||
forceFieldRefresh, | ||
fields: this.fields, | ||
}); |
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.
So this is the mystery, normally, in Discover, forceFieldRefresh
is false, and also this.isFieldRefreshRequired
should return false. Currently I just could reproduce it with setting forceFieldRefresh
manually to true
. So the UI in Discover and Management works again. The question is, what causes the this.isFieldRefreshRequired
to be true?
@LeeDr we should take a look at the saved object of the index pattern that causes this failure. maybe there are no fields stored? there must be something wrong with it .
src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts
Outdated
Show resolved
Hide resolved
…-24-catch-refresh-field-exception
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.
Tested and reproduced
LGTM
Would be nice to put a link to the index pattern page in the message!
…tic#55836) * An exception when refreshing fields of an selected index pattern causes Discover to load incompletely * Add index ID + Title to the error message for
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…tic#55836) * An exception when refreshing fields of an selected index pattern causes Discover to load incompletely * Add index ID + Title to the error message for
…) (#56031) * An exception when refreshing fields of an selected index pattern caused Discover to load incompletely * Add index ID + Title of the index pattern to the error messages in this case
…) (#56066) * An exception when refreshing fields of an selected index pattern caused Discover to load incompletely * Remove throw Exception code * Add index ID + Title to the error message
Summary
When there are no indices available for the default index pattern, and its saved object contains no fields, Kibana starts an operation to refresh the field information. This fails and causes an exception when loading Discover not showing any UI except the error message.
This PR fixes this error, and improves the error message to provide more information which index pattern caused the error.
Furthermore you can delete this index pattern, which was also not possible before.
Reproduce the issue:
Use a new Kibana instance without any index pattern, create an index pattern with the Saved Object API e.g.
This index pattern is now the default index pattern. Since there are no fields in the saved object, when you load Discover, this causes an automatic refresh of the index pattern trying to get field information of existing indices. This will fail, and cause the following error screen in Discover:
Fixes: #54982, Fixes #53878
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately