elastic / kibana

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

Canvas error if esdocs sort property without sort direction #198591

Open dolivanu opened 1 week ago

dolivanu commented 1 week ago

Kibana version: 8.15.3

Elasticsearch version: 8.15.3

Server OS version: Cloud & on-prem Windows Server 2022

Browser version: MS Edge 130.0.2849.56

Browser OS version: Windows 10 22H2 10.0.19045 Build 19045

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

Describe the bug:

Steps to reproduce:

  1. Canvas, select Create workpad
  2. Add element : Data table
  3. Click on the table
  4. Click on Expression editor
  5. Change the default expression to:
    esdocs index="metrics-*" count=10 sort="agent.type"
    | table
    | render
  6. Click on Run
  7. Gives error Unable to load page
  8. Click on Refresh loads the page again, but if click on table, raises the same error

Expected behavior: The esdocs sort property with the syntax error should raise a controlled error when pressing Run, allowing the user to fix it on the Expression editor, as other syntax errors.

Screenshots (if relevant):

Errors in browser console (if relevant):

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

TypeError: t.renderError is not a function
    at https://my-deployment-XXX.kb.eu-central-1.aws.cloud.es.io/XXXaa/bundles/plugin/canvas/1.0.0/canvas.chunk.12.js:16:13571
    at u (https://my-deployment-XXX.kb.eu-central-1.aws.cloud.es.io/XXXaa/bundles/plugin/canvas/1.0.0/canvas.chunk.7.js:3:17944)
    at la (https://my-deployment-XXX.kb.eu-central-1.aws.cloud.es.io/XXXaa/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:429:59212)
    at ec (https://my-deployment-XXX.kb.eu-central-1.aws.cloud.es.io/XXXaa/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:429:114853)

Any additional context: The problem is when editing the expression directly on the bottom panel and include a syntax error in esdocs property sort with only the property name, not including sort direction, sort="agent.type" versus sort="agent.type, desc".

You can not edit the table anymore. To solve the issue, you can download the workpad JSON file, remove the sort property entirely and load the workpad again.

elasticmachine commented 5 days ago

Pinging @elastic/kibana-presentation (Team:Presentation)