# Logstash + Elasticsearch returns class\_cast\_exception error

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-returns-class-cast-exception-error/117774>\
**Category:** Elasticsearch\
**Created:** [January 31, 2018, 9:10am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-returns-class-cast-exception-error/117774 "2018-01-31T09:10:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![riccardo](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@riccardo](https://discuss.elastic.co/u/riccardo)\
**Post date:** [January 31, 2018, 9:10am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-returns-class-cast-exception-error/117774/1 "2018-01-31T09:10:31Z")

</div>

Hi,

I currently have an intermittent problem:  
logstash fails to index documents in elasticsearch and gets:

```
[logstash.outputs.elasticsearch] retrying failed action with response code: 500 ({"type"=>"class_cast_exception", "reason"=>nil})

```

I suspect is some kind of malformed document. How can I get more information about this? I have tried to log this but due to the amount of logs and its intermittent nature it's difficult to see what document it's causing this.

Any hint on how could I debug this would be greatly appreciated!

Thanks

---

<div class="post-metadata">

**Author:** ![jpcarey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpcarey/32/46668_2.png) [@jpcarey](https://discuss.elastic.co/u/jpcarey)\
**Post date:** [January 31, 2018, 12:09pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-returns-class-cast-exception-error/117774/2 "2018-01-31T12:09:52Z")

</div>

The elasticsearch log should contain a more detailed error on what might be happening.

---

<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:** [February 28, 2018, 12:09pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-returns-class-cast-exception-error/117774/3 "2018-02-28T12:09:55Z")

</div>

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