Index patterns server - throw correct error on field caps 404#95879
Index patterns server - throw correct error on field caps 404#95879mattkime merged 7 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
|
First pass looks good overall. Maps telemetry works as expected without ugly log messages. Need to do a deeper dive, but any idea why the error message is coming through To replicate:
|
|
@aaronjcaldwell I resolved the |
|
Pinging @elastic/kibana-gis (Team:Geo) |
| ) { | ||
| throw new IndexPatternMissingIndices(pattern); | ||
| } else { | ||
| throw err; |
There was a problem hiding this comment.
When this is thrown, does the error get caught and logged to the server logs somewhere?
Or should there be a logger.error(err) before the throw?
There was a problem hiding this comment.
It gets caught and logged to the server logs - https://github.com/elastic/kibana/pull/95879/files#diff-a4e9a6425b24a341a47560c879ec9eb04e76748d29376a9c1390962d1da65c10R74 - its defined in the server abstraction layer.
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
kindsun
left a comment
There was a problem hiding this comment.
Thanks for simplifying the code on the Maps side and fixing the error handling on the data side. lgtm!
- tested locally in chrome
- code review, primarily Maps
|
@mattkime Is there any possibility these changes could be backported to |
…c#95879) * throw correct error on field caps 404 and update tests
💔 Backport failed
Successful backport PRs will be merged automatically after passing CI. To backport manually run: |
…c#95879) * throw correct error on field caps 404 and update tests # Conflicts: # src/plugins/data/server/index_patterns/index_patterns_service.ts
#97034) * throw correct error on field caps 404 and update tests # Conflicts: # src/plugins/data/server/index_patterns/index_patterns_service.ts
#97033) * throw correct error on field caps 404 and update tests Co-authored-by: Matthew Kime <matt@mattki.me>
…ax_primary_shard_size * 'master' of github.com:elastic/kibana: (99 commits) added missing optional chain for bracket notation (elastic#96939) [Discover][DocViewer] Fix toggle columns from doc viewer table tab (elastic#95748) [TSVB] Fix per-request caching of index patterns (elastic#97043) [Datatable] Fix filter cell flakiness (elastic#96934) Unskip heatmap suite and fixes flakiness (elastic#96941) [Fleet] Improve performance of data stream API (elastic#97058) [ML] Data Frame Analytics: remove beta badge (elastic#96977) [App Search] Migrate expanded rows for meta engines table in Engines Overview (elastic#96251) Instances latency distribution chart tooltips and axis fixes (elastic#95577) [Monitoring] Using primary average shard size (elastic#96177) [Workplace Search] Hide Kibana chrome on 3rd party connector redirects (elastic#97028) ## [Security Solution] Fixes `Exit full screen` and `Copy to cliboard` styling issues (elastic#96676) Index pattern field editor - Add warning on name or type change (elastic#95528) [App Search] Add small engine breadcrumb utility helper (elastic#96917) Copy esArchiver commands from ./reassign.ts to fix tests (elastic#97012) [Security Solution][Detections] Updates MITRE Tactics, Techniques, and Subtechniques for 7.13 (elastic#97011) Index patterns server - throw correct error on field caps 404 (elastic#95879) Use `EuiThemeProvider` in lists plugin tests and stories (elastic#96129) [npm] upgrade caniuse database (elastic#97002) chore(NA): moving @kbn/apm-utils into bazel (elastic#96227) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
Summary
Previously the server side field caps api call was throwing a generic error and was therefore not caught as expected. This PR fixes this and tests that relied on this incorrect error.
Also simplifies a small amount of map related index pattern code. Previously the field list was being loaded manually which wasn't necessary.
Note: better fixes could be made to the tests but the scripted field code is being deprecated anyway. The tests started failing because the API was correctly reporting errors on index patterns without backing indices.
Closes: #92947