# Failed to execute bulk item cannot be changed from type

**URL:** <https://discuss.elastic.co/t/failed-to-execute-bulk-item-cannot-be-changed-from-type/153445>\
**Category:** Elasticsearch\
**Created:** [October 22, 2018, 4:15pm UTC](https://discuss.elastic.co/t/failed-to-execute-bulk-item-cannot-be-changed-from-type/153445 "2018-10-22T16:15:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jishnu\_Prathap](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jishnu\_Prathap](https://discuss.elastic.co/u/Jishnu_Prathap)\
**Post date:** [October 22, 2018, 4:15pm UTC](https://discuss.elastic.co/t/failed-to-execute-bulk-item-cannot-be-changed-from-type/153445/1 "2018-10-22T16:15:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [October 23, 2018, 11:40am UTC](https://discuss.elastic.co/t/failed-to-execute-bulk-item-cannot-be-changed-from-type/153445/2 "2018-10-23T11:40:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jishnu\_Prathap](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jishnu\_Prathap](https://discuss.elastic.co/u/Jishnu_Prathap)\
**Post date:** [October 26, 2018, 9:19am UTC](https://discuss.elastic.co/t/failed-to-execute-bulk-item-cannot-be-changed-from-type/153445/3 "2018-10-26T09:19:14Z")

</div>

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

```auto
"suiteAvailability": {
                        "type": "long"
                    }

```

---

<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:** [November 23, 2018, 9:19am UTC](https://discuss.elastic.co/t/failed-to-execute-bulk-item-cannot-be-changed-from-type/153445/4 "2018-11-23T09:19:15Z")

</div>

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