Cannot delete indices that are being snapshotted – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when you attempt to delete Elasticsearch indices that are currently being snapshotted. The snapshot process needs to complete before any deletion can occur. To resolve this issue, you can either wait for the snapshot process to finish or manually stop the snapshot process. However, stopping the snapshot process may result in incomplete data backup. Another solution is to use the “delete index API” with the “ignore_unavailable” option set to true, which will delete only the available indices and ignore the ones being snapshotted.

This guide will help you check for common problems that cause the log ” Cannot delete indices that are being snapshotted: ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: metadata, cluster, indices, delete.

Log Context

Log “Cannot delete indices that are being snapshotted:” class name is MetadataDeleteIndexService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 }  // Check if index deletion conflicts with any running snapshots
 Set snapshottingIndices = SnapshotsService.snapshottingIndices(currentState; indicesToDelete);
 if (snapshottingIndices.isEmpty() == false) {
 throw new SnapshotInProgressException("Cannot delete indices that are being snapshotted: " + snapshottingIndices +
 ". Try again after snapshot finishes or cancel the currently running snapshot.");
 }  RoutingTable.Builder routingTableBuilder = RoutingTable.builder(currentState.routingTable());
 Metadata.Builder metadataBuilder = Metadata.builder(meta);

 

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?