# Elasticsearch bulk request error

**URL:** <https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830>\
**Category:** Elasticsearch\
**Created:** [June 3, 2016, 8:34pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830 "2016-06-03T20:34:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishi\_shah](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rishi\_shah](https://discuss.elastic.co/u/rishi_shah)\
**Post date:** [June 3, 2016, 8:34pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830/1 "2016-06-03T20:34:18Z")

</div>

Hi,  
I am using this elasticsearch go lib- [oliver](https://github.com/olivere/elastic/), I am sending the data to my elastic cluster using the bulk request. But sometimes its failed and showing me this error - "unexpected end of JSON input".  
I read many articles about elasticsearch bulk method issues, I guess many developers are facing this problem.  
Can someone help me?

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [June 5, 2016, 1:58pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830/2 "2016-06-05T13:58:27Z")

</div>

It's likely either a problem with the client itself, or how you are providing bulk data to the client. That exception means the bulk syntax was malformed somehow: missing a closing brace, missing the final new-line, bad metadata-action pairs, etc.

---

<div class="post-metadata">

**Author:** ![rishi\_shah](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rishi\_shah](https://discuss.elastic.co/u/rishi_shah)\
**Post date:** [June 5, 2016, 4:52pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830/3 "2016-06-05T16:52:53Z")

</div>

I am taking the data from twitter streaming api. I printed all my data. All the json objects coming from the Twitter sound well formatted.

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [June 5, 2016, 5:25pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830/4 "2016-06-05T17:25:17Z")

</div>

I'd probably lodge a ticket with the Client author to verify everything is being serialized correctly then. You could also capture the packets en-route to the server to make sure it looks good too.

---

<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, 10:46pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-request-error/51830/5 "2017-07-05T22:46:07Z")

</div>


