# Upgrade to es 6.1.0 trouble

**URL:** https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268
**Category:** Elasticsearch
**Created:** [December 18, 2017, 3:38pm UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268 "2017-12-18T15:38:29Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [December 18, 2017, 3:38pm UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/1 "2017-12-18T15:38:29Z")

</div>

Hi,

I try to upgrade the ELK stack from 5.6.3 to 6.1.0.

I get some errors when trying to load the old templates.

```
15:33:23.975 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Installing elasticsearch template to _template/events
15:33:24.019 [[main]-pipeline-manager] ERROR logstash.outputs.elasticsearch - Failed to install template. {:message=>"Got response code '400' contacting Elasticsearch at URL 'http://elasticsearch:9200/_template/events'", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb:80:in `perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:287:in `perform_request_to_url'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:274:in `block in perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:369:in `with_connection'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:273:in `perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:281:in `block in put'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client.rb:338:in `template_put'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client.rb:82:in `template_install'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/template_manager.rb:21:in `install'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/template_manager.rb:9:in `install_template'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/common.rb:57:in `install_template'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/common.rb:26:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:9:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:43:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:343:in `register_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:354:in `block in register_plugins'", "org/jruby/RubyArray.java:1734:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:354:in `register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:743:in `maybe_setup_out_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:364:in `start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:288:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:248:in `block in start'"]}
15:33:24.020 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//elasticsearch:9200"]}

15:33:25.392 [Ruby-0-Thread-49: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-syslog-3.2.3/lib/logstash/inputs/syslog.rb:105] INFO logstash.inputs.syslog - Starting syslog tcp listener {:address=>"0.0.0.0:5546"}
15:33:30.551 [Ruby-0-Thread-36@[main]>worker1: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:392] WARN logstash.outputs.elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"filebeat-2017.12.18", :_type=>"celerylog", :_routing=>nil}, #<LogStash::Event:0x738eb75b>], :response=>{"index"=>{"_index"=>"filebeat-2017.12.18", "_type"=>"celerylog", "_id"=>"aTZCamABrDapfknuLk-F", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [filebeat-2017.12.18] as the final mapping would have more than 1 type: [celerylog, nfvolog]"}}}}
15:33:30.551 [Ruby-0-Thread-36@[main]>worker1: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:392] WARN logstash.outputs.elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"filebeat-2017.12.18", :_type=>"vnfmlog", :_routing=>nil}, #<LogStash::Event:0x355475d7>], :response=>{"index"=>{"_index"=>"filebeat-2017.12.18", "_type"=>"vnfmlog", "_id"=>"ajZCamABrDapfknuLk-F", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [filebeat-2017.12.18] as the final mapping would have more than 1 type: [vnfmlog, nfvolog]"}}}}
15:33:30.557 [Ruby-0-Thread-35@[main]>worker0: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:392] WARN logstash.outputs.elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"filebeat-2017.12.18", :_type=>"celerylog", :_routing=>nil}, #<LogStash::Event:0x64d18f81>], :response=>{"index"=>{"_index"=>"filebeat-2017.12.18", "_type"=>"celerylog", "_id"=>"azZCamABrDapfknuLk-8", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [filebeat-2017.12.18] as the final mapping would have more than 1 type: [celerylog, nfvolog]"}}}}

