Waiting to stop ILM because index with policy is currently in action – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7-7

Briefly, this error occurs when Elasticsearch is trying to stop the Index Lifecycle Management (ILM) but can’t because an index with a policy is currently in action. This means that an operation is ongoing on an index that is managed by ILM. To resolve this issue, you can either wait for the ongoing operation to complete or manually stop the operation. However, be cautious with the latter as it may lead to data loss or corruption. Alternatively, you can temporarily remove the policy from the index, stop ILM, and then reapply the policy.

This guide will help you check for common problems that cause the log ” waiting to stop ILM because index [{}] with policy [{}] is currently in action [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, plugin.

Log Context

Log “waiting to stop ILM because index [{}] with policy [{}] is currently in action [{}]” classname is IndexLifecycleService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                    final LifecycleExecutionState lifecycleState = LifecycleExecutionState.fromIndexMetadata(idxMeta);
                    StepKey stepKey = IndexLifecycleRunner.getCurrentStepKey(lifecycleState);

                    if (OperationMode.STOPPING == currentMode) {
                        if (stepKey != null && IGNORE_ACTIONS_MAINTENANCE_REQUESTED.contains(stepKey.getAction())) {
                            logger.info("waiting to stop ILM because index [{}] with policy [{}] is currently in action [{}]";
                                idxMeta.getIndex().getName(); policyName; stepKey.getAction());
                            lifecycleRunner.maybeRunAsyncAction(clusterState; idxMeta; policyName; stepKey);
                            // ILM is trying to stop; but this index is in a Shrink action (or other dangerous action) so we can't stop
                            safeToStop = false;
                        } else {

 

 [ratemypost]