Skip to content
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

Tag invalid objects instead of failing migrations #64885

Closed
wants to merge 3 commits into from

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Apr 30, 2020

Summary

Implements step 1 from #55406

TODO:

  • Handle Corrupt Saved Object documents can cause a migration every time Kibana starts up #65612 "corrupt" documents, these should never trigger a migration.
  • Bump the migrationVersion number of invalid documents. To fix a bug in a migration transform function requires bumping the version of that transform e.g. {7.6.1: migrationTransformBuggyFn} -> {7.6.2: migrationTransformFixedFn}
  • Expose a way to export invalid objects
  • Don't include invalid/corrupt documents when checking for outdated documents that require migrations.

Open questions:

  • Assuming a migration function chain like migrate711 -> migrate730 -> migrate760. If there's a bug in migrate711 how do we release a fix so that invalid documents are automatically recovered in future versions?
    1. Fix migrate711 and then release a new no-op migration like migrateNoop761. 👎 Causes a migration for all users even if they don't have invalid data.
    2. Release a fixInvalid761 that only matches migrationVersion of invalid documents. Unclear exactly how this would work. For now, set {migrationVersion: {['invalid:'+type]: ${currentKibanaVersion}}}

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects v8.0.0 labels Apr 30, 2020
@rudolf rudolf self-assigned this Apr 30, 2020
@rudolf rudolf added this to Pending Review in kibana-core [DEPRECATED] via automation Apr 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@joshdover joshdover moved this from Pending Review to In Progress in kibana-core [DEPRECATED] Apr 30, 2020
Comment on lines 166 to 169
valid: {
type: 'boolean',
},
invalid_attributes: {
enabled: false, // Don't index invalid attributes
type: 'object',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we nest all these new fields into a single nested field such as migration or status ? It may be a little cleaner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been thinking about this, it feels like something as important as the status: 'invalid' | 'corrupt' | 'valid' should be at the top-level rather than hidden under another layer.

@rudolf
Copy link
Contributor Author

rudolf commented May 28, 2020

I found the ignore_malformed mappings option today which seems like a good fit for dealing with these "dangerous" invalid or corrupt objects that might not match our mappings. The downside to using this is that we loose the only bit of validation we had on the saved objects HTTP API for attributes and we can't use it with all field types https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html

@joshdover
Copy link
Contributor

I found the ignore_malformed mappings option today which seems like a good fit for dealing with these "dangerous" invalid or corrupt objects that might not match our mappings. The downside to using this is that we loose the only bit of validation we had on the saved objects HTTP API for attributes and we can't use it with all field types elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html

That does sound useful. I wonder how much work it really would be to define schema (with kbn/config-schema) for all SO types.

@pgayvallet
Copy link
Contributor

That does sound useful. I wonder how much work it really would be to define schema (with kbn/config-schema) for all SO types.

You're thinking about automated schema generation from the mapping, or manual schema definition by the owners here?

@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/rollup_job/tsvb·js.rollup app tsvb integration create rollup tsvb

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:20:06]         └-: rollup app
[00:20:06]           └-> "before all" hook
[00:21:07]           └-: tsvb integration
[00:21:07]             └-> "before all" hook
[00:21:07]             └-> "before all" hook
[00:21:07]               │ info [visualize/default] Loading "mappings.json"
[00:21:07]               │ info [visualize/default] Loading "data.json"
[00:21:07]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_1/vfBzY2OMSISi0noaN2CmhQ] deleting index
[00:21:07]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/BrBBtNudTaK-TJTSW3EV6Q] deleting index
[00:21:07]               │ info [visualize/default] Deleted existing index [".kibana_2",".kibana_1"]
[00:21:07]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:21:07]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana][0]]])." previous.health="YELLOW" reason="shards started [[.kibana][0]]"
[00:21:07]               │ info [visualize/default] Created index ".kibana"
[00:21:07]               │ debg [visualize/default] ".kibana" settings {"index":{"number_of_shards":"1","auto_expand_replicas":"0-1","number_of_replicas":"0"}}
[00:21:07]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [metricbeat-7] creating index, cause [auto(bulk api)], templates [], shards [1]/[1], mappings []
[00:21:07]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [metricbeat-7/d78HlpW_SAu32gbovx4VtQ] create_mapping
[00:21:07]               │ info [visualize/default] Indexed 8 docs into ".kibana"
[00:21:07]               │ info [visualize/default] Indexed 1 docs into "metricbeat-7"
[00:21:07]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana/LBZFFNg4RyePJciLaL1oeQ] update_mapping [_doc]
[00:21:07]               │ debg Migrating saved objects
[00:21:07]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana/LBZFFNg4RyePJciLaL1oeQ] update_mapping [_doc]
[00:21:08]               │ proc [kibana]   log   [13:42:57.664] [info][savedobjects-service] Creating index .kibana_2.
[00:21:08]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:21:08]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] updating number_of_replicas to [0] for indices [.kibana_2]
[00:21:08]               │ proc [kibana]   log   [13:42:57.741] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:21:08]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:21:08]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] updating number_of_replicas to [0] for indices [.kibana_1]
[00:21:08]               │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] 84139 finished with response BulkByScrollResponse[took=110ms,timed_out=false,sliceId=null,updated=0,created=9,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:21:09]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana/LBZFFNg4RyePJciLaL1oeQ] deleting index
[00:21:09]               │ proc [kibana]   log   [13:42:58.110] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:21:09]               │ proc [kibana]   log   [13:42:58.123] [warning][savedobjects-service] marking object as corrupt please contact support
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/D-Zo582TRY2Y8y71Vhs-uQ] update_mapping [_doc]
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/D-Zo582TRY2Y8y71Vhs-uQ] update_mapping [_doc]
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/D-Zo582TRY2Y8y71Vhs-uQ] update_mapping [_doc]
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/D-Zo582TRY2Y8y71Vhs-uQ] update_mapping [_doc]
[00:21:09]               │ proc [kibana]   log   [13:42:58.358] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:21:09]               │ proc [kibana]   log   [13:42:58.430] [info][savedobjects-service] Finished in 767ms.
[00:21:09]               │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/D-Zo582TRY2Y8y71Vhs-uQ] update_mapping [_doc]
[00:21:09]             └-> create rollup tsvb
[00:21:09]               └-> "before each" hook: global before each
[00:21:09]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-source-data] creating index, cause [auto(bulk api)], templates [], shards [1]/[1], mappings []
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-source-data/bqiPep3nREuTkdezGPo4zQ] create_mapping
[00:21:09]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-target-data] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:21:09]               │ debg navigating to visualize url: http://localhost:6121/app/visualize#/
[00:21:09]               │ debg navigate to: http://localhost:6121/app/visualize#/
[00:21:09]               │ info [o.e.x.r.j.RollupJobTask] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] Rollup job [tsvb-test-rollup-job-1591795308148] created.
[00:21:09]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-target-data/vPvOfUwbT_WWxiLF4T1-OQ] update_mapping [_doc]
[00:21:10]               │ debg browser[INFO] http://localhost:6121/app/visualize?_t=1591796578928#/ 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:21:10]               │
[00:21:10]               │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:10]               │ debg ... sleep(700) start
[00:21:10]               │ debg ... sleep(700) end
[00:21:10]               │ debg returned from get, calling refresh
[00:21:11]               │ debg browser[INFO] http://localhost:6121/app/visualize?_t=1591796578928#/ 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:21:11]               │
[00:21:11]               │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:11]               │ debg currentUrl = http://localhost:6121/app/visualize#/
[00:21:11]               │          appUrl = http://localhost:6121/app/visualize#/
[00:21:11]               │ debg TestSubjects.find(kibanaChrome)
[00:21:11]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:21:13]               │ debg browser[INFO] http://localhost:6121/33723/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:43:02Z
[00:21:13]               │        Adding connection to http://localhost:6121/elasticsearch
[00:21:13]               │
[00:21:13]               │      "
[00:21:13]               │ debg ... sleep(501) start
[00:21:13]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/D-Zo582TRY2Y8y71Vhs-uQ] update_mapping [_doc]
[00:21:13]               │ debg ... sleep(501) end
[00:21:13]               │ debg in navigateTo url = http://localhost:6121/app/visualize#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:21:13]               │ debg --- retry.try error: URL changed, waiting for it to settle
[00:21:14]               │ debg ... sleep(501) start
[00:21:14]               │ debg ... sleep(501) end
[00:21:14]               │ debg in navigateTo url = http://localhost:6121/app/visualize#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:21:14]               │ debg TestSubjects.exists(statusPageContainer)
[00:21:14]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:21:17]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:21:17]               │ debg TestSubjects.exists(newItemButton)
[00:21:17]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="newItemButton"]') with timeout=2500
[00:21:18]               │ debg TestSubjects.click(newItemButton)
[00:21:18]               │ debg Find.clickByCssSelector('[data-test-subj="newItemButton"]') with timeout=10000
[00:21:18]               │ debg Find.findByCssSelector('[data-test-subj="newItemButton"]') with timeout=10000
[00:21:18]               │ debg TestSubjects.find(visNewDialogTypes)
[00:21:18]               │ debg Find.findByCssSelector('[data-test-subj="visNewDialogTypes"]') with timeout=10000
[00:21:18]               │ debg TestSubjects.click(visType-metrics)
[00:21:18]               │ debg Find.clickByCssSelector('[data-test-subj="visType-metrics"]') with timeout=10000
[00:21:18]               │ debg Find.findByCssSelector('[data-test-subj="visType-metrics"]') with timeout=10000
[00:21:18]               │ debg isGlobalLoadingIndicatorVisible
[00:21:18]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:21:18]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:21:18]               │ debg browser[INFO] http://localhost:6121/app/visualize#/create?type=metrics 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:21:18]               │
[00:21:18]               │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:20]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:21:20]               │ debg browser[INFO] http://localhost:6121/33723/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:43:09Z
[00:21:20]               │        Adding connection to http://localhost:6121/elasticsearch
[00:21:20]               │
[00:21:20]               │      "
[00:21:20]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:21:20]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:21:20]               │ debg TestSubjects.exists(tvbVisEditor)
[00:21:20]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="tvbVisEditor"]') with timeout=10000
[00:21:21]               │ debg TestSubjects.find(metricTsvbTypeBtn)
[00:21:21]               │ debg Find.findByCssSelector('[data-test-subj="metricTsvbTypeBtn"]') with timeout=10000
[00:21:21]               │ debg TestSubjects.exists(tsvbMetricValue)
[00:21:21]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="tsvbMetricValue"]') with timeout=10000
[00:21:24]               │ debg --- retry.tryForTime error: [data-test-subj="tsvbMetricValue"] is not displayed
[00:21:27]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:30]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:33]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:33]               │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/rollup app tsvb integration create rollup tsvb.png"
[00:21:34]               │ info Current URL is: http://localhost:6121/app/visualize#/create?type=metrics&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(filters:!(),linked:!f,query:(language:kuery,query:%27%27),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_position:left,axis_scale:normal,background_color_rules:!((id:%2752d1dd50-ab20-11ea-9a9e-15c06835e2c2%27)),default_index_pattern:%27metricbeat-*%27,default_timefield:%27@timestamp%27,id:%2761ca57f0-469d-11e7-af02-69e470af7417%27,index_pattern:%27%27,interval:%27%27,isModelInvalid:!f,series:!((axis_position:right,chart_type:line,color:%2368BC00,fill:0.5,formatter:number,id:%2761ca57f1-469d-11e7-af02-69e470af7417%27,line_width:1,metrics:!((id:%2761ca57f2-469d-11e7-af02-69e470af7417%27,type:count)),point_size:1,separate_axis:0,split_color_mode:kibana,split_mode:everything,stacked:none)),show_grid:1,show_legend:1,time_field:%27%27,tooltip_mode:show_all,type:metric),title:%27%27,type:metrics))
[00:21:34]               │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/rollup app tsvb integration create rollup tsvb.html
[00:21:34]               └- ✖ fail: "rollup app tsvb integration create rollup tsvb"
[00:21:34]               │

