Skip to content

Writes to a non-existent kibana index can break healthcheck #12819

@spalger

Description

@spalger

The healthcheck gets into an unrecoverable state when a saved object is written to the kibana index before it exists.

To reproduce this:

  1. Startup kibana and es
  2. Open discover and prepare to save a new saved search
  3. In a new terminal execute sleep 10; curl -XDELETE http://localhost:9200/.kibana
  4. before the 10 second timer is done, get in position to save the search
  5. as soon as the delete goes through, save the search and observe the kibana server begin attempting to add the "visualization" type to the mapping every 2.5 second.

We've discussed this with the elasticsearch team as a part of elastic/elasticsearch#23685 and the way to fix it is using index templates. Rather than checking for the kibana index in the healthcheck we should probably:

  1. Check for the kibana index template
    • create it if it doesn't exist
    • patch it for missing types/properties (in case of an upgrade, or new plugin install)
  2. Check for the config doc
    • create it if it doesn't exist
    • will autocreate the kibana index if it also didn't exist
  3. Read the kibana index mapping
    • ensure that defined properties match their expected settings
    • add any missing properties (in case of an upgrade, or new plugin install)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions