elasticsearchelastic-stackelkelasticsearch-7kibana-7

Unable to delete index pattern in Kibana


I have moved from ELK 7.9 to ELK 7.15 in an attempt to solve this problem and it looks like all that effort was of no use. I am still unable to delete the index pattern in Kibana, neither through the console, nor through the GUI.

Trying to delete it from the saved objects section simply gets stuck for ever on this screen

enter image description here

Deleting it from the below, temporarily shows that the index pattern has been deleted. But once you reload the page, it comes back again

enter image description here

The elastic search index does get deleted successfully however.

Trying it all from the devtools also does not seem to work. Some of the attempts made and the respective outputs are shown below:

GET .kibana/_search
{
  "_source": ["index-pattern.title"],
  "query": {
    "term": {
      "type": "index-pattern"
    }
  }
}

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 4.0535226,
    "hits" : [
      {
        "_index" : ".kibana_7.15.0_001",
        "_type" : "_doc",
        "_id" : "index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30",
        "_score" : 4.0535226,
        "_source" : {
          "index-pattern" : {
            "title" : "all-security-bugs-from-jira"
          }
        }
      }
    ]
  }
}

DELETE /index_patterns/index_pattern/index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30

{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [index_patterns]",
        "resource.type" : "index_expression",
        "resource.id" : "index_patterns",
        "index_uuid" : "_na_",
        "index" : "index_patterns"
      }
    ],
    "type" : "index_not_found_exception",
    "reason" : "no such index [index_patterns]",
    "resource.type" : "index_expression",
    "resource.id" : "index_patterns",
    "index_uuid" : "_na_",
    "index" : "index_patterns"
  },
  "status" : 404
}

DELETE index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30

{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30]",
        "resource.type" : "index_or_alias",
        "resource.id" : "index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30",
        "index_uuid" : "_na_",
        "index" : "index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30"
      }
    ],
    "type" : "index_not_found_exception",
    "reason" : "no such index [index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30]",
    "resource.type" : "index_or_alias",
    "resource.id" : "index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30",
    "index_uuid" : "_na_",
    "index" : "index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30"
  },
  "status" : 404
}

DELETE 822d7f50-7cd9-11ec-95d5-a3730f55fd30

{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [822d7f50-7cd9-11ec-95d5-a3730f55fd30]",
        "resource.type" : "index_or_alias",
        "resource.id" : "822d7f50-7cd9-11ec-95d5-a3730f55fd30",
        "index_uuid" : "_na_",
        "index" : "822d7f50-7cd9-11ec-95d5-a3730f55fd30"
      }
    ],
    "type" : "index_not_found_exception",
    "reason" : "no such index [822d7f50-7cd9-11ec-95d5-a3730f55fd30]",
    "resource.type" : "index_or_alias",
    "resource.id" : "822d7f50-7cd9-11ec-95d5-a3730f55fd30",
    "index_uuid" : "_na_",
    "index" : "822d7f50-7cd9-11ec-95d5-a3730f55fd30"
  },
  "status" : 404
}

GET /.kibana?pretty

does not give any document with the index pattern concerned. This was also confirmed by the below 2 queries

GET .kibana/index-pattern/822d7f50-7cd9-11ec-95d5-a3730f55fd30

{
  "_index" : ".kibana_7.15.0_001",
  "_type" : "index-pattern",
  "_id" : "822d7f50-7cd9-11ec-95d5-a3730f55fd30",
  "found" : false
}

GET .kibana/index-pattern/index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30

{
  "_index" : ".kibana_7.15.0_001",
  "_type" : "index-pattern",
  "_id" : "index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30",
  "found" : false
}

I have been trying to follow the suggestions on https://discuss.elastic.co/t/cant-delete-index-pattern-in-kibana/148341/5

Any help understanding what could I be doing wrong here is greatly appreciated.


Solution

  • You are not deleting from right index

    Do below to delete:

    DELETE .kibana/_doc/index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30
    

    To get the documents you are giving wrong type, try below:

    GET .kibana/_doc/index-pattern:822d7f50-7cd9-11ec-95d5-a3730f55fd30