Stack Trace

Error: TSVB Metric tab is not loaded
    at VisualBuilderPage.checkTabIsLoaded (/dev/shm/workspace/kibana/test/functional/page_objects/visual_builder_page.ts:61:15)

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/rollup_job/tsvb·js.rollup app tsvb integration create rollup tsvb

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:20:27]         └-: rollup app
[00:20:27]           └-> "before all" hook
[00:21:26]           └-: tsvb integration
[00:21:26]             └-> "before all" hook
[00:21:26]             └-> "before all" hook
[00:21:26]               │ info [visualize/default] Loading "mappings.json"
[00:21:26]               │ info [visualize/default] Loading "data.json"
[00:21:26]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_1/VNMWMoVpQN24GvYwSzBAlw] deleting index
[00:21:26]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/8plnYrutQuaKVCyAVqxK1A] deleting index
[00:21:26]               │ info [visualize/default] Deleted existing index [".kibana_2",".kibana_1"]
[00:21:26]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:21:26]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana][0]]])." previous.health="YELLOW" reason="shards started [[.kibana][0]]"
[00:21:26]               │ info [visualize/default] Created index ".kibana"
[00:21:26]               │ debg [visualize/default] ".kibana" settings {"index":{"number_of_shards":"1","auto_expand_replicas":"0-1","number_of_replicas":"0"}}
[00:21:26]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [metricbeat-7] creating index, cause [auto(bulk api)], templates [], shards [1]/[1], mappings []
[00:21:26]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [metricbeat-7/h2jxKYbxRRyNx7vvMTe7xA] create_mapping
[00:21:26]               │ info [visualize/default] Indexed 8 docs into ".kibana"
[00:21:26]               │ info [visualize/default] Indexed 1 docs into "metricbeat-7"
[00:21:26]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana/IYaU2aK_QhaT0c_vFSiZPA] update_mapping [_doc]
[00:21:26]               │ debg Migrating saved objects
[00:21:26]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana/IYaU2aK_QhaT0c_vFSiZPA] update_mapping [_doc]
[00:21:27]               │ proc [kibana]   log   [13:18:46.281] [info][savedobjects-service] Creating index .kibana_2.
[00:21:27]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:21:27]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] updating number_of_replicas to [0] for indices [.kibana_2]
[00:21:27]               │ proc [kibana]   log   [13:18:46.352] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:21:27]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:21:27]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] updating number_of_replicas to [0] for indices [.kibana_1]
[00:21:27]               │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] 83480 finished with response BulkByScrollResponse[took=106.2ms,timed_out=false,sliceId=null,updated=0,created=9,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:21:28]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana/IYaU2aK_QhaT0c_vFSiZPA] deleting index
[00:21:28]               │ proc [kibana]   log   [13:18:46.725] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:21:28]               │ proc [kibana]   log   [13:18:46.743] [warning][savedobjects-service] marking object as corrupt please contact support
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/0TrV5OKcT62wtqKK5IDFfA] update_mapping [_doc]
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/0TrV5OKcT62wtqKK5IDFfA] update_mapping [_doc]
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/0TrV5OKcT62wtqKK5IDFfA] update_mapping [_doc]
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/0TrV5OKcT62wtqKK5IDFfA] update_mapping [_doc]
[00:21:28]               │ proc [kibana]   log   [13:18:47.011] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:21:28]               │ proc [kibana]   log   [13:18:47.075] [info][savedobjects-service] Finished in 796ms.
[00:21:28]               │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/0TrV5OKcT62wtqKK5IDFfA] update_mapping [_doc]
[00:21:28]             └-> create rollup tsvb
[00:21:28]               └-> "before each" hook: global before each
[00:21:28]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-source-data] creating index, cause [auto(bulk api)], templates [], shards [1]/[1], mappings []
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-source-data/K90Eq9BGR0iRSyRxPIwm-A] create_mapping
[00:21:28]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-target-data] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:21:28]               │ debg navigating to visualize url: http://localhost:6121/app/visualize#/
[00:21:28]               │ debg navigate to: http://localhost:6121/app/visualize#/
[00:21:28]               │ info [o.e.x.r.j.RollupJobTask] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] Rollup job [tsvb-test-rollup-job-1591793837829] created.
[00:21:28]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [rollup-target-data/_8cTo9uTR0i9D2Uv64xXsg] update_mapping [_doc]
[00:21:29]               │ debg browser[INFO] http://localhost:6121/app/visualize?_t=1591795127509#/ 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:21:29]               │
[00:21:29]               │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:29]               │ debg ... sleep(700) start
[00:21:29]               │ debg ... sleep(700) end
[00:21:29]               │ debg returned from get, calling refresh
[00:21:30]               │ debg browser[INFO] http://localhost:6121/app/visualize?_t=1591795127509#/ 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:21:30]               │
[00:21:30]               │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:30]               │ debg currentUrl = http://localhost:6121/app/visualize#/
[00:21:30]               │          appUrl = http://localhost:6121/app/visualize#/
[00:21:30]               │ debg TestSubjects.find(kibanaChrome)
[00:21:30]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:21:32]               │ debg browser[INFO] http://localhost:6121/33723/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:18:50Z
[00:21:32]               │        Adding connection to http://localhost:6121/elasticsearch
[00:21:32]               │
[00:21:32]               │      "
[00:21:32]               │ debg ... sleep(501) start
[00:21:32]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1591791437312913154] [.kibana_2/0TrV5OKcT62wtqKK5IDFfA] update_mapping [_doc]
[00:21:33]               │ debg ... sleep(501) end
[00:21:33]               │ debg in navigateTo url = http://localhost:6121/app/visualize#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:21:33]               │ debg --- retry.try error: URL changed, waiting for it to settle
[00:21:33]               │ debg ... sleep(501) start
[00:21:34]               │ debg ... sleep(501) end
[00:21:34]               │ debg in navigateTo url = http://localhost:6121/app/visualize#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:21:34]               │ debg TestSubjects.exists(statusPageContainer)
[00:21:34]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:21:36]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:21:37]               │ debg TestSubjects.exists(newItemButton)
[00:21:37]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="newItemButton"]') with timeout=2500
[00:21:37]               │ debg TestSubjects.click(newItemButton)
[00:21:37]               │ debg Find.clickByCssSelector('[data-test-subj="newItemButton"]') with timeout=10000
[00:21:37]               │ debg Find.findByCssSelector('[data-test-subj="newItemButton"]') with timeout=10000
[00:21:37]               │ debg TestSubjects.find(visNewDialogTypes)
[00:21:37]               │ debg Find.findByCssSelector('[data-test-subj="visNewDialogTypes"]') with timeout=10000
[00:21:37]               │ debg TestSubjects.click(visType-metrics)
[00:21:37]               │ debg Find.clickByCssSelector('[data-test-subj="visType-metrics"]') with timeout=10000
[00:21:37]               │ debg Find.findByCssSelector('[data-test-subj="visType-metrics"]') with timeout=10000
[00:21:37]               │ debg isGlobalLoadingIndicatorVisible
[00:21:37]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:21:37]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:21:37]               │ debg browser[INFO] http://localhost:6121/app/visualize#/create?type=metrics 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:21:37]               │
[00:21:37]               │ debg browser[INFO] http://localhost:6121/bundles/app/core/bootstrap.js 11:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:39]               │ debg browser[INFO] http://localhost:6121/33723/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-06-10T13:18:57Z
[00:21:39]               │        Adding connection to http://localhost:6121/elasticsearch
[00:21:39]               │
[00:21:39]               │      "
[00:21:39]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:21:39]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:21:39]               │ debg TestSubjects.exists(tvbVisEditor)
[00:21:39]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="tvbVisEditor"]') with timeout=10000
[00:21:40]               │ debg TestSubjects.find(metricTsvbTypeBtn)
[00:21:40]               │ debg Find.findByCssSelector('[data-test-subj="metricTsvbTypeBtn"]') with timeout=10000
[00:21:40]               │ debg TestSubjects.exists(tsvbMetricValue)
[00:21:40]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="tsvbMetricValue"]') with timeout=10000
[00:21:42]               │ debg --- retry.tryForTime error: [data-test-subj="tsvbMetricValue"] is not displayed
[00:21:45]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:49]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:52]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:52]               │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/rollup app tsvb integration create rollup tsvb.png"
[00:21:52]               │ info Current URL is: http://localhost:6121/app/visualize#/create?type=metrics&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(filters:!(),linked:!f,query:(language:kuery,query:%27%27),uiState:(),vis:(aggs:!(),params:(axis_formatter:number,axis_position:left,axis_scale:normal,background_color_rules:!((id:f1a72b00-ab1c-11ea-bcd0-611b34f2b7c8)),default_index_pattern:%27metricbeat-*%27,default_timefield:%27@timestamp%27,id:%2761ca57f0-469d-11e7-af02-69e470af7417%27,index_pattern:%27%27,interval:%27%27,isModelInvalid:!f,series:!((axis_position:right,chart_type:line,color:%2368BC00,fill:0.5,formatter:number,id:%2761ca57f1-469d-11e7-af02-69e470af7417%27,line_width:1,metrics:!((id:%2761ca57f2-469d-11e7-af02-69e470af7417%27,type:count)),point_size:1,separate_axis:0,split_color_mode:kibana,split_mode:everything,stacked:none)),show_grid:1,show_legend:1,time_field:%27%27,tooltip_mode:show_all,type:metric),title:%27%27,type:metrics))
[00:21:52]               │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/rollup app tsvb integration create rollup tsvb.html
[00:21:52]               └- ✖ fail: "rollup app tsvb integration create rollup tsvb"
[00:21:52]               │

