%s failed to close store on shard removal reason %s – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.9

Briefly, this error occurs when Elasticsearch fails to close the store associated with a shard during its removal process. This could be due to a variety of reasons such as insufficient disk space, network issues, or a bug in Elasticsearch. To resolve this issue, you can try freeing up disk space, checking network connectivity, or upgrading Elasticsearch to the latest version. If the problem persists, consider reindexing the data or restarting the Elasticsearch node.

This guide will help you check for common problems that cause the log ” [%s] failed to close store on shard removal (reason: [%s]) ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, shard.

Log Context

Log “[%s] failed to close store on shard removal (reason: [%s])” classname is IndexService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                    store.close();
                } else {
                    logger.trace("[{}] store not initialized prior to closing shard; nothing to close"; shardId);
                }
            } catch (Exception e) {
                logger.warn(() -> format("[%s] failed to close store on shard removal (reason: [%s])"; shardId; reason); e);
            }
        }
    }

    private void onShardClose(ShardLock lock) {

 

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?