# Issues with Bulk Sending data

**URL:** <https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694>\
**Category:** Elasticsearch\
**Created:** [March 23, 2020, 4:44pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694 "2020-03-23T16:44:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![adwaitjoshi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adwaitjoshi/32/35098_2.png) [@adwaitjoshi](https://discuss.elastic.co/u/adwaitjoshi)\
**Post date:** [March 23, 2020, 4:44pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/1 "2020-03-23T16:44:02Z")

</div>

I am having a weird issue. I have a index template setup and I created an index. I tried sending data from dev inside KIBANA and it worked. One document went in. But when I try to send bulk through my code using python I get this error. Any ideas whats going wrong?

```auto

java.lang.IllegalArgumentException: Rejecting mapping update to [xxxxxxxxxxxxxx] as the final mapping would have more than 1 type: [_doc, xxxxxxxx]
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:272) ~[elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:238) ~[elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) ~[elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) ~[elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.6.0.jar:7.6.0]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.6.0.jar:7.6.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:830) [?:?]

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 23, 2020, 5:54pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/2 "2020-03-23T17:54:39Z")

</div>

Hard to tell without knowing **exactly** what you are doing. I can just explain what the error message tells:

> ```
> Rejecting mapping update to [xxxxxxxxxxxxxx] as the final mapping would have more than 1 type: [_doc, xxxxxxxx]
> 
> ```

It's like you're doing something like:

```auto
DELETE /xxxxxxxxxxxxxx
PUT /xxxxxxxxxxxxxx
PUT /xxxxxxxxxxxxxx/_doc/1
{
  "foo": "bar"
}
PUT /xxxxxxxxxxxxxx/xxxxxxxx/1
{
  "foo": "bar"
}

```

Which is wrong.

---

<div class="post-metadata">

**Author:** ![adwaitjoshi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adwaitjoshi/32/35098_2.png) [@adwaitjoshi](https://discuss.elastic.co/u/adwaitjoshi)\
**Post date:** [March 23, 2020, 6:12pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/3 "2020-03-23T18:12:25Z")

</div>

Thanks for the response. The error is coming in bulk ingest though so 100 documents go in Python directly. Oddly enough, if I send through log stash it goes in.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 23, 2020, 7:34pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/4 "2020-03-23T19:34:42Z")

</div>

Sure but you still don't tell what exact steps you are doing, like your logstash config, your index templates or mappings.

---

<div class="post-metadata">

**Author:** ![adwaitjoshi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adwaitjoshi/32/35098_2.png) [@adwaitjoshi](https://discuss.elastic.co/u/adwaitjoshi)\
**Post date:** [March 23, 2020, 7:38pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/5 "2020-03-23T19:38:27Z")

</div>

AH! I have a template with all the values setup in Elastic. I create the index name\* so that it takes the template. Then I generate a dataset in my application, convert the dataset to JSON and send it to Elastic. If I pick "one" of the document and send it from Kibana UI it works, when I send the bulk messages 500 at a time it craps out.

Unfortunately due to the sensitivity of the designs, I cant share the exact layout.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 23, 2020, 8:00pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/6 "2020-03-23T20:00:29Z")

</div>

So I can't help more.

I can just tell that you need to check which document type is used.

---

<div class="post-metadata">

**Author:** ![adwaitjoshi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adwaitjoshi/32/35098_2.png) [@adwaitjoshi](https://discuss.elastic.co/u/adwaitjoshi)\
**Post date:** [March 23, 2020, 8:35pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/7 "2020-03-23T20:35:03Z")

</div>

When you say which document type is used? You mean in the actual bulk messages? Can you point me to the documentation section for what you are taking about so I can take a look?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 23, 2020, 10:43pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/8 "2020-03-23T22:43:58Z")

</div>

It can be in bulk. It can be in logstash configuration. It can be in index templates.

---

<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:** [April 20, 2020, 10:46pm UTC](https://discuss.elastic.co/t/issues-with-bulk-sending-data/224694/9 "2020-04-20T22:46:31Z")

</div>

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