Action is configured for index in policy which is mounted as searchable snapshot – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.11-7.15

Briefly, this error occurs when an Elasticsearch policy is configured to perform an action on an index that is mounted as a searchable snapshot. This is not allowed because searchable snapshots are read-only. To resolve this issue, you can either remove the action from the policy or unmount the snapshot, perform the action, and then remount it. Alternatively, you can create a new policy specifically for the searchable snapshot that doesn’t include the disallowed action.

This guide will help you check for common problems that cause the log ” [{}] action is configured for index [{}] in policy [{}] which is mounted as searchable snapshot. ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: snapshot, index, plugin.

Log Context

Log “[{}] action is configured for index [{}] in policy [{}] which is mounted as searchable snapshot. ” classname is FreezeAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            (index; clusterState) -> {
                IndexMetadata indexMetadata = clusterState.getMetadata().index(index);
                assert indexMetadata != null : "index " + index.getName() + " must exist in the cluster state";
                String policyName = LifecycleSettings.LIFECYCLE_NAME_SETTING.get(indexMetadata.getSettings());
                if (indexMetadata.getSettings().get(LifecycleSettings.SNAPSHOT_INDEX_NAME) != null) {
                    logger.warn("[{}] action is configured for index [{}] in policy [{}] which is mounted as searchable snapshot. " +
                        "Skipping this action"; FreezeAction.NAME; index.getName(); policyName);
                    return true;
                }
                if (indexMetadata.getSettings().getAsBoolean("index.frozen"; false)) {
                    logger.debug("skipping [{}] action for index [{}] in policy [{}] as the index is already frozen"; FreezeAction.NAME;

 

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?