I'm encountering a similar issue as:
I'm sending logs from kubernetes using fluent-bit to an ES pipeline with a geoip processor.
PUT _ingest/pipeline/geoip
{
"description": "Ingest nginx-ingress logs",
"processors": [
{
"geoip": {
"field": "real_ip",
"target_field": "geoip",
"ignore_missing": true
}
}
]
}
It works very well (geoip field is correctly populated)... until I want the coordinates to be a geo_point (sounds familiar, huh?) and add this template:
PUT _template/my_template
{
"index_patterns": [
"ingress-*"
],
"mappings" : {
"properties" : {
"geo" : {
"properties" : {
"location" : {
"type": "geo_point"
}
}
}
}
}
}
Of course I deleted any existing index.
The index is created but no document is added and elasticsearch complains that:
java.lang.IllegalArgumentException: mapper [geo.location] of different type, current_type [geo_point], merged_type [ObjectMapper]
Interestingly it seems to work if create documents from the console.
The issue seems to be related to the fact this is a fresh index by an incoming bulk of documents.
(Almost) full log:
{"type": "server", "timestamp": "2019-05-21T10:42:54,621+0000", "level": "DEBUG", "component": "o.e.a.b.TransportShardBulkAction", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-2", "cluster.uuid": "qCCc98YYReufNd6ZM6wuag", "node.id": "Qn7HpDdJQhKRMnQaEHlfdA", "message": "[ingress-2019.05.21][0] failed to execute bulk item (index) index {[ingress-2019.05.21][flb_type][d155bb33-0bc5-830b-d629-dab72faaae18], source[{"real_ip":"88.181.202.2","referer":"https://kibana.someapp.app/app/kibana\",\"agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36","k8_docker_id":"8697f798cb6a220e2989ef8176ee0d5e1607d65b3e66bfab9076af09d7300b8b","code":"200","upstream_addr":"10.244.3.216:5601","k8_container_name":"nginx-ingress-controller","k8_labels":{"app":"nginx-ingress","component":"controller","release":"nginx-ingress","pod-template-hash":"696d44fbbd"},"k8_host":"general-f6ez","geo":{"continent_name":"Europe","region_iso_code":"FR-77","city_name":"Redacted City","country_iso_code":"FR","region_name":"Seine-et-Marne","location":{"lon":2.5715,"lat":48.3181}},"path":"/elasticsearch/_msearch?rest_total_hits_as_int=trueu0026ignore_throttled=true","upstream_status":"200","k8_pod_id":"9a84914a-77db-11e9-ab45-56d79445c822","request_time":"0.263","stream":"stdout","host":"88.181.202.2","k8_pod_name":"nginx-ingress-controller-696d44fbbd-f6x9p","method":"POST","last":"8f346c238c821ef1348e68ddf1dde2c7","k8_annotations":{"fluentbit_io/parser":"k8s-nginx-ingress"},"upstream_response_length":"210","flb-key":"ingress","message":"88.181.202.2 - [88.181.202.2] - admin [20/May/2019:16:54:29 +0000] \"POST /elasticsearch/_msearch?rest_total_hits_as_int=trueu0026ignore_throttled=true HTTP/2.0\" 200 210 \"https://kibana.someapp.app/app/kibana\\\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36\" 1074 0.263 [monitoring-kibana-kibana-5601] 10.244.3.216:5601 210 0.260 200 8f346c238c821ef1348e68ddf1dde2c7\n","size":"210","k8_namespace_name":"nginx-ingress","request_length":"1074","proxy_upstream_name":"monitoring-kibana-kibana-5601","upstream_response_time":"0.260","time":"2019-05-20T16:54:29.422062755Z","user":"admin","@ts":"2019-05-21T10:42:07.000Z"}]}" ,
"stacktrace": ["java.lang.IllegalArgumentException: mapper [geo.location] of different type, current_type [geo_point], merged_type [ObjectMapper]",
"at org.elasticsearch.index.mapper.FieldMapper.doMerge(FieldMapper.java:330) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.GeoPointFieldMapper.doMerge(GeoPointFieldMapper.java:193) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.FieldMapper.merge(FieldMapper.java:317) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.FieldMapper.merge(FieldMapper.java:52) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.ObjectMapper.doMerge(ObjectMapper.java:472) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.ObjectMapper.merge(ObjectMapper.java:443) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.ObjectMapper.merge(ObjectMapper.java:47) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.ObjectMapper.doMerge(ObjectMapper.java:472) ~[elasticsearch-7.0.1.jar:7.0.1]",
"at org.elasticsearch.index.mapper.RootObjectMapper.doMerge(RootObjectMapper.java:276) ~[elasticsearch-7.0.1.jar:7.0.1]",