%s marking and sending shard failed due to %s – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.9

Briefly, this error occurs when Elasticsearch encounters an issue with a specific shard, causing it to mark the shard as failed and attempts to send it elsewhere. This could be due to a variety of reasons such as hardware failure, network issues, or data corruption. To resolve this, you could try restarting the Elasticsearch node, checking for hardware or network issues, or restoring the shard from a backup. If the issue persists, you may need to reindex your data.

This guide will help you check for common problems that cause the log ” %s marking and sending shard failed due to [%s] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: indices, cluster, shard.

Log Context

Log “%s marking and sending shard failed due to [%s]” classname is IndicesClusterStateService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        }
    }

    private void sendFailShard(ShardRouting shardRouting; String message; @Nullable Exception failure; ClusterState state) {
        try {
            logger.warn(() -> format("%s marking and sending shard failed due to [%s]"; shardRouting.shardId(); message); failure);
            failedShardsCache.put(shardRouting.shardId(); shardRouting);
            shardStateAction.localShardFailed(shardRouting; message; failure; ActionListener.noop(); state);
        } catch (Exception inner) {
            if (failure != null) inner.addSuppressed(failure);
            logger.warn(

 

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?