{"record":{"id":"3e6fb604ec7727c2","repo":"elastic/elasticsearch","slug":"unexpected-token-token-currentfieldname-in-3e6fb6","errorCode":null,"errorMessage":"Unexpected token {token} [{currentFieldName}] in [{aggregationName}]","messagePattern":"Unexpected token (.+?) \\[(.+?)\\] in \\[(.+?)\\]","errorType":"validation","errorClass":"ParsingException","httpStatus":null,"severity":"error","filePath":"modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/ArrayValuesSourceParser.java","lineNumber":195,"sourceCode":"        final Map<String, Object> missing\n    ) throws IOException {\n        XContentParser.Token token = parser.currentToken();\n        if (token == null) {\n            token = parser.nextToken();\n        }\n\n        if (token == XContentParser.Token.FIELD_NAME) {\n            final String fieldName = parser.currentName();\n            if (missing.containsKey(fieldName)) {\n                throw new ParsingException(\n                    parser.getTokenLocation(),\n                    \"Missing field [\" + fieldName + \"] already defined as [\" + missing.get(fieldName) + \"] in [\" + aggregationName + \"].\"\n                );\n            }\n            parser.nextToken();\n            missing.put(fieldName, parser.objectText());\n        } else {\n            throw new ParsingException(\n                parser.getTokenLocation(),\n                \"Unexpected token \" + token + \" [\" + currentFieldName + \"] in [\" + aggregationName + \"]\"\n            );\n        }\n    }\n\n    /**\n     * Creates a {@link ValuesSourceAggregationBuilder} from the information\n     * gathered by the subclass. Options parsed in\n     * {@link ArrayValuesSourceParser} itself will be added to the factory\n     * after it has been returned by this method.\n     *\n     * @param aggregationName\n     *            the name of the aggregation\n     * @param valuesSourceType\n     *            the type of the {@link ValuesSource}\n     * @param otherOptions\n     *            a {@link Map} containing the extra options parsed by the","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/ArrayValuesSourceParser.java#L177-L213","documentation":"Error \"Unexpected token {token} [{currentFieldName}] in [{aggregationName}]\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/ArrayValuesSourceParser.java:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}