# Kibana index corrupted? Should I delete it and restart service?

**URL:** <https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896>\
**Category:** Kibana\
**Created:** [July 28, 2022, 3:34pm UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896 "2022-07-28T15:34:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_s/32/98686_2.png) [@Mark\_S](https://discuss.elastic.co/u/Mark_S)\
**Post date:** [July 28, 2022, 3:34pm UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/1 "2022-07-28T15:34:06Z")

</div>

A newly installed kibana could not create index pattern, so I restarted the service, and then I was not able to connect to 5601.

From the logs (see bellow) I suspect that there is a problem with the kibana indices. What if I deleted all ".kibana\*" indices and restart the service - would it recreate it correctly?  
Or perhaps a simple editing of a .kibana index settings would fix the issue?

```auto
{"type":"log","@timestamp":"2022-07-28T17:22:51+03:00","tags":["info","savedobjects-service"],"pid":1178361,"message":"[.kibana] INIT -> FATAL. took: 553ms."}
{"type":"log","@timestamp":"2022-07-28T17:22:51+03:00","tags":["fatal","root"],"pid":1178361,"message":"Error: Unable to complete saved object migrations for the [.kibana] index: The .kibana alias is pointing to a newer version of Kibana: v7.17.1\n at migrationStateActionMachine (/usr/share/kibana/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.js:144:29)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Promise.all (index 0)\n at SavedObjectsService.start (/usr/share/kibana/src/core/server/saved_objects/saved_objects_service.js:181:9)\n at Server.start (/usr/share/kibana/src/core/server/server.js:330:31)\n at Root.start (/usr/share/kibana/src/core/server/root/index.js:69:14)\n at bootstrap (/usr/share/kibana/src/core/server/bootstrap.js:120:5)\n at Command.<anonymous> (/usr/share/kibana/src/cli/serve/serve.js:229:5)"}

```

and here is what i get with curl -X GET localhost:9200/.kibana/\_settings?pretty=true

```auto
{
  ".kibana_7.17.1_001" : {
    "settings" : {
      "index" : {
        "refresh_interval" : "1s",
        "auto_expand_replicas" : "0-1",
        "blocks" : {
          "write" : "false"
        },
        "provided_name" : ".kibana_7.17.1_001",
        "creation_date" : "1651065321600",
        "priority" : "10",
        "number_of_replicas" : "0",
        "uuid" : "i6VMkZwpRXyYGwTdES99QA",
        "version" : {
          "created" : "7170099"
        },
        "routing" : {
          "allocation" : {
            "include" : {
              "_tier_preference" : "data_content"
            },
            "initial_recovery" : {
              "_id" : null
            }
          }
        },
        "number_of_shards" : "1",
        "routing_partition_size" : "1",
        "resize" : {
          "source" : {
            "name" : ".kibana_7.17.1_reindex_temp",
            "uuid" : "_Yxk0R1qRMuwbmcFybVUOw"
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 28, 2022, 11:07pm UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/2 "2022-07-28T23:07:25Z")

</div>

Welcome to our community! 😃

> [@Mark\_S](#):
>
> `The .kibana alias is pointing to a newer version of Kibana: v7.17.1`

Did you attempt any upgrades here?

---

<div class="post-metadata">

**Author:** ![Mark\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_s/32/98686_2.png) [@Mark\_S](https://discuss.elastic.co/u/Mark_S)\
**Post date:** [July 29, 2022, 8:29am UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/3 "2022-07-29T08:29:29Z")

</div>

Thanks warkolm!  
I was not the one that did the installation and the person that did it is not available... So I can only guess that an upgrade started but never completed...

I also noticed two event logs from two versions both with "is\_write\_index" : true..

```auto
 ".kibana-event-log-7.17.0-000006" : {
    "aliases" : {
      ".kibana-event-log-7.17.0" : {
        "is_write_index" : true,
        "is_hidden" : true
      }
    }
  }

```

and

```auto
 ".kibana-event-log-7.17.1-000004" : {
    "aliases" : {
      ".kibana-event-log-7.17.1" : {
        "is_write_index" : true,
        "is_hidden" : true
      }
    }
  },

```

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [July 31, 2022, 1:48pm UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/4 "2022-07-31T13:48:15Z")

</div>

Do you have multiple Kibana instances connected to this cluster? Are they all running the same version? Given that the `.kibana` alias is already pointing to `.kibana_7.17.1_001`, running an older version of Kibana would throw the error you reported.

---

<div class="post-metadata">

**Author:** ![Mark\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_s/32/98686_2.png) [@Mark\_S](https://discuss.elastic.co/u/Mark_S)\
**Post date:** [August 1, 2022, 9:50am UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/5 "2022-08-01T09:50:13Z")

</div>

No, there is only one instance, "7.17.0"

In kibana logfile I can only find " **kbn-version":"7.17.0**".

If I search for "7.17.1" I only find reports of the index problem ("Error: Unable to complete saved object migrations for the [.kibana] index: The .kibana alias is pointing to a newer version of Kibana: **7.17.1** \n"

So i am not sure how this index was created...

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [August 1, 2022, 10:08am UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/6 "2022-08-01T10:08:37Z")

</div>

@Mark_S - Perhaps, it is the result of an upgrade attempt as @warkolm mentioned earlier. If only Kibana 7.17.0 is running in your environment, then you may want to "rollback" the Kibana aliases. In order to do that, you will need to perform a few steps:

1. Stop Kibana

2. Reset the `index.blocks.write` setting for the Kibana indices (it could have been set during the saved objects migration to 7.17.1):

```auto
PUT .kibana_7.17.0_001,.kibana_task_manager_7.17.0_001/_settings
{
  "index.blocks.write": null
}

```

1. Change the aliases:

```auto
POST /_aliases
{
    "actions" : [
        { "remove" : { "index" : ".kibana_7.17.1_001", "alias" : ".kibana" } },
        { "add" : { "index" : ".kibana_7.17.0_001", "alias" : ".kibana" } }
    ]
}

```

(Optional - depends if you have the same problem for the `.kibana_task_manager` alias too)

```auto
POST /_aliases
{
    "actions" : [
        { "remove" : { "index" : ".kibana_task_manager_7.17.1_001", "alias" : ".kibana_task_manager" } },
        { "add" : { "index" : ".kibana_task_manager_7.17.0_001", "alias" : ".kibana_task_manager" } }
    ]
}

```

1. Start Kibana and check that Kibana is up and running

---

<div class="post-metadata">

**Author:** ![Mark\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_s/32/98686_2.png) [@Mark\_S](https://discuss.elastic.co/u/Mark_S)\
**Post date:** [August 2, 2022, 8:06am UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/7 "2022-08-02T08:06:23Z")

</div>

It worked like a charm!  
Thank you for the detailed answer!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 30, 2022, 8:06am UTC](https://discuss.elastic.co/t/kibana-index-corrupted-should-i-delete-it-and-restart-service/310896/8 "2022-08-30T08:06:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
