Errors while uploading data into elasticsearch

(Gupta) #1

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?

(Mark Walkom) #2

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

(Gupta) #3

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.

(David Pilato) #4

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

(Gupta) #5

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

(David Turner) #6

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.

(system) closed #7

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