Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] no_such_element_exception when percentiles aggregation are missing #116013

Open
prwhelan opened this issue Oct 31, 2024 · 1 comment · May be fixed by #116015
Open

[ML] no_such_element_exception when percentiles aggregation are missing #116013

prwhelan opened this issue Oct 31, 2024 · 1 comment · May be fixed by #116015
Assignees
Labels
>bug :ml Machine learning Team:ML Meta label for the ML team

Comments

@prwhelan
Copy link
Member

If tdigest or hdr percentile aggregation is used in an ML Anomaly Detection job, a no_such_element_exception is returned when there is no data returned in the percentiles bucket.

{
"name": "Error",
"request": {},
"response": {},
"body": {
"statusCode": 500,
"error": "Internal Server Error",
"message": "[no_such_element_exception\n\tRoot cause[s:\n\t\tno_such_element_exception](file:///s:/n/t/tno_such_element_exception): null]: null"
}
}
java.util.NoSuchElementException
	at java.util.Collections$EmptyIterator.next(Collections.java:4532) ~[?:?]
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessor.processPercentiles(AggregationToJsonProcessor.java:412)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessor.processLeaf(AggregationToJsonProcessor.java:382)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessor.processAggs(AggregationToJsonProcessor.java:158)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessor.processDateHistogram(AggregationToJsonProcessor.java:235)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessor.processAggs(AggregationToJsonProcessor.java:169)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessor.process(AggregationToJsonProcessor.java:94)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessorTests.aggToString(AggregationToJsonProcessorTests.java:706)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessorTests.aggToString(AggregationToJsonProcessorTests.java:693)
	at org.elasticsearch.xpack.ml.datafeed.extractor.aggregation.AggregationToJsonProcessorTests.testProcessGivenEmptyPercentiles(AggregationToJsonProcessorTests.java:513)
@prwhelan prwhelan added :ml Machine learning >bug Team:ML Meta label for the ML team labels Oct 31, 2024
@prwhelan prwhelan self-assigned this Oct 31, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

prwhelan added a commit to prwhelan/elasticsearch that referenced this issue Oct 31, 2024
Do not add the leaf node if the percentiles bucket is empty.

Fix elastic#116013
@prwhelan prwhelan linked a pull request Oct 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml Machine learning Team:ML Meta label for the ML team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants