{"record":{"id":"10f2214d13db3d67","repo":"elastic/elasticsearch","slug":"missing-required-field-buckets-path-for-bucket-s","errorCode":null,"errorMessage":"Missing required field [buckets_path] for bucket_selector aggregation [{reducerName}]","messagePattern":"Missing required field \\[buckets_path\\] for bucket_selector aggregation \\[(.+?)\\]","errorType":"validation","errorClass":"ParsingException","httpStatus":null,"severity":"error","filePath":"modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java","lineNumber":157,"sourceCode":"                } else if (BUCKETS_PATH.match(currentFieldName, parser.getDeprecationHandler())) {\n                    Map<String, Object> map = parser.map();\n                    bucketsPathsMap = new HashMap<>();\n                    for (Map.Entry<String, Object> entry : map.entrySet()) {\n                        bucketsPathsMap.put(entry.getKey(), String.valueOf(entry.getValue()));\n                    }\n                } else {\n                    throw new ParsingException(\n                        parser.getTokenLocation(),\n                        \"Unknown key for a \" + token + \" in [\" + reducerName + \"]: [\" + currentFieldName + \"].\"\n                    );\n                }\n            } else {\n                throw new ParsingException(parser.getTokenLocation(), \"Unexpected token \" + token + \" in [\" + reducerName + \"].\");\n            }\n        }\n\n        if (bucketsPathsMap == null) {\n            throw new ParsingException(\n                parser.getTokenLocation(),\n                \"Missing required field [\" + BUCKETS_PATH.getPreferredName() + \"] for bucket_selector aggregation [\" + reducerName + \"]\"\n            );\n        }\n\n        if (script == null) {\n            throw new ParsingException(\n                parser.getTokenLocation(),\n                \"Missing required field [\"\n                    + Script.SCRIPT_PARSE_FIELD.getPreferredName()\n                    + \"] for bucket_selector aggregation [\"\n                    + reducerName\n                    + \"]\"\n            );\n        }\n\n        BucketSelectorPipelineAggregationBuilder factory = new BucketSelectorPipelineAggregationBuilder(\n            reducerName,","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java#L139-L175","documentation":"Error \"Missing required field [buckets_path] for bucket_selector aggregation [{reducerName}]\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java:157 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-12T12:31:55.035Z"}