Upgraded from 6.4 to 7.4.2

Hello Folks,

We have upgraded ES from 6.4 to 7.4.2. I have a problem rolling over the index.
I followed the instructions from this page

https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html

When I do a rollover as follows,

POST /myindex/_rollover?dry_run=false&wait_for_active_shards=0
{
"conditions" : {
"max_age": "1d",
"max_size": "100gb"
}
}

I get this error,

{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[hostname][IP:9300][indices:admin/rollover]"
}
],
"type": "illegal_argument_exception",
"reason": "The [default] mapping cannot be updated on index [myindex-2019.12.14-000208]: defaults mappings are not useful anymore now that indices can have at most one type."
},
"status": 400
}

Can someone help?

It complains about your old mapping. If you read the breaking changes documentation, in Elasticsearch 7.x it will only allow document type _doc. I assume your old mapping has document type as something else which will need to be removed from the mapping as 7.x mapping does not allow you to define custom document type anymore.

1 Like

Like I said, I did follow the removal-of-types. So the template that I have now looks like following,

{
"myindex-template" : {
"order" : 0,
"index_patterns" : [
"myindex-"
],
"settings" : {
"index" : {
"number_of_shards" : "2",
"number_of_replicas" : "1",
"refresh_interval" : "60s"
}
},
"mappings" : {
"_doc" : {
"dynamic_templates" : [
{
"message_field" : {
"path_match" : "message",
"mapping" : {
"norms" : false,
"type" : "text"
},
"match_mapping_type" : "string"
}
},
{
"string_fields" : {
"mapping" : {
"norms" : false,
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
},
"type" : "text"
},
"match_mapping_type" : "string",
"match" : "
"
}
}
],
"properties" : {
"@timestamp" : {
"type" : "date"
},
"geoip" : {
"dynamic" : "true",
"properties" : {
"city_name" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"CustomerIP" : {
"type" : "ip"
},
"ip" : {
"type" : "ip"
},
"latitude" : {
"type" : "half_float"
},
"country_code2" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"country_name" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"continent_code" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"location" : {
"type" : "geo_point"
},
"region_name" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"longitude" : {
"type" : "half_float"
},
"region_code" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
}
}
},
"@version" : {
"type" : "keyword"
}
}
}
},
"aliases" : { }
}
}

When I try to rollover or add new index. I get the same error.
"defaults mappings are not useful anymore now that indices can have at most one type"

Please help, as you see the _doc is used in the template.

Is there any other template that might be applying to this one index?

There is only one template and I deleted the template and created fresh as per 7.4 version.

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