Reindexing Error while changing the type for fields

I changed the type to integer from string for some of the fields in td-agent(similar to logstash).
I started seeing Mapping conflict in Kibana.

Error in Kibana:

2 fields are defined as several types (string, integer, etc) across the indices that match this pattern. You may still be able to use these conflict fields in parts of Kibana, but they will be unavailable for functions that require Kibana to know their type. Correcting this issue will require reindexing your data.

I tried below steps as suggested in the forums.

1.Created Index with the following.

PUT /2019-11-13-01-05-reindex?pretty
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"_doc": {
"properties": {
"gid": {
"type": "integer"
},
"pid": {
"type": "integer"
}
}
}
}
}

2.Reindex using the existing index.

POST /_reindex?pretty
{
"source": {
"index": "2019-11-13-01-05"
},
"dest": {
"index": "2019-11-13-01-05-reindex"
, "version_type": "external"
}
}

Seeing Error:

{
"took": 4450,
"timed_out": false,
"total": 25094,
"updated": 0,
"created": 0,
"deleted": 0,
"batches": 1,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 0,
"requests_per_second": -1,
"throttled_until_millis": 0,
"failures": [
{
"index": "2019-11-13-01-05-reindex",
"type": "log",
"id": "49596857962723131814983270744084022071986919347295617026.0",
"cause": {
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [2019-11-13-01-05-reindex] as the final mapping would have more than 1 type: [log, _doc]"
},
"status": 400
},
{
"index": "2019-11-13-01-05-reindex",
"type": "log",
"id": "49596857962723131814983270744087648849445763234819735554.0",
"cause": {
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [2019-11-13-01-05-reindex] as the final mapping would have more than 1 type: [log, _doc]"
},
"status": 400
},

Can someone please let me know the solution.

the interesting part if this

Rejecting mapping update to [2019-11-13-01-05-reindex] as the final mapping would have more than 1 type: [log, _doc]

somehow you are trying to create two types in that index. Is it possible, that another index template is trying to create the log type on index creation?

I was able to resolve this after updating mapping name.

1 Like

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