# java.lang.IllegalArgumentException: Fielddata when upgrading to 7.0.0

**URL:** <https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867>\
**Category:** APM\
**Created:** [April 22, 2019, 2:36pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867 "2019-04-22T14:36:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![moixcruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moixcruz/32/40464_2.png) [@moixcruz](https://discuss.elastic.co/u/moixcruz)\
**Post date:** [April 22, 2019, 2:36pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/1 "2019-04-22T14:36:56Z")

</div>

Hi! I run 6.6.0 in several envs ok and today was trying to test a 7.0.0 setup of elastic APM before upgrading those envs but I'm facing some problems, hope anyone can help.

My setup is as follows (done with 6.6.0 successfully):

apm-servers -\> logstash -\> elasticsearch

As stated in [https://www.elastic.co/guide/en/apm/server/master/logstash-output.html:](https://www.elastic.co/guide/en/apm/server/master/logstash-output.html:)

> For this configuration, you must [load the index template into Elasticsearch manually](https://www.elastic.co/guide/en/apm/server/master/_manually_loading_template_configuration.html#load-template-manually) because the options for auto loading the template are only available for the Elasticsearch output.

So what I do is:  
1- export the template definition in the apm-server:

> apm-server export template \> apm-template-6.6.0.json

2- in logstash, pipeline for apm looks as follow:

```
input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
    hosts => ['my-elasticsearch:9200']
    index => "apm-%{[@metadata][version]}-%{[processor][event]}-%{+YYYY.MM.dd}"
    manage_template => true
    template_name => "apm"
    template => "/etc/logstash/templates/apm-template-6.6.0.json"
  }
}

```

While doing same steps for 7.0.0 I cannot see the services in APM in kibana and elasticsearch is logging following errors:

> "Caused by: java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [service.name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.",  
> "at org.elasticsearch.index.mapper.TextFieldMapper$TextFieldType.fielddataBuilder(TextFieldMapper.java:767) ~[elasticsearch-7.0.0.jar:7.0.0]",  
> "at org.elasticsearch.index.fielddata.IndexFieldDataService.getForField(IndexFieldDataService.java:116) ~[elasticsearch-7.0.0.jar:7.0.0]"

Any idea?

---

<div class="post-metadata">

**Author:** ![gil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gil/32/41911_2.png) [@gil](https://discuss.elastic.co/u/gil)\
**Post date:** [April 22, 2019, 3:20pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/2 "2019-04-22T15:20:42Z")

</div>

Your process and configuration look great except you'll need to update your template to use the 7.0.0 template export - there were [significant field changes](https://www.elastic.co/guide/en/apm/get-started/7.0/breaking-7.0.0.html#breaking-ecs) introduced in 7.0.0 that account for the issue you have encountered.

---

<div class="post-metadata">

**Author:** ![moixcruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moixcruz/32/40464_2.png) [@moixcruz](https://discuss.elastic.co/u/moixcruz)\
**Post date:** [April 22, 2019, 3:28pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/3 "2019-04-22T15:28:50Z")

</div>

Hi @gil thanks for your response.  
Yes that's what I mean, I repeated the steps including the export of template after installing apm-server 7.0.0 but now getting above errors.  
note I'm not reusing the elasticsearch cluster but starting up a new one completely

---

<div class="post-metadata">

**Author:** ![moixcruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moixcruz/32/40464_2.png) [@moixcruz](https://discuss.elastic.co/u/moixcruz)\
**Post date:** [April 22, 2019, 4:06pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/4 "2019-04-22T16:06:16Z")

</div>

OK I saw something in elasticsearch that doesn't seem correct:

> {"type": "server", "timestamp": "2019-04-22T15:51:02,122+0000", "level": "INFO", "component": "o.e.c.m.MetaDataIndexTemplateService", "cluster.name": "docker-cluster", "node.name": "bc34ff2855d8", "cluster.uuid": "v6EAYWCoSBe04WwYtt7skg", "node.id": "aDQ5gEwRQXq3lWZX5f9w-Q", "message": "adding template [apm] for index patterns [logstash-\*]" }

so seems is not pushing the apm template correctly for index patterns apm-\* but applying default logstash-\*

however my pipeline definition is clear:

> output {  
> elasticsearch {  
> hosts =\> [\<%= @elasticsearch\_hosts.map{ |item| "'#{item}'" }.join(', ') -%\>]  
> index =\> "apm-%{[@metadata][version]}-%{[processor][event]}-%{+YYYY.MM.dd}"  
> manage\_template =\> true  
> template\_overwrite =\> true  
> template =\> "/etc/logstash/templates/\<%= @template\_file %\>"  
> template\_name =\> "apm"  
> }  
> }

and the template exported from apm-server starts like:

> ```
> {
> "index_patterns": [
> "apm-7.0.0-*"
> ],
> "mappings": {
> "_meta": {
> "beat": "apm",
> "version": "7.0.0"
> },
> "date_detection": false,
> 
> ```

What am I doing wrong?

Thanks

---

<div class="post-metadata">

**Author:** ![moixcruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moixcruz/32/40464_2.png) [@moixcruz](https://discuss.elastic.co/u/moixcruz)\
**Post date:** [April 22, 2019, 4:17pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/5 "2019-04-22T16:17:46Z")

</div>

ok seems I'm facing [https://github.com/elastic/logstash/issues/10687](https://github.com/elastic/logstash/issues/10687)

---

<div class="post-metadata">

**Author:** ![gil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gil/32/41911_2.png) [@gil](https://discuss.elastic.co/u/gil)\
**Post date:** [April 22, 2019, 4:24pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/6 "2019-04-22T16:24:01Z")

</div>

Good find. I've confirmed locally that `ilm_enabled => false` can work around this - is that an option for you?

---

<div class="post-metadata">

**Author:** ![moixcruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moixcruz/32/40464_2.png) [@moixcruz](https://discuss.elastic.co/u/moixcruz)\
**Post date:** [April 22, 2019, 4:31pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/7 "2019-04-22T16:31:36Z")

</div>

yes just confirmed myself as well that disabling ilm works.  
Yep I'll use that option while is fixed properly.  
Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 13, 2019, 12:31pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-fielddata-when-upgrading-to-7-0-0/177867/8 "2019-05-13T12:31:46Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
