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 :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
.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()
.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()
                .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()

 

 [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.