Enabling alerting rule ends up with 500 HTTP status code #107737
Labels
bug
Fixes for quality problems that affect the customer experience
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
triage_needed
Kibana version:
7.12, 7.13
Describe the bug:
When trying to create alerting rule in v7.13 or alert in v7.12, via kibana API with flag "enbaled: true" or without this flag, server responds with HTTP status code 500.
When flag is set as "enbaled: false" alert is created correctly. But, when trying to enable request via this endpoint https://www.elastic.co/guide/en/kibana/7.13/enable-rule-api.html server responds with HTTP status code 500.
Steps to reproduce:
There are three paths to reproduce this bug.
First path, with omitted "enabled" flag which is described as "Optional" in documentation.
curl -kv "https://<KIBANA_URL>/s/<SPACE>/api/alerting/rule" \ -X POST \ -H "Authorization: ApiKey <YOUR_API_KEY_HERE>" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -d ' { "params": { "criteria": [ { "aggType": "avg", "comparator": ">", "threshold": [ 1 ], "timeSize": 1, "timeUnit": "m", "metric": "some.metric" } ], "sourceId": "default", "filterQueryText": "some.query : \"query\"", "filterQuery": "{\"bool\":{\"should\":[{\"match_phrase\":{\"some.query\":\"query\"}}],\"minimum_should_match\":1}}" }, "consumer": "alerts", "rule_type_id": "metrics.alert.threshold", "schedule": { "interval": "1m" }, "actions": [], "tags": [], "notify_when": "onActionGroupChange", "name": "kibana-alert" }'
Response for this request is "{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred."}* Closing connection 0"
Second path is the same as the previous one but additionally we need to add "enbaled: true" to the request body.
Third path looks like the second one but with "enbaled: false". Alert is created successfully and when I try to enable it via
curl -kv "https:/KIBANA_URL/</s/<SPACE>/api/alerting/rule/<ALERT_ID>/_enable" \ -X POST \ -H "Authorization: ApiKey <YOUR_API_KEY_HERE>" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json"
it ends up with "{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred."}* Closing connection 0"
All the above paths are also applicable up to version 7.12
Expected behavior:
The text was updated successfully, but these errors were encountered: