elastic / kibana

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

[ES|QL] Console error about failing to parse search warnings #198258

Open jughosta opened 2 hours ago

jughosta commented 2 hours ago

Kibana version: main

Describe the bug: I can see an error in the Console when navigating to ES|QL in Discover:

reportUnhandledError.js:10 Uncaught TypeError: Cannot read properties of undefined (reading 'failed')
    at extractWarnings (extract_warnings.ts:15:1)
    at handleWarnings (handle_warnings.tsx:29:1)
    at search_service.ts:239:1
    at Array.forEach (<anonymous>)
    at Object.showWarnings (search_service.ts:233:1)
    at getSearchWarningMessages (utils.ts:281:1)
    at Embeddable.getSearchWarningMessages (embeddable.tsx:800:1)
    at embeddable.tsx:299:1
    at Object.next (use_expression_renderer.ts:114:1)
    at __kbnSharedDeps_npm__.../../node_modules/rxjs/dist/esm5/internal/Subscriber.js.ConsumerObserver.next (Subscriber.js:96:1)

This might mean that search warnings (like failed search on some shards) would not be surfaced to the user in UI.

Image

elasticmachine commented 2 hours ago

Pinging @elastic/kibana-esql (Team:ESQL)

elasticmachine commented 2 hours ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

stratoula commented 2 hours ago

@jughosta I cant replicate. Can you give more details? How are you navigating in ES|QL? With which datasource?

Dosant commented 2 hours ago

@stratoula, I also saw this error. In my case it was an empty deployment > dashboard > try ESQL > see error in console

Uncaught TypeError: Cannot read properties of undefined (reading 'failed')
    at extractWarnings (extract_warnings.ts:15:1)
    at handleWarnings (handle_warnings.tsx:29:1)
    at search_service.ts:239:1
    at Array.forEach (<anonymous>)
    at Object.showWarnings (search_service.ts:233:1)
    at getSearchWarningMessages (utils.ts:281:1)
    at Embeddable.getSearchWarningMessages (embeddable.tsx:800:1)
    at embeddable.tsx:299:1
    at Object.next (use_expression_renderer.ts:114:1)
stratoula commented 2 hours ago

@Dosant thanx, I can replicate it now 🙌

jughosta commented 2 hours ago

For me it happens every time I open ES|QL in Discover. Also even after a page refresh.

stratoula commented 2 hours ago

This fails because in ES|QL we dont send _clusters or _shards or timed_out for regular indices. We need to check for the existence of the properties first.