-
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
[ML] Anomaly Explorer fails to load after update to 7.9.0 #74935
Comments
Pinging @elastic/ml-ui (:ml) |
I don't understand why this is only happening in BC9. As far as I can see the same problem was present in BC1 - BC8 too. |
I updated the description and removed the reference to BC9. BC9 was just the version where we discovered the issue. |
When the ML annotations index was first added, only the ML UI wrote to it, so the code to create it was designed with this in mind. Now the ML backend also creates annotations, and those mappings can change between versions. In this change: 1. The code that runs on the master node to create the annotations index if it doesn't exist but another ML index does also now ensures the mappings are up-to-date. This is good enough for the ML UI's use of the annotations index, because the upgrade order rules say that the whole Elasticsearch cluster must be upgraded prior to Kibana, so the master node should be on the newer version before Kibana tries to write an annotation with the new fields. 2. We now also check whether the annotations index exists with the correct mappings before starting an autodetect process on a node. This is necessary because ML nodes can be upgraded before the master node, so could write an annotation with the new fields before the master node knows about the new fields. Relates elastic/kibana#74935
The underlying problem will be fixed by elastic/elasticsearch#61107 |
When the ML annotations index was first added, only the ML UI wrote to it, so the code to create it was designed with this in mind. Now the ML backend also creates annotations, and those mappings can change between versions. In this change: 1. The code that runs on the master node to create the annotations index if it doesn't exist but another ML index does also now ensures the mappings are up-to-date. This is good enough for the ML UI's use of the annotations index, because the upgrade order rules say that the whole Elasticsearch cluster must be upgraded prior to Kibana, so the master node should be on the newer version before Kibana tries to write an annotation with the new fields. 2. We now also check whether the annotations index exists with the correct mappings before starting an autodetect process on a node. This is necessary because ML nodes can be upgraded before the master node, so could write an annotation with the new fields before the master node knows about the new fields. Relates elastic/kibana#74935
One way to insure against suffering this problem at all is to manually adjust the mappings that are required in 7.9.0 before upgrading to 7.9.0 (it doesn't hurt to apply them to an earlier version if the
|
@walterra and @droberts195 the above workaround successfully brought our UI back, and new annotations can be created without problem. However, the annotations being created before the upgrade are still missing. I am wondering if there is one extra step to manually create |
Thanks for testing it @wwang500. You are correct that there's a flaw in the workaround, which is that there is no template for So the instructions need to be different:
Sorry for the confusion. I will adjust the original issue description to avoid confusion for people who just read that. |
I can confirm the above workaround is a valid working one. thanks @droberts195 |
After an update to 7.9.0, the Anomaly Explorer might fail to load. The root cause is that the mappings for the index for annotations were not properly updated.
To reproduce the original problem:
To reproduce the issue without the update progress:
When pointing the annotations index aliases to another index without the proper mapping, we can recreate the issue for testing and development purposes. In Dev Console do:
After creating the next annotation you should be able to reproduce the issue in Anomaly Explorer.
To restore the original behavior call:
Workaround
Since you cannot change mappings of an existing index, if you don’t have anything critically important in the existing annotations index then the easiest way to fix it is just to delete the
.ml-annotations-6
indexIf you do have annotations that are important then you need to do some reindexing:
temp-ml-annotations
- it doesn't matter about settings or mappings for this index - defaults are fine.ml-annotations-6
intotemp-ml-annotations
.ml-annotations-6
index.ml-annotations-6
to be recreatedtemp-ml-annotations
into.ml-annotations-6
temp-ml-annotations
indexBugfix / Desired outcome for the UI
The UI should handle the error loading annotations more gracefully with a meaningful error message instead of ending up with a blank page.
The text was updated successfully, but these errors were encountered: