Briefly, this error occurs when Elasticsearch discovers indices that are not associated with any cluster state. These are known as “dangled” indices. They usually appear due to a failed deletion or a cluster recovery. To resolve this issue, you can either manually delete the dangled indices from the data directory or set the ‘gateway.auto_import_dangled_indices’ to ‘no’ to prevent automatic import. Alternatively, you can set it to ‘closed’ to import the dangled indices but keep them closed until manually opened.
This guide will help you check for common problems that cause the log ” importing dangled indices {} from [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: indices, dangled.
Log Context
Log “importing dangled indices {} from [{}]” classname is LocalAllocateDangledIndices.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
} if (importNeeded == false) { listener.reroute().onResponse(null); return currentState; } logger.info("importing dangled indices {} from [{}]"; sb.toString(); request.fromNode); RoutingTable routingTable = routingTableBuilder.build(); ClusterState updatedState = ClusterState.builder(currentState) .metadata(metadata) .blocks(blocks)