Briefly, this error occurs when Elasticsearch cannot find the specified lifecycle policy. Lifecycle policies are used to manage how your data is stored and when it’s deleted. This error could be due to a typo in the policy name, or the policy may not have been created yet. To resolve this issue, you can check the policy name for typos, or create the lifecycle policy if it doesn’t exist. Also, ensure that the policy is in the correct cluster if you’re using multiple clusters.
This guide will help you check for common problems that cause the log ” Lifecycle policy not found: {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.
Log Context
Log “Lifecycle policy not found: {}” class name is TransportDeleteLifecycleAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
); } ClusterState.Builder newState = ClusterState.builder(currentState); IndexLifecycleMetadata currentMetadata = currentState.metadata().custom(IndexLifecycleMetadata.TYPE); if (currentMetadata == null || currentMetadata.getPolicyMetadatas().containsKey(request.getPolicyName()) == false) { throw new ResourceNotFoundException("Lifecycle policy not found: {}"; request.getPolicyName()); } SortedMapnewPolicies = new TreeMap<>(currentMetadata.getPolicyMetadatas()); newPolicies.remove(request.getPolicyName()); IndexLifecycleMetadata newMetadata = new IndexLifecycleMetadata(newPolicies; currentILMMode(currentState)); newState.metadata(Metadata.builder(currentState.getMetadata()).putCustom(IndexLifecycleMetadata.TYPE; newMetadata).build());