Skip to content

uiSettings override needs validation #25526

@marius-dr

Description

@marius-dr

Kibana version: 6.5.0

Original install method (e.g. download page, yum, from source, etc.): BC6

Describe the bug:
Right now there seems to be minimal validation for the field values set in the kibana.yml for the overrides.
For example for the dateFormat:dow if the string value is something that doesn't exist in the list, it will go to the default value.
But if you use a string for numeric fields ( for example "context:defaultSize": "Ten" ), it won't reset to the default and it will try to use this value and throw an TypeError when the UI tries to use that value (in this example, when you click the "View Surrounding Documents" in Discover)

Steps to reproduce:

  1. Set this in kibana.yml
uiSettings:
    overrides:
        "context:defaultSize": "Ten"
  1. Start Kibana
  2. Click on "View surrounding documents" on a document in Discover.

Errors in browser console (if relevant):

TypeError: "anchor is null"
	fetchPredecessorRows http://localhost:5601/bundles/kibana.bundle.js:16:1404860
	try http://localhost:5601/bundles/commons.bundle.js:3:892566
	fetchPredecessorRows http://localhost:5601/bundles/kibana.bundle.js:16:1404837
	fetchContextRows http://localhost:5601/bundles/kibana.bundle.js:16:1406568
	fetchContextRowsWithNewQueryParameters http://localhost:5601/bundles/kibana.bundle.js:16:1406949
	actions http://localhost:5601/bundles/kibana.bundle.js:16:1386071
	ContextAppController http://localhost:5601/bundles/kibana.bundle.js:16:1387207
	watchCollectionAction http://localhost:5601/bundles/vendors.bundle.js:277:209531
	digest http://localhost:5601/bundles/vendors.bundle.js:277:210993
	evalAsync http://localhost:5601/bundles/vendors.bundle.js:277:212930
	completeOutstandingRequest http://localhost:5601/bundles/vendors.bundle.js:277:64421
	timeoutId http://localhost:5601/bundles/vendors.bundle.js:277:67265
 Possibly unhandled rejection: {} vendors.bundle.js:277:155519
	consoleLog/< http://localhost:5601/bundles/vendors.bundle.js:277:155519
	$ExceptionHandlerProvider/this.$get</< http://localhost:5601/bundles/vendors.bundle.js:277:122145
	processChecks http://localhost:5601/bundles/vendors.bundle.js:277:200240
	$digest http://localhost:5601/bundles/vendors.bundle.js:277:210409
	$evalAsync/< http://localhost:5601/bundles/vendors.bundle.js:277:212930
	completeOutstandingRequest http://localhost:5601/bundles/vendors.bundle.js:277:64421
	Browser/self.defer/timeoutId< http://localhost:5601/bundles/vendors.bundle.js:277:67265

We should have validation for the values and maybe also log a WARNING level message in the Kibana log if the validation fails. We currently do this for the other settings that we have in kibana.yml ( although I agree it might not be the exact same case as most of them are server settings)

cc @spalger

Metadata

Metadata

Assignees

Labels

Team:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//bugFixes for quality problems that affect the customer experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions