-
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
Watcher simulate returns a blank page when watcher execute API returns no execution result #177745
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Watcher
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Comments
jguay
added
bug
Fixes for quality problems that affect the customer experience
Feature:Watcher
labels
Feb 23, 2024
lukasolson
added
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
and removed
needs-team
Issues missing a team label
labels
Mar 4, 2024
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
Same error on Kibana 8.10.4 |
Same blank screen and error appears on null pointer exceptions in the condition script execution, in Kibana v 8.11.4 |
ElenaStoeva
added a commit
that referenced
this issue
Mar 6, 2024
Fixes #177745 ## Summary This PR fixes the bug in the simulate flyout which caused a blank page when the watch execution returns no execution result. It also adds a check for whether there is an execution result with the condition property and only then displays the condition status under the title. **How to test:** 1. Go to Stack Management -> Watcher 2. Start creating an advanced watch. 3. Add the following json in the editor (it contains an invalid `interval` property in the `date_histogram` parameter): ``` { "trigger": { "schedule": { "interval": "10m" } }, "input": { "search": { "request": { "search_type": "query_then_fetch", "indices": [ "test*" ], "rest_total_hits_as_int": true, "body": { "size": "0", "query": { "match_all": {} }, "aggs": { "dateHistogram": { "date_histogram": { "field": "@timestamp", "interval": "1m" } } } } } } }, "condition": { "always": {} }, "actions": {} } ``` 5. Click on the "Simulate" tab and then the "Simulate" button. 6. Verify the page doesn't crash and no condition met status is displayed since the watch execution failed. 7. Start creating a new advanced watch, this time use the already provided json, which is valid. 8. Click on Simulate and verify that the Condition met status is displayed correctly - you can change the `condition.compare.ctx.payload.hits.total.gte` property in the json to `0` in order to see a "Condition met" status.
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Mar 6, 2024
Fixes elastic#177745 ## Summary This PR fixes the bug in the simulate flyout which caused a blank page when the watch execution returns no execution result. It also adds a check for whether there is an execution result with the condition property and only then displays the condition status under the title. **How to test:** 1. Go to Stack Management -> Watcher 2. Start creating an advanced watch. 3. Add the following json in the editor (it contains an invalid `interval` property in the `date_histogram` parameter): ``` { "trigger": { "schedule": { "interval": "10m" } }, "input": { "search": { "request": { "search_type": "query_then_fetch", "indices": [ "test*" ], "rest_total_hits_as_int": true, "body": { "size": "0", "query": { "match_all": {} }, "aggs": { "dateHistogram": { "date_histogram": { "field": "@timestamp", "interval": "1m" } } } } } } }, "condition": { "always": {} }, "actions": {} } ``` 5. Click on the "Simulate" tab and then the "Simulate" button. 6. Verify the page doesn't crash and no condition met status is displayed since the watch execution failed. 7. Start creating a new advanced watch, this time use the already provided json, which is valid. 8. Click on Simulate and verify that the Condition met status is displayed correctly - you can change the `condition.compare.ctx.payload.hits.total.gte` property in the json to `0` in order to see a "Condition met" status. (cherry picked from commit be634a3)
kibanamachine
referenced
this issue
Mar 6, 2024
# Backport This will backport the following commits from `main` to `8.13`: - [[Watcher] Fix simulate flyout blank page (#178016)](#178016) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Elena Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-03-06T20:18:52Z","message":"[Watcher] Fix simulate flyout blank page (#178016)\n\nFixes https://github.com/elastic/kibana/issues/177745\r\n\r\n## Summary\r\n\r\nThis PR fixes the bug in the simulate flyout which caused a blank page\r\nwhen the watch execution returns no execution result. It also adds a\r\ncheck for whether there is an execution result with the condition\r\nproperty and only then displays the condition status under the title.\r\n\r\n**How to test:**\r\n\r\n1. Go to Stack Management -> Watcher\r\n2. Start creating an advanced watch.\r\n3. Add the following json in the editor (it contains an invalid\r\n`interval` property in the `date_histogram` parameter):\r\n```\r\n{\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"interval\": \"10m\"\r\n }\r\n },\r\n \"input\": {\r\n \"search\": {\r\n \"request\": {\r\n \"search_type\": \"query_then_fetch\",\r\n \"indices\": [\r\n \"test*\"\r\n ],\r\n \"rest_total_hits_as_int\": true,\r\n \"body\": {\r\n \"size\": \"0\",\r\n \"query\": {\r\n \"match_all\": {}\r\n },\r\n \"aggs\": {\r\n \"dateHistogram\": {\r\n \"date_histogram\": {\r\n \"field\": \"@timestamp\",\r\n \"interval\": \"1m\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"condition\": {\r\n \"always\": {}\r\n },\r\n \"actions\": {}\r\n}\r\n```\r\n5. Click on the \"Simulate\" tab and then the \"Simulate\" button.\r\n6. Verify the page doesn't crash and no condition met status is\r\ndisplayed since the watch execution failed.\r\n7. Start creating a new advanced watch, this time use the already\r\nprovided json, which is valid.\r\n8. Click on Simulate and verify that the Condition met status is\r\ndisplayed correctly - you can change the\r\n`condition.compare.ctx.payload.hits.total.gte` property in the json to\r\n`0` in order to see a \"Condition met\" status.","sha":"be634a33368e962596fcb144c06c27d31be3c15d","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Watcher","Team:Deployment Management","release_note:skip","backport:prev-minor","v8.13.0","v8.14.0"],"title":"[Watcher] Fix simulate flyout blank page","number":178016,"url":"https://github.com/elastic/kibana/pull/178016","mergeCommit":{"message":"[Watcher] Fix simulate flyout blank page (#178016)\n\nFixes https://github.com/elastic/kibana/issues/177745\r\n\r\n## Summary\r\n\r\nThis PR fixes the bug in the simulate flyout which caused a blank page\r\nwhen the watch execution returns no execution result. It also adds a\r\ncheck for whether there is an execution result with the condition\r\nproperty and only then displays the condition status under the title.\r\n\r\n**How to test:**\r\n\r\n1. Go to Stack Management -> Watcher\r\n2. Start creating an advanced watch.\r\n3. Add the following json in the editor (it contains an invalid\r\n`interval` property in the `date_histogram` parameter):\r\n```\r\n{\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"interval\": \"10m\"\r\n }\r\n },\r\n \"input\": {\r\n \"search\": {\r\n \"request\": {\r\n \"search_type\": \"query_then_fetch\",\r\n \"indices\": [\r\n \"test*\"\r\n ],\r\n \"rest_total_hits_as_int\": true,\r\n \"body\": {\r\n \"size\": \"0\",\r\n \"query\": {\r\n \"match_all\": {}\r\n },\r\n \"aggs\": {\r\n \"dateHistogram\": {\r\n \"date_histogram\": {\r\n \"field\": \"@timestamp\",\r\n \"interval\": \"1m\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"condition\": {\r\n \"always\": {}\r\n },\r\n \"actions\": {}\r\n}\r\n```\r\n5. Click on the \"Simulate\" tab and then the \"Simulate\" button.\r\n6. Verify the page doesn't crash and no condition met status is\r\ndisplayed since the watch execution failed.\r\n7. Start creating a new advanced watch, this time use the already\r\nprovided json, which is valid.\r\n8. Click on Simulate and verify that the Condition met status is\r\ndisplayed correctly - you can change the\r\n`condition.compare.ctx.payload.hits.total.gte` property in the json to\r\n`0` in order to see a \"Condition met\" status.","sha":"be634a33368e962596fcb144c06c27d31be3c15d"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/178016","number":178016,"mergeCommit":{"message":"[Watcher] Fix simulate flyout blank page (#178016)\n\nFixes https://github.com/elastic/kibana/issues/177745\r\n\r\n## Summary\r\n\r\nThis PR fixes the bug in the simulate flyout which caused a blank page\r\nwhen the watch execution returns no execution result. It also adds a\r\ncheck for whether there is an execution result with the condition\r\nproperty and only then displays the condition status under the title.\r\n\r\n**How to test:**\r\n\r\n1. Go to Stack Management -> Watcher\r\n2. Start creating an advanced watch.\r\n3. Add the following json in the editor (it contains an invalid\r\n`interval` property in the `date_histogram` parameter):\r\n```\r\n{\r\n \"trigger\": {\r\n \"schedule\": {\r\n \"interval\": \"10m\"\r\n }\r\n },\r\n \"input\": {\r\n \"search\": {\r\n \"request\": {\r\n \"search_type\": \"query_then_fetch\",\r\n \"indices\": [\r\n \"test*\"\r\n ],\r\n \"rest_total_hits_as_int\": true,\r\n \"body\": {\r\n \"size\": \"0\",\r\n \"query\": {\r\n \"match_all\": {}\r\n },\r\n \"aggs\": {\r\n \"dateHistogram\": {\r\n \"date_histogram\": {\r\n \"field\": \"@timestamp\",\r\n \"interval\": \"1m\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"condition\": {\r\n \"always\": {}\r\n },\r\n \"actions\": {}\r\n}\r\n```\r\n5. Click on the \"Simulate\" tab and then the \"Simulate\" button.\r\n6. Verify the page doesn't crash and no condition met status is\r\ndisplayed since the watch execution failed.\r\n7. Start creating a new advanced watch, this time use the already\r\nprovided json, which is valid.\r\n8. Click on Simulate and verify that the Condition met status is\r\ndisplayed correctly - you can change the\r\n`condition.compare.ctx.payload.hits.total.gte` property in the json to\r\n`0` in order to see a \"Condition met\" status.","sha":"be634a33368e962596fcb144c06c27d31be3c15d"}}]}] BACKPORT--> Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
Same error is kibana v8.12.2 |
Hi @chamakaleprattik this should be fixed as of 8.13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Watcher
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Could not find if this 8.12 bug was known already (not reproducible in 7.17)
Kibana version:
8.12.1
Elasticsearch version:
8.12.1
Original install method (e.g. download page, yum, from source, etc.):
docker
Describe the bug:
When watcher execute fails, a blank page appear with javascript error because
.watchHistoryItem.details.result.condition.met
field does not exist in response from watcher execute APISteps to reproduce:
interval
from watcher UIJavascript console shows clear cause :
And network tab shows request
PUT kbn:/api/watcher/watch/execute
returned this output with a200
response code (there is nomet
field anywhere in the output from elasticsearch watcher execute API in this case because in this case the dateHistogram useinterval
which was deprecated in 7.2 and removed from 8.0)As note in 7.17 replacing
interval
withunknownparameter
, watcher simulate UI in Kibana worked correctly returning the output of elasticsearch (no blank page and no javascript error)Expected behavior:
Report some error in UI to improve handling of
"execution_state": "failed"
when.watchHistoryItem.details.result.condition.met
is not in response bodyScreenshots (if relevant):
The text was updated successfully, but these errors were encountered: