elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.57k stars 8.09k forks source link

[Index Management] Adding a field of type `scaled_float` to a component template errors out #187644

Open boernd opened 1 month ago

boernd commented 1 month ago

Kibana version: 8.14.1

Elasticsearch version: 8.14.1

Server OS version: Official docker image

Browser version: Firefox 127.0.2 (64-bit)

Browser OS version: Windows 11

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

Describe the bug: When editing a component template mapping in Kibana / Stack Management / Index Management, adding a numeric field of numeric type scaled_float does not work and throws an error.

Steps to reproduce:

  1. Edit a component template
  2. Add a numeric field of numeric type scaled_float
  3. Try to add the new field
  4. Error page is shown

Expected behavior:

Screenshots (if relevant): image

Errors in browser console (if relevant):

null

$@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:19591
div
div
form
O
d@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:7535
T@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:16683
P@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:18817
i@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:372:19061
v<@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:487531
li
S@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:492496
C@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:496610
ul
L<@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:497871
li
S@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:492496
C@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:496610
ul
L<@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:497871
_@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:533895
div
L<@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:534912
div
div
j<@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:499134
div
O<@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:178613
y@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:180146
_@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:32406
j<@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:28840
f@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:27906
m/<@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:28717
S@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:31314
Te@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:240021
div
m/<@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:356:3169
section
m/<@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:356:3169
b@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:1018495
we@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:247076
t@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:351:120129
h@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:200678
t@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:351:122295
E@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:201555
Js
T@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:28:5403
ne@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:28:11232
te@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:28:10671
K@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:1253:12658
t@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:351:116457
y@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:201442
Hs@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:479104
A@https://hostname/afbd904e868f/bundles/plugin/esUiShared/1.0.0/esUiShared.plugin.js:1:33944
c@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:170148
l@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:193344
m@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:168618
y@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:506537
l@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:27767
__kbnSharedDeps_npm__</t.default@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:372:232390
Provider@https://hostname/afbd904e868f/bundles/plugin/kibanaReact/1.0.0/kibanaReact.plugin.js:1:26253
x@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:43:352147
k@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:43:352948
p@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:43:347865
c@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:184877
Ae@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:43:185752
t@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:43:177230
Re@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:43:186184
Context@https://hostname/afbd904e868f/bundles/core/core.entry.js:16:204738
p@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:583967
d@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:194190
v@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:356:3613
a@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:377:1625502
f@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:60861
x@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:611030
s@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:372:205188
a@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:384:368438
m@https://hostname/afbd904e868f/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:377:1069351
S@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.plugin.js:2:14175
N@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.plugin.js:2:14479
y@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.plugin.js:2:14578
rl@https://hostname/afbd904e868f/bundles/plugin/indexManagement/1.0.0/indexManagement.chunk.0.js:3:483005

Provide logs and/or server output (if relevant):

Any additional context:

elasticmachine commented 1 month ago

Pinging @elastic/kibana-management (Team:Kibana Management)

sabarasaba commented 1 month ago

Seems we are checking for a property called isBeta that doesnt exist for the type definition of scaled_float. In the other places where we use the isBeta property we use it with optional chaining given that is an optional prop but not here where its breaking the UI. Strangely enough when submiting the form the typeDefinition ends up being undefined which triggers the error, but using the optional chaining seems to do the job just fine.