# \[solved\] - BulkIndexError - Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes

**URL:** <https://discuss.elastic.co/t/solved-bulkindexerror-compressor-detection-can-only-be-called-on-some-xcontent-bytes-or-compressed-xcontent-bytes/181725>\
**Category:** Elasticsearch\
**Created:** [May 19, 2019, 9:34pm UTC](https://discuss.elastic.co/t/solved-bulkindexerror-compressor-detection-can-only-be-called-on-some-xcontent-bytes-or-compressed-xcontent-bytes/181725 "2019-05-19T21:34:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JH82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jh82/32/45952_2.png) [@JH82](https://discuss.elastic.co/u/JH82)\
**Post date:** [May 19, 2019, 9:34pm UTC](https://discuss.elastic.co/t/solved-bulkindexerror-compressor-detection-can-only-be-called-on-some-xcontent-bytes-or-compressed-xcontent-bytes/181725/1 "2019-05-19T21:34:02Z")

</div>

Hello !

I've problem with bulkinsert. I don't understand this error  
`('Unexpected error:', (<class 'elasticsearch.helpers.errors.BulkIndexError'>, BulkIndexError('7 document(s) failed to index.', [{u'index': {u'status': 400, u'_type': u'doc_type', u'_index': u'esm_v1-20190519', u'error': {u'caused_by': {u'reason': u'Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes', u'type': u'not_x_content_exception'}, u'reason': u'failed to parse', u'type': u'mapper_parsing_exception'}`

Same document work fine (no mapping problem), when I insert them one by one.

Any idea about the reason of BulkIndexError ?

Regards.

---

<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:** [May 20, 2019, 6:27am UTC](https://discuss.elastic.co/t/solved-bulkindexerror-compressor-detection-can-only-be-called-on-some-xcontent-bytes-or-compressed-xcontent-bytes/181725/2 "2019-05-20T06:27:27Z")

</div>

Have you formatted your requests in the [bulk format](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-bulk.html)? How are you indexing the data?

---

<div class="post-metadata">

**Author:** ![JH82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jh82/32/45952_2.png) [@JH82](https://discuss.elastic.co/u/JH82)\
**Post date:** [May 24, 2019, 7:15pm UTC](https://discuss.elastic.co/t/solved-bulkindexerror-compressor-detection-can-only-be-called-on-some-xcontent-bytes-or-compressed-xcontent-bytes/181725/3 "2019-05-24T19:15:05Z")

</div>

yes, it was that AND an error in value  
[{"a":"1"}] au lieu de {"a":"1"}

thank you !

---

<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:** [June 21, 2019, 7:15pm UTC](https://discuss.elastic.co/t/solved-bulkindexerror-compressor-detection-can-only-be-called-on-some-xcontent-bytes-or-compressed-xcontent-bytes/181725/4 "2019-06-21T19:15:18Z")

</div>

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