# Errors while uploading data into elasticsearch

**URL:** <https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582>\
**Category:** Elasticsearch\
**Created:** [April 19, 2019, 8:42am UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582 "2019-04-19T08:42:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prabhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhav/32/64630_2.png) [@Prabhav](https://discuss.elastic.co/u/Prabhav)\
**Post date:** [April 19, 2019, 8:42am UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/1 "2019-04-19T08:42:43Z")

</div>

![Capture](https://us1.discourse-cdn.com/elastic/original/3X/8/3/8324dc08bcd182cfde078a191b89742fd06a2591.png)  
I have already created a mapping for my index that is pmufin and have been trying to upload a json document of 16MB. I am using virtual box. Whenever i try to upload data from Postman or just use curl command i get errors like 400 or 406. I have tried every possibility from using bulk api and doing everything back and forth. Anyone having any idea how to make this work?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 19, 2019, 10:14am UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/2 "2019-04-19T10:14:15Z")

</div>

Please don't post pictures of text, they are difficult to read and some people may not be even able to see them.

---

<div class="post-metadata">

**Author:** ![Prabhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhav/32/64630_2.png) [@Prabhav](https://discuss.elastic.co/u/Prabhav)\
**Post date:** [April 19, 2019, 1:59pm UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/3 "2019-04-19T13:59:25Z")

</div>

I think it's pretty visible and uploaded the screenshot of the screen because it explains the scenario i am trying to describe better.

The commad that I using here is

**prabhav@prabhav-VirtualBox:~/Downloads$** curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/pmufin/pmuonline/\_bulk?pretty' --data-binary @"home/prabhav/Downloads/csvjson.json"

The reason the directory is at Downloads because the file csvjson.json is stored in Downloads.

_The error I am getting is:-_  
Warning: Couldn't read data from file "home/prabhav/Downloads/csvjson.json",  
Warning: this makes an empty POST.  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "parse\_exception",  
"reason" : "request body is required"  
}  
],  
"type" : "parse\_exception",  
"reason" : "request body is required"  
},  
"status" : 400  
}  
Sometimes i also get error 406.  
I have tried every way possible to resolve the issue and used everything but always end up getting either of the errors or parsing errors.

---

<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 19, 2019, 5:06pm UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/4 "2019-04-19T17:06:51Z")

</div>

I'd probably use `/home/prabhav/Downloads/csvjson.json`

---

<div class="post-metadata">

**Author:** ![Prabhav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhav/32/64630_2.png) [@Prabhav](https://discuss.elastic.co/u/Prabhav)\
**Post date:** [April 19, 2019, 5:13pm UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/5 "2019-04-19T17:13:14Z")

</div>

I just tried **/home/prabhav/Downloads/csvjson.json**  
But this still gives me the same error.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 19, 2019, 7:03pm UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/6 "2019-04-19T19:03:46Z")

</div>

The error message you're getting is here:

`Couldn't read data from file "home/prabhav/Downloads/csvjson.json",`

This means it can't read the file. Maybe it's the wrong filename, maybe it's a permission problem, maybe it's something else entirely. You'll need to fix this yourself, sorry, we can't work out how to make this file readable.

---

<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 17, 2019, 7:03pm UTC](https://discuss.elastic.co/t/errors-while-uploading-data-into-elasticsearch/177582/7 "2019-05-17T19:03:47Z")

</div>

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