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

field_capabilites handler swallows an upgrade-related exception from ES #11379

Closed
tsullivan opened this issue Apr 23, 2017 · 5 comments · Fixed by #11450
Closed

field_capabilites handler swallows an upgrade-related exception from ES #11379

tsullivan opened this issue Apr 23, 2017 · 5 comments · Fixed by #11450
Labels
bug Fixes for quality problems that affect the customer experience Feature:elasticsearch

Comments

@tsullivan
Copy link
Member

Kibana version:
5.3.1

Elasticsearch version:
5.3.1

Browser/Server OS version:
Darwin

Browser version:
Chrome

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

Description of the problem including expected versus actual behavior:
When there is a problem in the Elasticsearch mapping

Steps to reproduce:

  1. Starting with ES 2.4.4
  2. Create an index mapping with a timestamp, analyzed string field + a geo_point:
PUT index
{"mappings":{"type":{"properties":{"geo_field":{"type":"geo_point"},"text_field":{"type":"string"},"@timestamp":{"type":"date"}}}}}
  1. Add a sample document
PUT index/type/1
{"geo_field":"33.8957, -112.0577","text_field":"Hello World!","@timestamp":"2017-04-21T12:37:11.000Z"}
  1. Create an index pattern in Kibana for the index
  2. Upgrade to 5.3.1 (you can just copy the data directory over)
  3. This will trigger _field_stats call on geo_point field broken after upgrading from 2.4.4 -> 5.3.1 elasticsearch#24275
  4. Kibana will show confusing error messages, and will swallow the actual field_stats error that's described in _field_stats call on geo_point field broken after upgrading from 2.4.4 -> 5.3.1 elasticsearch#24275

I added console.log logging in the code and found this is the callWithRequest response that Kibana gets at line https://github.com/elastic/kibana/blob/5.3/src/core_plugins/kibana/server/routes/api/ingest/register_field_capabilities.js#L20:

{"_shards":{"total":5,"successful":4,"failed":1,"failures":[{"shard":3,"index":"index","status":"INTERNAL_SERVER_ERROR","reason":{"type":"exception","reason":"java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 5","caused_by":{"type":"execution_exception","reason":"java.lang.ArrayIndexOutOfBoundsException: 5","caused_by":{"type":"array_index_out_of_bounds_exception","reason":"5"}}}}]},"indices":{"_all":{"fields":{}}}}

Errors in browser console (if relevant):

  • No errors in the JS console or any HTTP errors
  • Discover shows unhelpful errors:
    image
  • Refreshing the Index Pattern doesn't solve the problem and seems to show the field mappings correctly (which is very strange considering field_capabilities returns nothing:
    image

Provide logs and/or server output (if relevant):
With verbose logging, no errors are logged either when trying to load Discover, or when refreshing the Index Pattern

@tsullivan tsullivan added bug Fixes for quality problems that affect the customer experience Feature:elasticsearch labels Apr 23, 2017
@tsullivan tsullivan changed the title Register Field Capabilities swallows an upgrade-related exception from ES field_capabilites handler swallows an upgrade-related exception from ES Apr 23, 2017
@tsullivan
Copy link
Member Author

Another thing that's odd is my geo_field is checked as being searchable and aggregatable, even after refreshing the index pattern, given that field_capabilities returned nothing:
image

@Bargs
Copy link
Contributor

Bargs commented Apr 24, 2017

Related to #9571 (which is why you're seeing weird errors in Discover). At least one user near the end of that comment thread seems to be running into this issue.

It looks like you're still seeing the geo_field marked as searchable and aggregatable because it's hardcoded to workaround elastic/elasticsearch#20707.

@tsullivan does this only happen when upgrading from 2.4.4 to 5.3.1?

In the short term we should definitely stop swallowing the error, long term it won't be a problem when we switch to the field_caps API.

@Bargs
Copy link
Contributor

Bargs commented Apr 24, 2017

So we already handle most errors, but this is a shard failure so it doesn't fail the entire request. I'm wondering if we already have a common way of handling this. @spalger does the ES client handle shard failures at all? Or are we best off extracting them in the success handler?

@Bargs
Copy link
Contributor

Bargs commented Apr 25, 2017

As a workaround users may find this community member's script useful to temporarily mark all fields as searchable and aggregatable.

@spalger
Copy link
Contributor

spalger commented Apr 25, 2017

@spalger does the ES client handle shard failures at all?

The es client doesn't do anything special with shard failures. The courier automatically warns when any number of shards fails, but that's obviously not applicable to all requests

e40pud added a commit that referenced this issue Dec 9, 2024
…11379) (#203396)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

These changes add sorting functionality to the migration rules table. It
is possible to sort migration rules by next columns: `Updated`, `Name`,
`Status`, `Risk Score`, `Severity` and `Author`.

### Other changes

Next fixes and adjustments were also implemented as part of this PR:
* `Installed` status in migration rules table to indicate whether the
rule was installed
* Rules selection and installation of selected rules
* Disable selection for not fully translated rules
* `Author` column to show whether the translated rule matched one of the
existing Elastic prebuilt rules
* `Install and enable` and `Install without enabling` buttons within the
migration rule details flyout
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 9, 2024
…lastic#11379) (elastic#203396)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

These changes add sorting functionality to the migration rules table. It
is possible to sort migration rules by next columns: `Updated`, `Name`,
`Status`, `Risk Score`, `Severity` and `Author`.

### Other changes

Next fixes and adjustments were also implemented as part of this PR:
* `Installed` status in migration rules table to indicate whether the
rule was installed
* Rules selection and installation of selected rules
* Disable selection for not fully translated rules
* `Author` column to show whether the translated rule matched one of the
existing Elastic prebuilt rules
* `Install and enable` and `Install without enabling` buttons within the
migration rule details flyout

(cherry picked from commit 70a5bb3)
kibanamachine added a commit that referenced this issue Dec 9, 2024
…table (#11379) (#203396) (#203486)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Rules migration] Add sorting functionality to rules migration table
(#11379) (#203396)](#203396)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-09T19:21:16Z","message":"[Rules
migration] Add sorting functionality to rules migration table (#11379)
(#203396)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nThese changes add sorting functionality to the
migration rules table. It\r\nis possible to sort migration rules by next
columns: `Updated`, `Name`,\r\n`Status`, `Risk Score`, `Severity` and
`Author`.\r\n\r\n### Other changes\r\n\r\nNext fixes and adjustments
were also implemented as part of this PR:\r\n* `Installed` status in
migration rules table to indicate whether the\r\nrule was installed\r\n*
Rules selection and installation of selected rules\r\n* Disable
selection for not fully translated rules\r\n* `Author` column to show
whether the translated rule matched one of the\r\nexisting Elastic
prebuilt rules\r\n* `Install and enable` and `Install without enabling`
buttons within the\r\nmigration rule details
flyout","sha":"70a5bb33c438912b64259ea4c7a3c77c41f93f45","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting","Team: SecuritySolution","backport:prev-minor"],"title":"[Rules
migration] Add sorting functionality to rules migration table
(#11379)","number":203396,"url":"https://github.com/elastic/kibana/pull/203396","mergeCommit":{"message":"[Rules
migration] Add sorting functionality to rules migration table (#11379)
(#203396)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nThese changes add sorting functionality to the
migration rules table. It\r\nis possible to sort migration rules by next
columns: `Updated`, `Name`,\r\n`Status`, `Risk Score`, `Severity` and
`Author`.\r\n\r\n### Other changes\r\n\r\nNext fixes and adjustments
were also implemented as part of this PR:\r\n* `Installed` status in
migration rules table to indicate whether the\r\nrule was installed\r\n*
Rules selection and installation of selected rules\r\n* Disable
selection for not fully translated rules\r\n* `Author` column to show
whether the translated rule matched one of the\r\nexisting Elastic
prebuilt rules\r\n* `Install and enable` and `Install without enabling`
buttons within the\r\nmigration rule details
flyout","sha":"70a5bb33c438912b64259ea4c7a3c77c41f93f45"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203396","number":203396,"mergeCommit":{"message":"[Rules
migration] Add sorting functionality to rules migration table (#11379)
(#203396)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nThese changes add sorting functionality to the
migration rules table. It\r\nis possible to sort migration rules by next
columns: `Updated`, `Name`,\r\n`Status`, `Risk Score`, `Severity` and
`Author`.\r\n\r\n### Other changes\r\n\r\nNext fixes and adjustments
were also implemented as part of this PR:\r\n* `Installed` status in
migration rules table to indicate whether the\r\nrule was installed\r\n*
Rules selection and installation of selected rules\r\n* Disable
selection for not fully translated rules\r\n* `Author` column to show
whether the translated rule matched one of the\r\nexisting Elastic
prebuilt rules\r\n* `Install and enable` and `Install without enabling`
buttons within the\r\nmigration rule details
flyout","sha":"70a5bb33c438912b64259ea4c7a3c77c41f93f45"}}]}]
BACKPORT-->

---------

Co-authored-by: Ievgen Sorokopud <[email protected]>
Samiul-TheSoccerFan pushed a commit to Samiul-TheSoccerFan/kibana that referenced this issue Dec 10, 2024
…lastic#11379) (elastic#203396)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

These changes add sorting functionality to the migration rules table. It
is possible to sort migration rules by next columns: `Updated`, `Name`,
`Status`, `Risk Score`, `Severity` and `Author`.

### Other changes

Next fixes and adjustments were also implemented as part of this PR:
* `Installed` status in migration rules table to indicate whether the
rule was installed
* Rules selection and installation of selected rules
* Disable selection for not fully translated rules
* `Author` column to show whether the translated rule matched one of the
existing Elastic prebuilt rules
* `Install and enable` and `Install without enabling` buttons within the
migration rule details flyout
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this issue Dec 12, 2024
…lastic#11379) (elastic#203396)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

These changes add sorting functionality to the migration rules table. It
is possible to sort migration rules by next columns: `Updated`, `Name`,
`Status`, `Risk Score`, `Severity` and `Author`.

### Other changes

Next fixes and adjustments were also implemented as part of this PR:
* `Installed` status in migration rules table to indicate whether the
rule was installed
* Rules selection and installation of selected rules
* Disable selection for not fully translated rules
* `Author` column to show whether the translated rule matched one of the
existing Elastic prebuilt rules
* `Install and enable` and `Install without enabling` buttons within the
migration rule details flyout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants