Source indices have been deleted or closed – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.3-8.9

Briefly, this error occurs when Elasticsearch tries to perform operations on source indices that have been deleted or closed. This could be due to a misconfiguration or an accidental deletion. To resolve this issue, you can either reopen the closed indices using the ‘open index’ API, or recreate the deleted indices. Ensure that the indices are properly configured and protected to prevent accidental deletion or closure in the future. Also, regularly monitor your Elasticsearch cluster to detect any anomalies early.

This guide will help you check for common problems that cause the log ” Source indices have been deleted or closed. ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, source, indices.

Log Context

Log “Source indices have been deleted or closed.” class name is AbstractCompositeAggFunction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 ActionListener.wrap(r -> {
 try {
 final Aggregations aggregations = r.getAggregations();
 if (aggregations == null) {
 listener.onFailure(
 new ElasticsearchStatusException("Source indices have been deleted or closed."; RestStatus.BAD_REQUEST)
 );
 return;
 }
 final CompositeAggregation agg = aggregations.get(COMPOSITE_AGGREGATION_NAME);
 if (agg == null || agg.getBuckets().isEmpty()) {

 

 [ratemypost]