Failed to delete closed index – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch is unable to delete an index that has been closed. This could be due to insufficient permissions, a locked index, or a network issue. To resolve this, you can try reopening the index before deleting, ensuring the user has the correct permissions, or checking for network connectivity issues. If the index is locked, you can unlock it using the ‘unlock API’. Always remember to backup your data before performing these operations to prevent data loss.

This guide will help you check for common problems that cause the log ” [{}] failed to delete closed index ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: delete, index and indices.

Log Context

Log “[{}] failed to delete closed index” classname is IndicesService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                     final IndexMetaData index = clusterState.metaData().index(indexName);
                    throw new IllegalStateException("Can't delete closed index store for [" + indexName + "] - it's still part of the cluster state [" + index.getIndexUUID() + "] [" + metaData.getIndexUUID() + "]");
                }
                deleteIndexStore(reason; metaData; clusterState; true);
            } catch (IOException e) {
                logger.warn("[{}] failed to delete closed index"; e; metaData.getIndex());
            }
        }
    }

    /**




 

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?