Skip to content
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

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,17 @@ export class IndexPattern implements IIndexPattern {
if (!this.id) {
return;
}

if (forceFieldRefresh || this.isFieldRefreshRequired()) {
await this.refreshFields();
try {
if (forceFieldRefresh || this.isFieldRefreshRequired()) {
kertal marked this conversation as resolved.
Show resolved Hide resolved
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,
});
Copy link
Member Author

@kertal kertal Jan 24, 2020

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 .

}

this.initFields();
}

Expand Down