Stack Trace

Error: TSVB Metric tab is not loaded
    at VisualBuilderPage.checkTabIsLoaded (/dev/shm/workspace/kibana/test/functional/page_objects/visual_builder_page.ts:61:15)

History

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

@rudolf
Copy link
Contributor Author

rudolf commented Jun 11, 2020

I wonder how much work it really would be to define schema (with kbn/config-schema) for all SO types.

I think a manual schema would be the most useful. I think adding definitions would be fairly straight-forward, the open question up until now was, what do we do when an object in the index is invalid. But it doesn't have to block on this PR, we could validate all incoming objects at the SavedObjectsRepository but exclude validation when reading from the index.

@rudolf
Copy link
Contributor Author

rudolf commented Jun 30, 2020

From Section 5.5 in the "Improve saved object migrations RFC" #66056

Although it seems preferable to not fail the entire migration because of a single saved object type's migration transform bug or a single invalid document this has several pitfalls:

  • When an object fails to migrate the data for that saved object type becomes inconsistent. This could load to a critical feature being unavailable to a user leaving them with no choice but to downgrade.
  • Because Kibana starts accepting traffic after encountering invalid objects a rollback will lead to data loss leaving users with no clean way to recover.

As a result we prefer to let an upgrade fail and making it easy for users to rollback until they can resolve the root cause.

@rudolf rudolf closed this Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.0.0
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants