Failed to execute bulk item cannot be changed from type

Hi

I am getting the following error while reindexing the elastic index using postman.

   [2018-10-22T12:39:35,394][DEBUG][o.e.a.b.TransportShardBulkAction] [es-prodnode-1] [rcyc_temp_10_22][2] failed to execute bulk item (index) BulkShardRequest [[rcyc_temp_10_22][2]] containing [365] requests
    **java.lang.IllegalArgumentException: mapper [suiteAvailability] cannot be changed from type [text] to [long]**
        at org.elasticsearch.index.mapper.MappedFieldType.checkTypeName(MappedFieldType.java:151) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.MappedFieldType.checkCompatibility(MappedFieldType.java:163) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.TextFieldMapper$TextFieldType.checkCompatibility(TextFieldMapper.java:262) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.FieldTypeLookup.checkCompatibility(FieldTypeLookup.java:128) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.FieldTypeLookup.copyAndAddAll(FieldTypeLookup.java:94) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:400) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:336) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:268) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:311) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:634) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:612) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:571) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.service.ClusterService$ClusterServiceTaskBatcher.run(ClusterService.java:263) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:575) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) ~[elasticsearch-5.6.8.jar:5.6.8]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) ~[elasticsearch-5.6.8.jar:5.6.8]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]

The crazy thing is it happens infrequently and without any pattern. I tried reindexing 8 times using postman and it failed 2 times and worked remaining 6 times, only the target index name was changed for each request.

POST _reindex
{
  "source": {
    "index": "rcyc"
  },
  "dest": {
    "index": "temprcyc1"
  }
}

Success

POST _reindex
    {
      "source": {
        "index": "rcyc"
      },
      "dest": {
        "index": "temprcyc2"
      }
    }

Failed

Target is both times an empty index. The mapping of suiteAvailability is long in source

"suiteAvailability": {
                        "type": "long"
                    }

We are using a cluster of 3 Elasticsearch nodes. reindex is called to the main server.

Hi what is the type of the field suiteAvailability in the source index ?

in source suiteAvailability is long type. destination index is empty.

"suiteAvailability": {
                        "type": "long"
                    }

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