-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
Description
Found in 6.4.0-BC1
While creating a job, if the user tries to specify scope in a custom rule even though field_name, by_field_name, over_field_name or partition_field_name, the response root cause error message is:
Invalid detector rule: scope field 'someFieldName' is invalid; select from []
Note that the error reason offers an empty list as a choice for scope fields.
A better reason should be returned instead, stating that scope cannot be specified because the detector doesn't use a field_name, by_field_name, over_field_name or partition_field_name.
Steps to reproduce
- Send an API request to create a job (detector with no fields and custom rule with scope specified)
PUT _xpack/ml/anomaly_detectors/custom_rule_test
{
"analysis_config": {
"detectors": [
{
"function": "count",
"custom_rules": [
{
"actions": [
"skip_result"
],
"scope": {
"someFieldName": {
"filter_id": "someFilterId",
"filter_type": "include"
}
}
}
]
}
]
},
"data_description": {}
}- Notice the issue in the response root cause error reason.