Skip to content

[7.x] [Metrics UI] Fix fatal error when no data is available for Metric Threshold Alerts (#68678)#68758

Merged
simianhacker merged 1 commit intoelastic:7.xfrom
simianhacker:backport/7.x/pr-68678
Jun 10, 2020
Merged

[7.x] [Metrics UI] Fix fatal error when no data is available for Metric Threshold Alerts (#68678)#68758
simianhacker merged 1 commit intoelastic:7.xfrom
simianhacker:backport/7.x/pr-68678

Conversation

@simianhacker
Copy link
Copy Markdown
Member

Backports the following commits to 7.x:

…eshold Alerts (elastic#68678)

* [Metrics UI] Fix fatal error when no data is available for Metric
Threshold Alerts

* Adding i18n support for error message

* Adding test
@simianhacker simianhacker added the backport This PR is a backport of another PR label Jun 10, 2020
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/canvas/custom_elements·ts.Canvas app custom elements adds the custom element to the workpad when prompted

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 6 times on tracked branches: https://github.com/elastic/kibana/issues/63339

[00:00:00]       │
[00:01:26]         └-: Canvas app
[00:01:26]           └-> "before all" hook
[00:02:20]           └-: custom elements
[00:02:20]             └-> "before all" hook
[00:02:20]             └-> "before all" hook
[00:02:20]               │ info [logstash_functional] Loading "mappings.json"
[00:02:20]               │ info [logstash_functional] Loading "data.json.gz"
[00:02:20]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.22"
[00:02:20]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.20"
[00:02:20]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.21"
[00:02:22]               │ info [canvas/default] Loading "mappings.json"
[00:02:22]               │ info [canvas/default] Loading "data.json.gz"
[00:02:22]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_2/-w_Du4qHQt61hpWI_M_99w] deleting index
[00:02:22]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_1/aLTZYybjR6iBWwqG392fNw] deleting index
[00:02:22]               │ info [canvas/default] Deleted existing index [".kibana_2",".kibana_1"]
[00:02:22]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:02:22]               │ info [canvas/default] Created index ".kibana_1"
[00:02:22]               │ debg [canvas/default] ".kibana_1" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:02:22]               │ info [canvas/default] Indexed 3 docs into ".kibana_1"
[00:02:22]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_1/utm_kVBgQaieL9q1hV9doA] update_mapping [_doc]
[00:02:22]               │ debg Migrating saved objects
[00:02:23]               │ proc [kibana]   log   [13:35:48.760] [info][savedobjects-service] Creating index .kibana_2.
[00:02:23]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:02:23]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] updating number_of_replicas to [0] for indices [.kibana_2]
[00:02:23]               │ proc [kibana]   log   [13:35:48.879] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:02:23]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_2/pk0DVuidRQabn3LugOdrTQ] update_mapping [_doc]
[00:02:23]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-oraclelinux-tests-xl-1591793469918743351] [.kibana_2/pk0DVuidRQabn3LugOdrTQ] update_mapping [_doc]
[00:02:24]               │ proc [kibana]   log   [13:35:49.021] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:02:24]               │ proc [kibana]   log   [13:35:49.103] [info][savedobjects-service] Finished in 346ms.
[00:02:24]               │ debg navigating to canvas url: http://localhost:6131/app/canvas#/
[00:02:24]               │ debg navigate to: http://localhost:6131/app/canvas#/
[00:02:24]               │ debg browser[INFO] http://localhost:6131/app/canvas?_t=1591796149129#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:02:24]               │
[00:02:24]               │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:24]               │ debg ... sleep(700) start
[00:02:25]               │ debg ... sleep(700) end
[00:02:25]               │ debg returned from get, calling refresh
[00:02:27]               │ debg browser[INFO] http://localhost:6131/32320/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:35:50Z
[00:02:27]               │        Adding connection to http://localhost:6131/elasticsearch
[00:02:27]               │
[00:02:27]               │      "
[00:02:27]               │ERROR browser[SEVERE] http://localhost:6131/32320/bundles/core/core.entry.js 75:173126 TypeError: Failed to fetch
[00:02:27]               │          at Fetch._callee3$ (http://localhost:6131/32320/bundles/core/core.entry.js:26:69024)
[00:02:27]               │          at l (http://localhost:6131/32320/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:974701)
[00:02:27]               │          at Generator._invoke (http://localhost:6131/32320/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:974454)
[00:02:27]               │          at Generator.forEach.e.<computed> [as throw] (http://localhost:6131/32320/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:975058)
[00:02:27]               │          at fetch_asyncGeneratorStep (http://localhost:6131/32320/bundles/core/core.entry.js:26:63428)
[00:02:27]               │          at _throw (http://localhost:6131/32320/bundles/core/core.entry.js:26:63836)
[00:02:27]               │ debg browser[INFO] http://localhost:6131/app/canvas?_t=1591796149129#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:02:27]               │
[00:02:27]               │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:27]               │ debg browser[INFO] http://localhost:6131/32320/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:35:52Z
[00:02:27]               │        Adding connection to http://localhost:6131/elasticsearch
[00:02:27]               │
[00:02:27]               │      "
[00:02:27]               │ debg currentUrl = http://localhost:6131/app/canvas#/
[00:02:27]               │          appUrl = http://localhost:6131/app/canvas#/
[00:02:27]               │ debg TestSubjects.find(kibanaChrome)
[00:02:27]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:02:27]               │ debg ... sleep(501) start
[00:02:28]               │ debg ... sleep(501) end
[00:02:28]               │ debg in navigateTo url = http://localhost:6131/app/canvas#/
[00:02:28]               │ debg TestSubjects.exists(statusPageContainer)
[00:02:28]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:02:30]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:02:31]               │ debg navigating to canvas url: http://localhost:6131/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:02:31]               │ debg navigate to: http://localhost:6131/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:02:31]               │ debg browser[INFO] http://localhost:6131/app/canvas?_t=1591796156464#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:02:31]               │
[00:02:31]               │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:31]               │ debg ... sleep(700) start
[00:02:32]               │ debg ... sleep(700) end
[00:02:32]               │ debg returned from get, calling refresh
[00:02:33]               │ debg browser[INFO] http://localhost:6131/app/canvas?_t=1591796156464#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:02:33]               │
[00:02:33]               │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:33]               │ debg currentUrl = http://localhost:6131/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:02:33]               │          appUrl = http://localhost:6131/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:02:33]               │ debg TestSubjects.find(kibanaChrome)
[00:02:33]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:02:34]               │ debg browser[INFO] http://localhost:6131/32320/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:35:58Z
[00:02:34]               │        Adding connection to http://localhost:6131/elasticsearch
[00:02:34]               │
[00:02:34]               │      "
[00:02:34]               │ debg ... sleep(501) start
[00:02:34]               │ debg ... sleep(501) end
[00:02:34]               │ debg in navigateTo url = http://localhost:6131/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:02:34]               │ debg TestSubjects.exists(statusPageContainer)
[00:02:34]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:02:37]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:02:38]             └-> creates a custom element from an element when prompted
[00:02:38]               └-> "before each" hook: global before each
[00:02:38]               │ debg TestSubjects.click(canvasWorkpadPage > canvasWorkpadPageElementContent)
[00:02:38]               │ debg Find.clickByCssSelector('[data-test-subj="canvasWorkpadPage"] [data-test-subj="canvasWorkpadPageElementContent"]') with timeout=20000
[00:02:38]               │ debg Find.findByCssSelector('[data-test-subj="canvasWorkpadPage"] [data-test-subj="canvasWorkpadPageElementContent"]') with timeout=20000
[00:02:38]               │ debg TestSubjects.click(canvasWorkpadEditMenuButton)
[00:02:38]               │ debg Find.clickByCssSelector('[data-test-subj="canvasWorkpadEditMenuButton"]') with timeout=20000
[00:02:38]               │ debg Find.findByCssSelector('[data-test-subj="canvasWorkpadEditMenuButton"]') with timeout=20000
[00:02:38]               │ debg TestSubjects.click(canvasWorkpadEditMenu__saveElementButton)
[00:02:38]               │ debg Find.clickByCssSelector('[data-test-subj="canvasWorkpadEditMenu__saveElementButton"]') with timeout=20000
[00:02:38]               │ debg Find.findByCssSelector('[data-test-subj="canvasWorkpadEditMenu__saveElementButton"]') with timeout=20000
[00:02:38]               │ debg TestSubjects.setValue(canvasCustomElementForm-name, My New Element)
[00:02:38]               │ debg TestSubjects.click(canvasCustomElementForm-name)
[00:02:38]               │ debg Find.clickByCssSelector('[data-test-subj="canvasCustomElementForm-name"]') with timeout=10000
[00:02:38]               │ debg Find.findByCssSelector('[data-test-subj="canvasCustomElementForm-name"]') with timeout=10000
[00:02:39]               │ debg TestSubjects.setValue(canvasCustomElementForm-description, An excellent new element)
[00:02:39]               │ debg TestSubjects.click(canvasCustomElementForm-description)
[00:02:39]               │ debg Find.clickByCssSelector('[data-test-subj="canvasCustomElementForm-description"]') with timeout=10000
[00:02:39]               │ debg Find.findByCssSelector('[data-test-subj="canvasCustomElementForm-description"]') with timeout=10000
[00:02:40]               │ debg TestSubjects.click(canvasCustomElementForm-submit)
[00:02:40]               │ debg Find.clickByCssSelector('[data-test-subj="canvasCustomElementForm-submit"]') with timeout=10000
[00:02:40]               │ debg Find.findByCssSelector('[data-test-subj="canvasCustomElementForm-submit"]') with timeout=10000
[00:02:40]               │ debg TestSubjects.exists(canvasCustomElementCreate-success)
[00:02:40]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="canvasCustomElementCreate-success"]') with timeout=30000
[00:02:40]               │ debg --- retry.tryForTime error: [data-test-subj="canvasCustomElementCreate-success"] is not displayed
[00:02:41]               └- ✓ pass  (3.4s) "Canvas app custom elements creates a custom element from an element when prompted"
[00:02:41]             └-> adds the custom element to the workpad when prompted
[00:02:41]               └-> "before each" hook: global before each
[00:02:41]               │ debg TestSubjects.click(add-element-button)
[00:02:41]               │ debg Find.clickByCssSelector('[data-test-subj="add-element-button"]') with timeout=10000
[00:02:41]               │ debg Find.findByCssSelector('[data-test-subj="add-element-button"]') with timeout=10000
[00:02:41]               │ debg TestSubjects.click(saved-elements-menu-option)
[00:02:41]               │ debg Find.clickByCssSelector('[data-test-subj="saved-elements-menu-option"]') with timeout=10000
[00:02:41]               │ debg Find.findByCssSelector('[data-test-subj="saved-elements-menu-option"]') with timeout=10000
[00:02:41]               │ debg Find.findByCssSelector('.canvasElementCard__wrapper') with timeout=10000
[00:02:41]               │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/Canvas app custom elements adds the custom element to the workpad when prompted.png"
[00:02:42]               │ info Current URL is: http://localhost:6131/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:02:42]               │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/Canvas app custom elements adds the custom element to the workpad when prompted.html
[00:02:42]               └- ✖ fail: "Canvas app custom elements adds the custom element to the workpad when prompted"
[00:02:42]               │

Stack Trace

Error: expected '' to contain 'My New Element'
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.contain (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:442:10)
    at Context.it (test/functional/apps/canvas/custom_elements.ts:68:53)
    at process._tickCallback (internal/process/next_tick.js:68:7)

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@simianhacker simianhacker merged commit 8e3b5d9 into elastic:7.x Jun 10, 2020
@simianhacker simianhacker deleted the backport/7.x/pr-68678 branch April 17, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants