Failed to delete index on disk – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.2

Briefly, this error occurs when Elasticsearch is unable to delete an index from the disk due to insufficient permissions, disk space issues, or a locked index. To resolve this, you can try freeing up disk space, ensuring Elasticsearch has the necessary permissions to perform the operation, or unlocking the index if it’s locked. Additionally, check if any process is using the index files, preventing their deletion. Restarting Elasticsearch may also help in some cases.

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

Log Context

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

            try {
                deleteIndexStoreIfDeletionAllowed("stale deleted index"; index; indexSettings; ALWAYS_TRUE);
            } catch (Exception e) {
                // we just warn about the exception here because if deleteIndexStoreIfDeletionAllowed
                // throws an exception; it gets added to the list of pending deletes to be tried again
                logger.warn(() -> new ParameterizedMessage("[{}] failed to delete index on disk"; metadata.getIndex()); e);
            }
            return metadata;
        }
        return null;
    }

 

 [ratemypost]