Saved objects API should return 500 for all methods when the index doesn't exist #89642
Labels
Feature:Saved Objects
project:ResilientSavedObjectMigrations
Reduce Kibana upgrade failures by making saved object migrations more resilient
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
In #85778 saved objects was changed to no longer auto-create the index if it doesn't exist. This prevents inadvertent data loss and hard to recover from / debug failure scenarios where the auto-created index doesn't have the right mappings.
When this happens indexing methods like
create, update
will return a 500 response, however other methods likeget
still returns a generic 404 andfind
200 with empty results. I think the original intention behind this behaviour was because saved objects is a black box and users have no way to act on an index being missing #14141 However, when the index is missing it means our saved objects black box is broken beyond repair, so even if users can't fix it, the API should not respond as if everything is working as normal. It's very unlikely that the saved objects index goes missing, but when this happens I think it's safer behaviour to return a 500 than to pretend like there just weren't any results to return.The text was updated successfully, but these errors were encountered: