# Unable to load the dataset from json

**URL:** <https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611>\
**Category:** Elasticsearch\
**Created:** [April 11, 2018, 10:37am UTC](https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611 "2018-04-11T10:37:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aravind\_apalya](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@aravind\_apalya](https://discuss.elastic.co/u/aravind_apalya)\
**Post date:** [April 11, 2018, 10:37am UTC](https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611/1 "2018-04-11T10:37:35Z")

</div>

Hi,

Just I have started tutorial on elasticstic search, while loading the data from json i am getting following exception:  
My request is:  
`curl -H "Content-Type: application/json" -XPOST "http://localhost:9200/bank/_doc/_bulk?pretty&refresh" --data-binary "@accounts.json"`

Error is:  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "illegal\_argument\_exception",  
"reason" : "The bulk request must be terminated by a newline [\n]"  
}  
],  
"type" : "illegal\_argument\_exception",  
"reason" : "The bulk request must be terminated by a newline [\n]"  
},  
"status" : 400  
}

You can find accounts.json here: [here](https://raw.githubusercontent.com/elastic/elasticsearch/master/docs/src/test/resources/accounts.json)  
My elastic version is: 6.2.3  
Can anyone assist me

Thanks,  
Aravind

---

<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:** [April 11, 2018, 10:59am UTC](https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611/2 "2018-04-11T10:59:22Z")

</div>

Probably you are missing a new line after the last element ?

---

<div class="post-metadata">

**Author:** ![aravind\_apalya](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@aravind\_apalya](https://discuss.elastic.co/u/aravind_apalya)\
**Post date:** [April 11, 2018, 12:14pm UTC](https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611/3 "2018-04-11T12:14:09Z")

</div>

Yes David,

You are correct, after entering new line it got resolved.

Thank you so much

---

<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:** [April 11, 2018, 12:40pm UTC](https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611/4 "2018-04-11T12:40:48Z")

</div>

Out of curiosity why did not you find that by yourself based on the error message you got:

> The bulk request must be terminated by a newline [\n]

---

<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:** [May 9, 2018, 12:40pm UTC](https://discuss.elastic.co/t/unable-to-load-the-dataset-from-json/127611/5 "2018-05-09T12:40:50Z")

</div>

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