```

Is there anything special regarding the templates I need to do before upgrading to 6.1.0?

Thanks  
Mathias

---

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [December 19, 2017, 7:17am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/2 "2017-12-19T07:17:04Z")

</div>

Hello again,

I got rid of the filebeat template problem by loading latest filebeat template.

For my own template I still have problems.'  
Looking into elasticsearch log I found:

> [2017-12-19T06:58:51,927][INFO][o.e.n.Node] [fDBNwFz] started  
> [2017-12-19T06:58:52,235][INFO][o.e.g.GatewayService] [fDBNwFz] recovered [5] indices into cluster\_state  
> [2017-12-19T06:58:53,019][INFO][o.e.c.r.a.AllocationService] [fDBNwFz] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[events-2017.12.18][1]] ...]).  
> [2017-12-19T06:59:29,603][DEBUG][o.e.a.a.i.t.p.TransportPutIndexTemplateAction] [fDBNwFz] failed to put template [events]  
> java.lang.IllegalArgumentException: Rejecting mapping update to [2PqVXh\_kT6e-4LJkrzVF8A] as the final mapping would have more than 1 type: [log, state, counter, event, generic, notice]  
> at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:494) ~[elasticsearch-6.1.0.jar:6.1.0]  
> at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:350) ~[elasticsearch-6.1.0.jar:6.1.0]  
> at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:274) ~[elasticsearch-6.1.0.jar:6.1.0]

Br Mathias

---

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [December 19, 2017, 7:23am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/3 "2017-12-19T07:23:48Z")

</div>

Oh no,

I just read:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html)

Seems like you have changed the entire template structure.  
The example indicates that you insert new documents using a new type field.

What if I am not able to change the input.  
Are there any other way to use old data?

Br Mathias

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 19, 2017, 7:50am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/4 "2017-12-19T07:50:24Z")

</div>

You need to send your data to different indices like `index-type1-*`, `index-type2-*`...

---

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [December 19, 2017, 7:57am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/5 "2017-12-19T07:57:46Z")

</div>

> [@dadoonet](#):
>
> index-type2-\*

So instead of having a template like:  
{

> ```
> "template": "events-*",
> "id": "events-*",
> "type": "index-pattern",
> "version": 1,
> "mappings": {
> "log": {
> .
> .
> "state": {
> .
> .
> "counter": {
> .
> .
> 
> ```

I should have something like

> {  
> "template": "events-log-_",  
> "id": "events-log-_",  
> "type": "index-pattern",  
> "version": 1,  
> "mappings": {  
> "log": {

> {  
> "template": "events-state-_",  
> "id": "events-state-_",  
> "type": "index-pattern",  
> "version": 1,  
> "mappings": {  
> "state": {

> {  
> "template": "events-counter-_",  
> "id": "events-counter-_",  
> "type": "index-pattern",  
> "version": 1,  
> "mappings": {  
> "counter": {

Is that right?

With several indices, how do I select default index in Kibana?

Thanks  
Mathias

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 19, 2017, 8:26am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/6 "2017-12-19T08:26:40Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

> Is that right?

Yes.

> With several indices, how do I select default index in Kibana?

There is a little ⭐ icon close to the index name to make it the default one.

If having multiple indices is an issue, you can reproduce the way it was somewhat done internally in elasticsearch with multiple types (not really like this but you'll get the idea) and index your documents like:

```auto
{
  "log": {
     // Your log content here
  },
  "state": {
     // Your state content here
  }, 
  "counter": {
     // Your counter content here
  }
}

```

But it's less efficient IMO.

---

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [December 19, 2017, 2:35pm UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/7 "2017-12-19T14:35:21Z")

</div>

Hi,

I am still struggeling.  
I have a new index for each type but I get the following error:

> 14:20:21.483 [Ruby-0-Thread-40@[main]\>worker0: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:392] WARN logstash.outputs.elasticsearch - Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"events-state-2017.12.19", :\_type=\>"doc", :\_routing=\>nil}, #LogStash::Event:0x7b701c76], :response=\>{"index"=\>{"\_index"=\>"events-state-2017.12.19", "\_type"=\>"doc", "\_id"=\>"8mclb2ABzTth-5wZkhFh", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Rejecting mapping update to [events-state-2017.12.19] as the final mapping would have more than 1 type: [doc, state]"}}}}

Then I found this:  
[https://discuss.elastic.co/t/rejecting-mapping-update-for-new-index/109576](https://discuss.elastic.co/t/rejecting-mapping-update-for-new-index/109576)

Does it mean that I should not use templates at all in ES6?  
(I though templates are required to get correct types)

I have the following template for state.

> ```
> {
> "template": "events-state-*",
> "id": "events-state-*",
> "type": "index-pattern",
> "version": 1,
> "mappings": {
> "state": {
> "dynamic_templates": [
> 
> ```
> 
> .  
> .  
> .

Can you explain how the template should be written?

Kind regards  
Mathias

---

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [December 19, 2017, 3:03pm UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/8 "2017-12-19T15:03:22Z")

</div>

I understand now.

Just do not define any mapping for each index. Just a new index.

Thanks  
Mathias

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [December 21, 2017, 1:31am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/9 "2017-12-21T01:31:40Z")

</div>

in es 6 one index only have one type...

---

<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: [January 18, 2018, 1:31am UTC](https://discuss.elastic.co/t/upgrade-to-es-6-1-0-trouble/112268/10 "2018-01-18T01:31:49Z")

</div>

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