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

Null accessor errors in search source query rule #183068

Open
ymao1 opened this issue May 9, 2024 · 3 comments
Open

Null accessor errors in search source query rule #183068

ymao1 opened this issue May 9, 2024 · 3 comments
Labels
Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@ymao1
Copy link
Contributor

ymao1 commented May 9, 2024

The following rule execution error messages have been seen for the .es-query rule (KQL version).

type (fixed with #182883)

Executing Rule default:.es-query:0e2d43dd-27d2-4e69-bbac-5a9a0ebd1c45 has resulted in Error: Cannot read properties of undefined (reading 'type') - TypeError: Cannot read properties of undefined (reading 'type')
    at /usr/share/kibana/node_modules/@kbn/es-query/src/filters/build_filters/range_filter.js:103:58
    at /usr/share/kibana/node_modules/lodash/lodash.js:13469:38
    at /usr/share/kibana/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/usr/share/kibana/node_modules/lodash/lodash.js:3032:24)
    at mapValues (/usr/share/kibana/node_modules/lodash/lodash.js:13468:7)
    at buildRangeFilter (/usr/share/kibana/node_modules/@kbn/es-query/src/filters/build_filters/range_filter.js:103:34)
    at updateSearchSource (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:68:50)
    at fetchSearchSourceQuery (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:43:7)

gte:

Executing Rule default:.es-query:55024590-a989-11ee-8c16-dbbdc60ea0be has resulted in Error: Cannot read properties of undefined (reading 'gte') - TypeError: Cannot read properties of undefined (reading 'gte')
    at updateSearchSource (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:70:130)
    at fetchSearchSourceQuery (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:41:7)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/executor.js:84:8)

timeFieldName:

xecuting Rule default:.es-query:93138bc0-e76c-11ee-8563-83a10873f2c2 has resulted in Error: Cannot read properties of undefined (reading 'timeFieldName') - TypeError: Cannot read properties of undefined (reading 'timeFieldName')
    at updateSearchSource (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:59:51)
    at fetchSearchSourceQuery (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:40:7)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/executor.js:87:8)
    at Object.executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/rule_type.js:180:14)

index:

Executing Rule default:.es-query:74b1a3e2-f7f0-4d72-8d2f-74b996eba09f has resulted in Error: Cannot read properties of undefined (reading 'index') - TypeError: Cannot read properties of undefined (reading 'index')
    at /usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:151:21
    at Array.map (<anonymous>)
    at updateFilterReferences (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:150:26)
    at generateLink (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:131:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at fetchSearchSourceQuery (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:46:16)
    at executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/executor.js:82:26)
    at Object.executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/rule_type.js:168:14)

fields

Executing Rule default:.es-query:9fdd3cdc-cd87-4846-89bf-0bf76bfa46c5 has resulted in Error: Cannot read properties of undefined (reading 'fields') - TypeError: Cannot read properties of undefined (reading 'fields')
    at updateSearchSource (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:61:23)
    at fetchSearchSourceQuery (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/lib/fetch_search_source_query.js:38:24)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/executor.js:78:26)
    at Object.executor (/usr/share/kibana/node_modules/@kbn/stack-alerts-plugin/server/rule_types/es_query/rule_type.js:162:14)
    at /usr/share/kibana/node_modules/@kbn/alerting-plugin/server/task_runner/task_runner.js:318:26

title:

Executing Rule default:.es-query:ce83a050-dcb8-11ee-8cfd-776c9fe84c58 has resulted in Error: Cannot read properties of undefined (reading 'title') - TypeError: Cannot read properties of undefined (reading 'title')
    at getSearchParamsFromRequest (/usr/share/kibana/src/plugins/data/common/search/search_source/fetch/get_search_params.js:44:32)
    at SearchSource.fetchSearch$ (/usr/share/kibana/src/plugins/data/common/search/search_source/search_source.js:431:58)
    at /usr/share/kibana/src/plugins/data/common/search/search_source/search_source.js:298:19
    at /usr/share/kibana/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js:17:35
    at OperatorSubscriber._this._next (/usr/share/kibana/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21)

The first error was the most common and seen across thousands of clusters. It has been addressed with #182883. The remaining errors are much rarer and also possibly related to the time field bug fixed in the PR. We should monitor the remaining errors.

@botelastic botelastic bot added the needs-team Issues missing a team label label May 9, 2024
@ymao1
Copy link
Contributor Author

ymao1 commented May 9, 2024

Prevalence of errors:
Cannot read properties of undefined (reading 'type') - TypeError: Cannot read properties of undefined (reading 'type')
833,075 instances of this error spread out over hundreds of clusters in the last week

Cannot read properties of undefined (reading 'gte') - TypeError: Cannot read properties of undefined (reading 'gte')
10,355 instances of this error over 3 clusters in the last week

Cannot read properties of undefined (reading 'timeFieldName') - TypeError: Cannot read properties of undefined (reading 'timeFieldName')
8,006 instances of this error over 2 clusters in the last week

Cannot read properties of undefined (reading 'index') - TypeError: Cannot read properties of undefined (reading 'index')
5,993 instances of this error over 2 clusters in the last week

Cannot read properties of undefined (reading 'fields') - TypeError: Cannot read properties of undefined (reading 'fields')
0 instances of this error in the last week

Cannot read properties of undefined (reading 'title') - TypeError: Cannot read properties of undefined (reading 'title')
0 instances of this error in the last week

@ymao1 ymao1 added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label May 9, 2024
@elasticmachine
Copy link
Contributor

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

@jughosta
Copy link
Contributor

Some of these errors could be because users delete data views. Related ticket: #135641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

No branches or pull requests

3 participants