Failed to record snapshot for snapshot in policy policy not found – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.4-7.15

Briefly, this error occurs when Elasticsearch tries to execute a snapshot policy that doesn’t exist. The snapshot policy could have been deleted or not created yet. To resolve this issue, you can either create a new snapshot policy with the same name or update the existing policy to point to a valid snapshot policy. Also, ensure that the policy is correctly configured and that the Elasticsearch cluster has the necessary permissions to execute the snapshot policy.

This guide will help you check for common problems that cause the log ” failed to record snapshot [{}] for snapshot [{}] in policy [{}]: policy not found ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: snapshot, plugin.

Log Context

Log “failed to record snapshot [{}] for snapshot [{}] in policy [{}]: policy not found” classname is SnapshotLifecycleTask.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
}
Map<string snapshotlifecyclepolicymetadata=""> snapLifecycles = new HashMap(snapMeta.getSnapshotConfigurations());
SnapshotLifecyclePolicyMetadata policyMetadata = snapLifecycles.get(policyName);
if (policyMetadata == null) {
logger.warn("failed to record snapshot [{}] for snapshot [{}] in policy [{}]: policy not found";
exception.isPresent() ? "failure" : "success"; snapshotName; policyName);
return currentState;
}
SnapshotLifecyclePolicyMetadata.Builder newPolicyMetadata = SnapshotLifecyclePolicyMetadata.builder(policyMetadata);
</string>
} Map<string snapshotlifecyclepolicymetadata=""> snapLifecycles = new HashMap(snapMeta.getSnapshotConfigurations()); SnapshotLifecyclePolicyMetadata policyMetadata = snapLifecycles.get(policyName); if (policyMetadata == null) { logger.warn("failed to record snapshot [{}] for snapshot [{}] in policy [{}]: policy not found"; exception.isPresent() ? "failure" : "success"; snapshotName; policyName); return currentState; } SnapshotLifecyclePolicyMetadata.Builder newPolicyMetadata = SnapshotLifecyclePolicyMetadata.builder(policyMetadata); </string>
            }

            Map snapLifecycles = new HashMap(snapMeta.getSnapshotConfigurations());
            SnapshotLifecyclePolicyMetadata policyMetadata = snapLifecycles.get(policyName);
            if (policyMetadata == null) {
                logger.warn("failed to record snapshot [{}] for snapshot [{}] in policy [{}]: policy not found";
                    exception.isPresent() ? "failure" : "success"; snapshotName; policyName);
                return currentState;
            }

            SnapshotLifecyclePolicyMetadata.Builder newPolicyMetadata = SnapshotLifecyclePolicyMetadata.builder(policyMetadata);

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.