elastic/elasticsearch · error · IllegalArgumentException
Cannot add statistics without field names.
Error message
Cannot add statistics without field names.
What it means
Error "Cannot add statistics without field names." thrown in elastic/elasticsearch.
Source
Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/RunningStats.java:126
out.writeGenericValue(fieldSum);
// counts
out.writeGenericValue(counts);
// mean
out.writeGenericValue(means);
// variances
out.writeGenericValue(variances);
// skewness
out.writeGenericValue(skewness);
// kurtosis
out.writeGenericValue(kurtosis);
// covariances
out.writeGenericValue(covariances);
}
/** updates running statistics with a documents field values **/
public void add(final String[] fieldNames, final double[] fieldVals) {
if (fieldNames == null) {
throw new IllegalArgumentException("Cannot add statistics without field names.");
} else if (fieldVals == null) {
throw new IllegalArgumentException("Cannot add statistics without field values.");
} else if (fieldNames.length != fieldVals.length) {
throw new IllegalArgumentException("Number of field values do not match number of field names.");
}
// update total, mean, and variance
++docCount;
String fieldName;
double fieldValue;
double m1, m2, m3, m4; // moments
double d, dn, dn2, t1;
final HashMap<String, Double> deltas = new HashMap<>();
for (int i = 0; i < fieldNames.length; ++i) {
fieldName = fieldNames[i];
fieldValue = fieldVals[i];
// update countsView on GitHub (pinned to db6a809a66)
When it happens
Trigger: Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/RunningStats.java:126 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/5067ced6eb1be2e1.
Report an issue: GitHub.