# Elasticsearch stopped accepting specific documents

**URL:** <https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417>\
**Category:** Elasticsearch\
**Created:** [March 3, 2016, 4:44pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417 "2016-03-03T16:44:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [March 3, 2016, 4:44pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/1 "2016-03-03T16:44:54Z")

</div>

Hi,

I'm trying to figure out something that happened to me just today, where Elasticsearch suddenly refuses to accept certain documents from logstash.  
latest versions of both (2.2.0 and 2.2.2)

this is the error i get in logstash:

```
	"create" => {
		"_index" => "logstash-2016.03.03", "_type" => "messages", "_id" => "AVM9UIT24Ex8CdW4NE8u", "status" => 400, "error" => {
			"type" => "illegal_argument_exception", "reason" => "Field [body] is defined as a field in mapping [internalServerErrorReport] but this name is already used for an object in other types"
		}

```

please help!  
thanks in advance  
Benjamin

---

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [March 6, 2016, 9:05am UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/2 "2016-03-06T09:05:12Z")

</div>

got another related error in logstash...

pretty sure its the relevant to the same issue:

"error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Can't merge a non object mapping [[body.xxx](http://body.xxx)] with an object mapping [[body.xxx](http://body.xxx)]"}}}

any ideas?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 6, 2016, 9:25pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/3 "2016-03-06T21:25:34Z")

</div>

It seems like the 'body' field in the index is mapped as an object in some types and that you are then trying to index documents where it instead is mapped as a field, which causes a mapping conflict, preventing the documents to be indexed. Look at the mappings for the index as well as the documents that get rejected.

---

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [March 7, 2016, 7:47am UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/4 "2016-03-07T07:47:39Z")

</div>

so just to verify that I understand correctly, when I send a document with "body" for example as a json object, and elasticsearch already has a mapping of "body" as field\string, so this happens?

how can I overcome this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 7, 2016, 8:08am UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/5 "2016-03-07T08:08:15Z")

</div>

A field can only have one mapping in an index, so you will need to either rename the field with one of the mappings or index it into a different index.

---

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [March 7, 2016, 8:52am UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/6 "2016-03-07T08:52:57Z")

</div>

in something like this for example, how can i go about finding the problematic Fields and mappings?

```
[2016-03-07 08:32:54,156][DEBUG][action.bulk] [ip-xxxxxxx] [logstash-2016.03.07][4] failed to execute bulk item (index) index {[logstash-2016.03.07][internalServerErrorReport][AVNQNZoswu293zyTaS8A], source[{"url":"http://xx.xx.xx:xx/v1/registration/device/pushCredentials?userId=xxxx&domain=xxxx.com&deviceId=xxxxxx","shortUrl":"http://xxx.xxx.xxx:xxxx/v1/registration/device/pushCredentials_post","type":"internalServerErrorReport","error":null,"body":"{\"pushPlatform\":\"xxxx\",\"clientSwVersion\":xxxx,\"credentials\":{\"token\":\"xxxx\",\"bundle_id\":\"xxxx\"},\"restVersion\":\"1.2\"}","responseBody":"{\"error\":\"No row object under ROOT!\"}","statusCode":500,"APIVersion":"1.2","@version":"1","@timestamp":"2016-03-07T08:30:39.614Z","host":"xxxxxx"}]}
java.lang.IllegalArgumentException: Field [body] is defined as a field in mapping [internalServerErrorReport] but this name is already used for an object in other types
```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 7, 2016, 8:58am UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/7 "2016-03-07T08:58:40Z")

</div>

Use the [get mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-get-mapping.html) to get the mapping in use for the index the error is reported for and compare this to the document the error was thrown for.

---

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [March 8, 2016, 2:33pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/8 "2016-03-08T14:33:24Z")

</div>

Hi again,  
I just want to get this straight... I cannot have same name fields with different mappings? while on different types?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 8, 2016, 3:42pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/9 "2016-03-08T15:42:19Z")

</div>

That is correct. It is enforced per index in Elasticsearch 2.x.

---

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [March 8, 2016, 4:12pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/10 "2016-03-08T16:12:10Z")

</div>

thank you very much.

just out of curiosity, is there some documentation or maybe you can explain to me shortly, what is the rational behind this enforcement?  
a lot of people in our company were quite surprised to hear about this, and consider it to be a limitation from our point of view... (everything was working fine in 1.x)

---

<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:** [July 5, 2017, 11:10pm UTC](https://discuss.elastic.co/t/elasticsearch-stopped-accepting-specific-documents/43417/11 "2017-07-05T23:10:17Z")

</div>


