# Grafana 6.1.4 502 error connecting to elasticsearch 7.0.0 datasource

**URL:** https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766
**Category:** Elasticsearch
**Created:** [April 27, 2019, 9:22pm UTC](https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766 "2019-04-27T21:22:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![samcro1967](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@samcro1967](https://discuss.elastic.co/u/samcro1967)
#### Post date: [April 27, 2019, 9:22pm UTC](https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766/1 "2019-04-27T21:22:29Z")

</div>

I updated to the latest version of docker container sebp/elk on 4/17/2019. Since then I have been unable to get Telegraf to start on my host. It fails connecting to Elasticsearch. I also get a 502 error connecting to Elasticsearch from Grafana. I have removed all containers and images and re-pulled. I also deleted all data in mount points to start clean and still am unable to connect. The only change I am aware of that was made on 4/17/2019 was the upgrade of sebp/elk.

I am out of ideas on what to look at next.

**I am running the following versions:**  
Grafana 6.1.4 (docker container)  
Elasticsearch 7.0.0  
Telegraf is 1.10.3 (runs locally on host)  
InfluxDB 1.7.6 (runs locally on host)  
Docker 18.09.2  
Windows 10.0.17763.437

**From [http://localhost:9200](http://localhost:9200/) I get**  
{  
"name" : "elk",  
"cluster\_name" : "elasticsearch",  
"cluster\_uuid" : "ov0z53EQQRyVr2DmDETqCg",  
"version" : {  
"number" : "7.0.0",  
"build\_flavor" : "default",  
"build\_type" : "tar",  
"build\_hash" : "b7e28a7",  
"build\_date" : "2019-04-05T22:55:32.697037Z",  
"build\_snapshot" : false,  
"lucene\_version" : "8.0.0",  
"minimum\_wire\_compatibility\_version" : "6.7.0",  
"minimum\_index\_compatibility\_version" : "6.0.0-beta1"  
},  
"tagline" : "You Know, for Search"  
}

**Grafana config for Elasticsearch data source config**  
[![image](https://user-images.githubusercontent.com/2319445/56849898-67715180-68c0-11e9-9d64-efb239a64c87.png)](https://user-images.githubusercontent.com/2319445/56849898-67715180-68c0-11e9-9d64-efb239a64c87.png)

**Telegraf log:**  
2019-04-27T12:31:04Z I! Loaded inputs: win\_perf\_counters docker  
2019-04-27T12:31:04Z I! Loaded aggregators:  
2019-04-27T12:31:04Z I! Loaded processors:  
2019-04-27T12:31:04Z I! Loaded outputs: influxdb elasticsearch  
2019-04-27T12:31:04Z I! Tags enabled: host=DESKTOP-1ND49C8  
2019-04-27T12:31:04Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"DESKTOP-1ND49C8", Flush Interval:10s  
2019-04-27T12:31:04Z I! Elasticsearch version: 7.0.0  
2019-04-27T12:31:04Z E! [agent] Failed to connect to output elasticsearch, retrying in 15s, error was 'Elasticsearch failed to create index template telegraf : elastic: Error 400 (Bad Request): Failed to parse mapping [\_doc]: Root mapping definition has unsupported parameters: [_default_ : {dynamic\_templates=[{tags={path\_match=tag. _, mapping={ignore\_above=512, type=keyword}, match\_mapping\_type=string}}, {metrics\_long={mapping={index=false, type=float}, match\_mapping\_type=long}}, {metrics\_double={mapping={index=false, type=float}, match\_mapping\_type=double}}, {text\_fields={mapping={norms=false}, match=_ }}], \_all={enabled=false}, properties={[@timestamp](https://github.com/timestamp)={type=date}, measurement\_name={type=keyword}}}] [type=mapper\_parsing\_exception]'

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 28, 2019, 7:06am UTC](https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766/2 "2019-04-28T07:06:17Z")

</div>

I think this indicates that this version of Telegraf is incompatible with Elasticsearch 7. Specifically, it seems to be using the `_default_` mapping which was [deprecated some time ago and is no longer supported](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#_the_literal __default__ literal_mapping_is_no_longer_allowed).

I cannot see an open issue about this in [Telegraf's issue tracker](https://github.com/influxdata/telegraf/issues?q=default+elasticsearch+label%3Aarea%2Felasticsearch) but perhaps you could open one?

---

<div class="post-metadata">

### Author: ![samcro1967](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@samcro1967](https://discuss.elastic.co/u/samcro1967)
#### Post date: [April 28, 2019, 3:29pm UTC](https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766/3 "2019-04-28T15:29:57Z")

</div>

Thanks fore the reply David Turner. I can open an issue there as well. I guess also open one on Grafana's issue tracker as to why it cannot connect either?

I may roll back to an earlier version of the container with Elasticsearch 6 and wait for the compatibility issues with others apps and Elasticsearch 7 to be resolved by others. Not sure I want to be the tip of the spear on this one. 😉

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 29, 2019, 5:28am UTC](https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766/4 "2019-04-29T05:28:03Z")

</div>

> [@samcro1967](#):
>
> I may roll back to an earlier version of the container with Elasticsearch 6

I'm not sure exactly what you mean by "roll back", but note that Elasticsearch doesn't support downgrading. Once the data directory has been touched by an Elasticsearch 7 node it won't work with an earlier version any more.

> [@samcro1967](#):
>
> Not sure I want to be the tip of the spear on this one. 😉

Of course, no problem.

---

<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 27, 2019, 5:28am UTC](https://discuss.elastic.co/t/grafana-6-1-4-502-error-connecting-to-elasticsearch-7-0-0-datasource/178766/5 "2019-05-27T05:28:04Z")

</div>

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