elastic/elasticsearch · error · IllegalArgumentException

Found unknown path element [{element}] in [{getName()}]

Error message

Found unknown path element [{element}] in [{getName()}]

What it means

Error "Found unknown path element [{element}] in [{getName()}]" thrown in elastic/elasticsearch.

Source

Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/InternalMatrixStats.java:216

        if (path.isEmpty()) {
            return this;
        } else if (path.size() == 2) {
            if (results == null) {
                return emptyMap();
            }
            final String field = path.get(0)
                .replaceAll("^[\"']+", "") // remove leading " and '
                .replaceAll("[\"']+$", ""); // remove trailing " and '
            final String element = path.get(1);
            return switch (element) {
                case "counts" -> results.getFieldCount(field);
                case "means" -> results.getMean(field);
                case "variances" -> results.getVariance(field);
                case "skewness" -> results.getSkewness(field);
                case "kurtosis" -> results.getKurtosis(field);
                case "covariance" -> results.getCovariance(field, field);
                case "correlation" -> results.getCorrelation(field, field);
                default -> throw new IllegalArgumentException("Found unknown path element [" + element + "] in [" + getName() + "]");
            };
        } else if (path.size() == 1) {
            String element = path.get(0);
            if (results == null) {
                return emptyMap();
            }
            return switch (element) {
                case "counts" -> results.getFieldCounts();
                case "means" -> results.getMeans();
                case "variances" -> results.getVariances();
                case "skewness" -> results.getSkewness();
                case "kurtosis" -> results.getKurtosis();
                case "covariance" -> results.getCovariances();
                case "correlation" -> results.getCorrelations();
                default -> throw new IllegalArgumentException("Found unknown path element [" + element + "] in [" + getName() + "]");
            };
        } else {
            throw new IllegalArgumentException("path not supported for [" + getName() + "]: " + path);

View on GitHub (pinned to db6a809a66)

When it happens

Trigger: Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/InternalMatrixStats.java:216 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/93cf340cb1dfded2. Report an issue: GitHub.