Interrupted while creating shard – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.7-8.9

Briefly, this error occurs when Elasticsearch is interrupted during the process of creating a shard. This could be due to a variety of reasons such as insufficient resources, network issues, or a sudden shutdown of the Elasticsearch node. To resolve this issue, you can try increasing the resources allocated to Elasticsearch, checking the network connectivity, or ensuring that the Elasticsearch node is running properly. Additionally, check the Elasticsearch logs for more detailed information about the interruption.

This guide will help you check for common problems that cause the log ” interrupted while creating shard [{}] ” 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 “interrupted while creating shard [{}]” classname is IndicesClusterStateService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                sourceNode
            );
            listener.onResponse(true);
        } catch (ShardLockObtainFailedException e) {
            if (e.getCause() instanceof InterruptedException || Thread.currentThread().isInterrupted()) {
                logger.warn(Strings.format("interrupted while creating shard [{}]"; shardRouting); e);
                listener.onFailure(e);
                return;
            }
            logger.log(
                (iteration + 25) % 30 == 0 ? Level.WARN : Level.DEBUG;

 

 [ratemypost]