Found shard on path with a different index UUID – this – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch identifies a shard on a path that has a different index UUID. This usually happens when there’s a mismatch between the index UUID in the cluster state and the one on the disk. To resolve this issue, you can try the following: 1) Delete the mismatched index and recreate it. 2) Restore the index from a snapshot if available. 3) If the data is not important, you can delete the data directory of the node, but this will remove all data on that node.

This guide will help you check for common problems that cause the log ” {} found shard on path: [{}] with a different index UUID – this ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, shard.

Log Context

Log “{} found shard on path: [{}] with a different index UUID – this ” classname is ShardPath.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        for (Path path : availableShardPaths) {
            // EMPTY is safe here because we never call namedObject
            ShardStateMetadata load = ShardStateMetadata.FORMAT.loadLatestState(logger; NamedXContentRegistry.EMPTY; path);
            if (load != null) {
                if (load.indexUUID.equals(indexUUID) == false && IndexMetadata.INDEX_UUID_NA_VALUE.equals(load.indexUUID) == false) {
                    logger.warn("{} found shard on path: [{}] with a different index UUID - this "
                        + "shard seems to be leftover from a different index with the same name. "
                        + "Remove the leftover shard in order to reuse the path with the current index"; shardId; path);
                    throw new IllegalStateException(shardId + " index UUID in shard state was: " + load.indexUUID
                        + " expected: " + indexUUID + " on shard path: " + path);
                }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?