Fail saved object migrations when encountering embeddable state from an unknown embeddable factory #117656
Labels
Feature:Embedding
Embedding content via iFrame
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:medium
Medium Level of Effort
Team:Presentation
Presentation Team for Dashboard, Input Controls, and Canvas
When a saved object contains persistable state from an unknown embeddable, the persisted state won't be migrated when Kibana gets upgraded.
This is because
embeddables.getEmbeddableFactory
returns anid: 'unknown'
factor withmigrations: {}
when an embeddable isn't known https://github.com/elastic/kibana/blob/main/src/plugins/embeddable/server/plugin.ts#L139-L147Even if the embeddable is later registered again, the migration might not run because the saved objects have already been marked as being up to date. I think the embeddable state might be migrated once it's loaded on the browser, but this means that
extractReferences
was potentially skipped and that because of _id regeneration the references in the embeddable might contain the old _id's.In #107678 we decided that starting from 8.0 Kibana will fail to upgrade if there are saved objects of an unknown type to prevent silent data loss with _id regeneration.
It feels like the same reasoning could be applied to persistable state too.
If implemented this would enable a use case where a customer uses Kibana Cloud (because it's required for APM/Fleet), but has a on-prem Kibana with a custom plugin that registers an embeddable with
extractReferences
ormigrations
.The text was updated successfully, but these errors were encountered: