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

NullPointerException in Elasticsearch when adding Index Pattern in kibana #43741

Closed
marekmarkowski84 opened this issue Jun 28, 2019 · 2 comments
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v7.2.0

Comments

@marekmarkowski84
Copy link

marekmarkowski84 commented Jun 28, 2019

Elasticsearch version: Version: 7.2.0
Kibana version: 7.2.0
JVM version: JVM: 1.8.0_171
OS version: Ubuntu 18.04

Description of the problem including expected versus actual behavior:
Hey,

I noticed NullPointerException in the Elasticsearch logs (org.elasticsearch.action.fieldcaps.TransportFieldCapabilitiesIndexAction:106) when trying to add in kibana index pattern.
In addition, Kibana does not see the index fields (only meta fields).

I suspect that the reason for the problems is using index_prefixes.

Steps to reproduce:

  1. Just delete index if exists
curl -XDELETE "http://localhost:9200/test02"
  1. Create index
curl -XPUT "http://localhost:9200/test02" -H 'Content-Type: application/json' -d'{
  "mappings": {
    "properties": {
      "app_name": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          },
          "prefix_app_name": {
            "type": "text",
            "index_prefixes": {
              "min_chars": 1,
              "max_chars": 19
            }
          }
        }
      }
    }
  }
}'
  1. Index document
curl -XPOST "http://localhost:9200/test02/_doc" -H 'Content-Type: application/json' -d'{  "app_name":"my super app1"}'
  1. Create index pattern in kibana for test02

image

Exception is thrown after click Next Step

I kibana presents only meta fields

image

Logs:

[2019-06-28T09:57:12,064][DEBUG][o.e.a.f.TransportFieldCapabilitiesIndexAction] [marekm] null: failed to execute [org.elasticsearch.action.fieldcaps.FieldCapabilitiesIndexRequest@30bb56e3]
org.elasticsearch.transport.RemoteTransportException: [marekm][127.0.0.1:9300][indices:data/read/field_caps[index][s]]
Caused by: java.lang.NullPointerException
	at org.elasticsearch.action.fieldcaps.TransportFieldCapabilitiesIndexAction.shardOperation(TransportFieldCapabilitiesIndexAction.java:106) ~[elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.action.fieldcaps.TransportFieldCapabilitiesIndexAction.shardOperation(TransportFieldCapabilitiesIndexAction.java:46) ~[elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$1.doRun(TransportSingleShardAction.java:113) ~[elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:758) [elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.2.0.jar:7.2.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]

@markharwood markharwood added :Search Foundations/Mapping Index mappings, including merging and defining field types >bug v7.2.0 labels Jul 1, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

jimczi added a commit to jimczi/elasticsearch that referenced this issue Jul 2, 2019
This change fixes the name of the index_prefix sub field when the `index_prefix`
option is set on a text field that is nested under an object or a multi-field.
We don't use the full path of the parent field to set the index_prefix field name
so the field is registered under the wrong name. This doesn't break queries since
we always retrieve the prefix field through its parent field but this breaks other
APIs like _field_caps which tries to find the parent of the `index_prefix` field
in the mapping but fails.

Relates elastic#43741
@jimczi jimczi closed this as completed in e28fb1f Jul 3, 2019
jimczi added a commit that referenced this issue Jul 3, 2019
This change fixes the name of the index_prefix sub field when the `index_prefix`
option is set on a text field that is nested under an object or a multi-field.
We don't use the full path of the parent field to set the index_prefix field name
so the field is registered under the wrong name. This doesn't break queries since
we always retrieve the prefix field through its parent field but this breaks other
APIs like _field_caps which tries to find the parent of the `index_prefix` field
in the mapping but fails.

Closes #43741
jimczi added a commit that referenced this issue Jul 3, 2019
This change fixes the name of the index_prefix sub field when the `index_prefix`
option is set on a text field that is nested under an object or a multi-field.
We don't use the full path of the parent field to set the index_prefix field name
so the field is registered under the wrong name. This doesn't break queries since
we always retrieve the prefix field through its parent field but this breaks other
APIs like _field_caps which tries to find the parent of the `index_prefix` field
in the mapping but fails.

Closes #43741
@viewable
Copy link

viewable commented Apr 6, 2020

@jimczi @markharwood
This appears to also be an issue on 6.8.x. Is there any chance of the patch for this being backported to 6.8.x?

@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v7.2.0
Projects
None yet
Development

No branches or pull requests

5 participants