Failed to parse, document is empty

I an new to Elasticsearch and am having some start-up problems.
I've successfully installed it and am able to connect to the server and create an index.
However when I attempt to load data either via curl or the Perl Search::Elastic interface I receive
the following error message:

{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "failed to parse, document is empty"
}
],
"type" : "mapper_parsing_exception",
"reason" : "failed to parse, document is empty"
},
"status" : 400
}
The sample curl interface is:
curl -XPUT 'http://elastic:changeme@admin.ih.lucent.com:9200/twitter/tweet/1?pretty' -d ' {
"user": "kimchy",
"post_date": "2009-11-15T13:12:00",
"message": "Trying out Elasticsearch, so far so good?"
}'

I have installed Elasticsearch 5.0.0 on a Solaris 10 Sun -Fire 440.

Any help would be appreciated, thank you!

have you tried the curl call from the same system you are running the perl script on? Is that one working or returning the same exception? The curl call looks good.

--Alex

Alex,

It is on the same system.
Thank you for your reply.

Jeff Gajda
Software Engineer, Documentation Delivery
IP/Optical Networks, Nokia
Jeff.Gajda@nokia.commailto:Jeff.Gajda@alcatel-lucent.com

HEy,

can you show the output of the curl call? Can you also include the whole stack trace from the elasticsearch log file? Thanks.

--Alex

Alex,

Following is the output of the curl call:
admin-slimmerk: cat tc.sh
curl -XPUT 'http://elastic:changeme@admin.ih.lucent.com:9200/twitter/tweet/1?pretty' -d ' {
"user": "kimchy",
"post_date": "2009-11-15T13:12:00",
"message": "Trying out Elasticsearch, so far so good?"
}'

admin-slimmerk: date
Mon Feb 27 14:20:40 EST 2017
admin-slimmerk: tc.sh
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "failed to parse, document is empty"
}
],
"type" : "mapper_parsing_exception",
"reason" : "failed to parse, document is empty"
},
"status" : 400

Oddly, the curl call that is failing is not producing any output to the elasticsearch.log file, though other commands are:
root@admin # tail elasticsearch.log
[2017-02-27T09:59:53,990][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:11:40,391][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:13:33,623][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:21:39,752][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:21:54,950][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:31:42,880][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:32:31,800][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T10:35:39,529][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [twitter] creating index, cause [auto(index api)], templates [], shards [5]/[1], mappings []
[2017-02-27T10:54:12,731][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [tsttop] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2017-02-27T12:02:55,085][INFO ][o.e.c.m.MetaDataCreateIndexService] [fr6eY41] [myapp] creating index, cause [api], templates [], shards [5]/[1], mappings []

Note the timestamps in yellow.

Also, could this be happening because I am running on Solaris?
I just noticed that it is not one of the supported platforms. I decided to take a chance anyhow pursuing it as it is a Java app.
Thank you again for taking the time to look into this and get back to me.

Jeff Gajda
Software Engineer, Documentation Delivery
IP/Optical Networks, Nokia
Jeff.Gajda@nokia.commailto:Jeff.Gajda@alcatel-lucent.com

Hey,

solaris is indeed not a supported platform (see here), but I have the feeling that this issue is more on the client side of things, as Elasticsearch misses a HTTP body to process, however my solaris skills pretty much end here. Something like set -x and more verbose output for curl would be helpful, but not sure that is supported by the shell you are using (requires bash).

--Alex

Alex,

I made some progress.
I decided to start anew with the latest Elasticsearch 5.2.1.
I downloaded and installed it. Then changed owner and group in the install directory to daemon, which is what the service is to be running at.
I changed network.host from 192.168.0.1 to 0.0.0.0, start elasticsearch nohup in the background and now I am able connect and insert data ( I believe……)
Solaris would not be my ideal choice as it is not supported by I am stuck with that for now and am going to proceed on that track until I can get on a current Linux box.
Thank you again for your help.

Jeff Gajda
Software Engineer, Documentation Delivery
IP/Optical Networks, Nokia
Jeff.Gajda@nokia.commailto:Jeff.Gajda@alcatel-lucent.com

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