Unexpected null for anomaly detection memory requirement for – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.5-8.9

Briefly, this error occurs when Elasticsearch tries to calculate the memory requirement for anomaly detection but encounters a null value. This could be due to a configuration issue or a problem with the data being processed. To resolve this issue, you can try the following: 1) Check your configuration settings for anomaly detection and ensure they are correctly set. 2) Inspect the data being processed for any inconsistencies or null values that could be causing the error. 3) Restart the Elasticsearch service to clear any temporary issues.

This guide will help you check for common problems that cause the log ” unexpected null for anomaly detection memory requirement for [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, memory.

Log Context

Log “unexpected null for anomaly detection memory requirement for [{}]” classname is MlMemoryAutoscalingDecider.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                .filter(PersistentTasksCustomMetadata.PersistentTask::isAssigned)
                // Memory SHOULD be recently refreshed; so in our current state; we should at least have an idea of the memory used
                .mapToLong(t -> {
                    Long mem = getAnomalyMemoryRequirement(t);
                    if (mem == null) {
                        logger.warn("unexpected null for anomaly detection memory requirement for [{}]"; MlTasks.jobId(t.getId()));
                    }
                    assert mem != null : "unexpected null for anomaly memory requirement after recent stale check";
                    return mem == null ? 0 : mem;
                })
                .max()

 

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?