-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution]An error "Rule failure" is getting displayed on Rule detail page. #106233
Comments
Pinging @elastic/security-solution (Team: SecuritySolution) |
@manishgupta-qasource Please review! |
Reviewed & Assigned to @MadameSheema |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
@spong @peluja1012 can you please take a look at this? thanks :) |
So initial thought was that this was related to #101582 and a migration error on upgrade was resulting in the observed behavior. Upon looking at the kibana cluster logs, it looks like all went well with the migration and no errors were logged migrating either the Only other errors logged were when Kibana was coming back online and related to the Only other notable log was with regard to Task Manager performance:
Once Kibana came back online, the rule started failing immediately as described above:
The frequency here is what stood out to me, and looking at the Rule configuration we can see it was set to a 5 second interval with a 1 minute lookback. This leads me to believe there was a good chance the rule was executing when the cluster was upgraded...so looking at those logs: Last successful rule execution (as per Detection Engine Kibana logs) was at Looking at the So pretty safe to say this rule kept executing (or at least logging that it was) while ES was upgrading. @elastic/kibana-alerting-services, does this sound right to you? And if so, is there any chance this could result in similar issues to #101582 where the rule wouldn't be successfully migrated (although in this instance, without error)? Additionally, what is the expectation around enabled Rules and upgrades? Users shouldn't have to disable Rules prior to upgrading should they? In the meantime @mandeepkaur-qasource, could you please try to reproduce but this time disabling the rule prior to upgrading? Thanks! 🙂 |
Hi @spong We have validated this issue by de-activating the created custom rule before upgrading the 7.8.0 build to 7.14.0 and found that the below mentioned observation: Case 2 But, If user tries to Activate this rule after upgrading, than an error "Your visualization has error(s)" is getting displayed. Steps followed
Build Details: Thanks!! |
@spong Rules are not required to be disabled before upgrading. We have discovered while working on #101582 that any error that occurs during the rule/connector migration process (decrypting, migrating, encrypting) will be caught, logged, and the unmigrated document returned. However, since there are no errors being logged during upgrade, it doesn't seem like there are errors occuring during the migration. @mandeepkaur-qasource Can we get the rule document as it looked in 7.8 (either enabled or disabled) and how it looks in 7.14.0 after migration? Since the original document is from 7.8, all of our rule migrations (we have ones for 7.10, 7.11, 7.11.2 and 7.13) would be applied to the document in sequence so maybe something unexpected is happening during it. The error message looks like it's coming from |
Hi @ymao1, |
@mandeepkaur-qasource Can we get the documents from the |
@mandeepkaur-qasource you can get the documents from the
|
Hi @peluja1012, As requested, Please find all the related ndjsons files of exported Rules and documents that we got from the .kibana index using above mentioned steps from Kibana Dev Tools: Please Find the observations listed below Dev Tool: [7.8.0]``` GET .kibana*/_search { "query": { "match": { "_id": "alert:676c2dc4-ee78-4626-b074-a88536430877" } } } ``` Dev Tool Result on 7.8.0: Dev tool Result: [7.8.0]``` { "took" : 334, "timed_out" : false, "_shards" : { "total" : 3, "successful" : 3, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 0, "relation" : "eq" }, "max_score" : null, "hits" : [ ] } } ``` After upgrading the build from 7.8.0 to 7.14.0 please find the details fetched from Dev Tools console: Dev Tool command: [7.14.0]``` GET .kibana*/_search { "query": { "match": { "_id": "alert:676c2dc4-ee78-4626-b074-a88536430877" } } } ``` Dev Tool Result on 7.14.0: Dev tool Results on 7.14.0``` #! this request accesses system indices: [.kibana_1, .kibana_7.14.0_001, .kibana_security_session_1, .kibana_task_manager_1, .kibana_task_manager_7.14.0_001], but in a future major version, direct access to system indices will be prevented by default { "took" : 308, "timed_out" : false, "_shards" : { "total" : 7, "successful" : 7, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 0, "relation" : "eq" }, "max_score" : null, "hits" : [ ] } } ``` 7.8.0 Rule ndJson file: 7.14.0 Rule ndJson file: Thanks!! |
@mandeepkaur-qasource It looks like those rules are in a space named
Rules are stored in the .kibana index with id: |
Hi @ymao1 Yes, the rule was created with in a Space named as 'New'. Please Find the observations listed below 7.14.0 Rule ndJson file: 7.8.0 Dev Tool Results: 7.8.0 Dev Tool Results:
7.14.0 Dev Tool Results: 7.14.0 Dev Tool Results
Thanks!! |
@mandeepkaur-qasource @spong Thanks for supplying the alerting saved object! I have loaded it into our framework tests and confirmed that all alerting migrations (we have ones for 7.10, 7.11 and 7.13) run successfully with no errors. In addition, looking at the supplied 7.14 alerting saved object, I can confirm that migrations ran on this saved object as well. It seems like rules from 7.8 do not fill in the I see there is a security rule migration for 7.13. Perhaps there needed to be something in that migration that injected an empty array for author if author was undefined? |
@mandeepkaur-qasource is this happening just from 7.8 to 7.14? 7.10 to 7.14 works fine? thanks :) |
Thanks, @ymao1 for performing such a thorough investigation! I was not able to reproduce this issue when upgrading from 7.9 -> 7.13, from 7.10 -> 7.13, or from 7.12 ->7.13. I was only able to reproduce when upgrading from 7.8 -> 7.13. When upgrading from 7.18 -> 7.13, the reproduction steps are even simpler as you can see below:
I was also able to reproduce the rule execution error in the description of this issue by following these steps:
The workaround is to use the PATCH rule API to update each rule that has this issue. The payload of the PATCH call should set the
To fix this issue, I think we will need to add a migration that sets the |
…thor field by adding a migration for it (#107230) ## Summary Fixes #106233 During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as: ``` params invalid: Invalid value "undefined" supplied to "author" ``` This fixes that issue by adding a migration for the `author` field for `7.14.1`. See #106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…thor field by adding a migration for it (elastic#107230) ## Summary Fixes elastic#106233 During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as: ``` params invalid: Invalid value "undefined" supplied to "author" ``` This fixes that issue by adding a migration for the `author` field for `7.14.1`. See elastic#106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…thor field by adding a migration for it (elastic#107230) ## Summary Fixes elastic#106233 During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as: ``` params invalid: Invalid value "undefined" supplied to "author" ``` This fixes that issue by adding a migration for the `author` field for `7.14.1`. See elastic#106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…thor field by adding a migration for it (elastic#107230) ## Summary Fixes elastic#106233 During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as: ``` params invalid: Invalid value "undefined" supplied to "author" ``` This fixes that issue by adding a migration for the `author` field for `7.14.1`. See elastic#106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios # Conflicts: # x-pack/plugins/alerting/server/saved_objects/migrations.test.ts
…thor field by adding a migration for it (#107230) (#108218) ## Summary Fixes #106233 During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as: ``` params invalid: Invalid value "undefined" supplied to "author" ``` This fixes that issue by adding a migration for the `author` field for `7.14.1`. See #106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Frank Hassanabad <[email protected]>
… for author field by adding a migration for it (#107230) (#108221) * [Security Solutions][Detection Engine] Fixes "undefined" crash for author field by adding a migration for it (#107230) ## Summary Fixes #106233 During an earlier upgrade/fix to our system to add defaults to our types, we overlooked the "author" field which wasn't part of the original rules. Users upgrading might get errors such as: ``` params invalid: Invalid value "undefined" supplied to "author" ``` This fixes that issue by adding a migration for the `author` field for `7.14.1`. See #106233 for test instructions or manually remove your author field before upgrading your release and then upgrade and this should be fixed on upgrade. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios # Conflicts: # x-pack/plugins/alerting/server/saved_objects/migrations.test.ts * Fixed merge mistakes as the two test versions are very different * Fixes another area where the backport system is very different
@mandeepkaur-qasource Could you please validate this in the first BC for 7.15? We merged this PR to fix it #107230 |
@deepikakeshav-qasource @karanbirsingh-qasource can you please check if this is still happening on 7.15BC1? thanks |
Hi @MadameSheema , We have validated this ticket on 7.15.0 BC1 build and observed that issue is Fixed. No error is displyaing when activate and deactivate the rule after upgrade the build from 7.8.0 to 7.15.0 Build Details:
Screenshot: Hence, we are closing this issue and marking as QA Validated. Thanks!! |
Description:
An error "Rule failure" is getting displayed on Rule detail page.
Build Details:
Version: 7.14.0 BC3
Build: 42545
Commit: c314921
Artifact link: https://staging.elastic.co/7.14.0-682a8012/summary-7.14.0.html
Browser Details:
All
Preconditions:
Steps to Reproduce:
GET .<_index_name>/_mapping/field/signal.rule.risk_score i.e
Screen Shot
Actual Result:
An error "Rule failure" is getting displayed on Rule detail page.
Reason: unknown Message: params invalid: Invalid value "undefined" supplied to "author"
Expected Result:
No error should be displayed on clicking at Rule name
What's not working:
What's working:
The text was updated successfully, but these errors were encountered: