# \_bulk indexing problem

**URL:** <https://discuss.elastic.co/t/-bulk-indexing-problem/4869>\
**Category:** Elasticsearch\
**Created:** [July 15, 2011, 6:39am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869 "2011-07-15T06:39:41Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 6:39am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/1 "2011-07-15T06:39:41Z")

</div>

Hi All,

I had a problem with bulk indexing. here is a sample query that I was  
using for it. Not sure what's the problem butt getting an error  
message below:

curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '{ "index" : { "\_index" :  
"profusion\_db", "\_type" : "service\_index", "\_id" : "1" } }

{ "field1" : "value1" }

'

Result is:

{"error":"[\_bulk] Invalid index name [_bulk], must not start with  
'_'"}

Any help will be really really appreciated 🙂

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 15, 2011, 8:41am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/2 "2011-07-15T08:41:48Z")

</div>

On Thu, 2011-07-14 at 23:39 -0700, Michael wrote:

> Hi All,
> 
> I had a problem with bulk indexing. here is a sample query that I was  
> using for it. Not sure what's the problem butt getting an error  
> message below:
> 
> curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '{ "index" : { "\_index" :  
> "profusion\_db", "\_type" : "service\_index", "\_id" : "1" } }
> 
> { "field1" : "value1" }
> 
> '
> 
> Result is:
> 
> {"error":"[\_bulk] Invalid index name [_bulk], must not start with  
> '_'"}
> 
> Any help will be really really appreciated 🙂

You have too many newlines. Are you on windows perhaps? Try this:

curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '  
{ "index" : { "\_index" :"profusion\_db", "\_type" : "service\_index","\_id" : "1" } }  
{ "field1" : "value1" }  
'

clint

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 9:39am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/3 "2011-07-15T09:39:28Z")

</div>

Actually the newlines are just copy/paste issues. The same error even  
with reduced newlines.

BTW I'm running elasticsearch on Mac OS X 10.6.8. Using Elasticsearch  
0.16.4

Regards,  
Michael

On Jul 15, 1:41 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Thu, 2011-07-14 at 23:39 -0700, Michael wrote:
> 
> > Hi All,
> 
> > I had a problem with bulk indexing. here is a sample query that I was  
> > using for it. Not sure what's the problem butt getting an error  
> > message below:
> 
> > curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '{ "index" : { "\_index" :  
> > "profusion\_db", "\_type" : "service\_index", "\_id" : "1" } }
> 
> > { "field1" : "value1" }
> 
> > '
> 
> > Result is:
> 
> > {"error":"[\_bulk] Invalid index name [_bulk], must not start with  
> > '_'"}
> 
> > Any help will be really really appreciated 🙂
> 
> You have too many newlines. Are you on windows perhaps? Try this:
> 
> curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '  
> { "index" : { "\_index" :"profusion\_db", "\_type" : "service\_index","\_id" : "1" } }  
> { "field1" : "value1" }  
> '
> 
> clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 15, 2011, 9:47am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/4 "2011-07-15T09:47:28Z")

</div>

Hi Michael

> BTW I'm running elasticsearch on Mac OS X 10.6.8. Using Elasticsearch  
> 0.16.4

I'm on linux with 0.16.4, and this works for me:

curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '  
{ "index" : { "\_index" :"profusion\_db", "\_type" : "service\_index","\_id" : "1" } }  
{ "field1" : "value1" }  
'  
{"took":12,"items":[{"index":{"\_index":"profusion\_db","\_type":"service\_index","\_id":"1","\_version":1,"ok":true}}]}

clint

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 9:58am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/5 "2011-07-15T09:58:01Z")

</div>

I've tried the same query on linux as well getting the same error. Is  
it possible that I've a wrong configuration?

On Jul 15, 2:47 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> Hi Michael
> 
> > BTW I'm running elasticsearch on Mac OS X 10.6.8. Using Elasticsearch  
> > 0.16.4
> 
> I'm on linux with 0.16.4, and this works for me:
> 
> curl -X PUT "[http://localhost:9200/\_bulk](http://localhost:9200/_bulk)" -d '  
> { "index" : { "\_index" :"profusion\_db", "\_type" : "service\_index","\_id" : "1" } }  
> { "field1" : "value1" }  
> '  
> {"took":12,"items":[{"index":{"\_index":"profusion\_db","\_type":"service\_inde x","\_id":"1","\_version":1,"ok":true}}]}
> 
> clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 15, 2011, 10:12am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/6 "2011-07-15T10:12:23Z")

</div>

On Fri, 2011-07-15 at 02:58 -0700, Michael wrote:

> I've tried the same query on linux as well getting the same error. Is  
> it possible that I've a wrong configuration?

I don't know what configuration could affect this.

Try it on a new install and see if that works

I'm wondering if what you're pasting has got \r\n line endings, and that  
is affecting it.

Try saving the command to a file, running dos2unix on it, and running it  
as a shell script.

clint

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 10:43am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/7 "2011-07-15T10:43:35Z")

</div>

Tried with explicit dos2unix as well no effect. Getting the same error  
as before.

On Jul 15, 3:12 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2011-07-15 at 02:58 -0700, Michael wrote:
> 
> > I've tried the same query on linux as well getting the same error. Is  
> > it possible that I've a wrong configuration?
> 
> I don't know what configuration could affect this.
> 
> Try it on a new install and see if that works
> 
> I'm wondering if what you're pasting has got \r\n line endings, and that  
> is affecting it.
> 
> Try saving the command to a file, running dos2unix on it, and running it  
> as a shell script.
> 
> clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 15, 2011, 10:54am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/8 "2011-07-15T10:54:28Z")

</div>

On Fri, 2011-07-15 at 03:43 -0700, Michael wrote:

> Tried with explicit dos2unix as well no effect. Getting the same error  
> as before.

I tried the other way around (unix2dos) and that still succeeded.

And if I tried with extra new lines, I got:

```
Unexpected end-of-input within/between OBJECT entries

```

so it's not that either.

I'm a bit stumped. What do you have in your config? Are you using index  
templates or something?

Have you tried on a new install?

Just to be absolutely sure that we're doing the same thing, I attach a  
shell script. Just run it as: bash t.sh

clint

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 11:39am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/9 "2011-07-15T11:39:08Z")

</div>

Thanks a lot for helping to figure out the issue. I've run the  
attachement and no success. I'm not using any index template at all.  
And actually I'm running on a fresh install locally on my mac.

Regards,  
Michael

On Jul 15, 3:54 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2011-07-15 at 03:43 -0700, Michael wrote:
> 
> > Tried with explicit dos2unix as well no effect. Getting the same error  
> > as before.
> 
> I tried the other way around (unix2dos) and that still succeeded.
> 
> And if I tried with extra new lines, I got:
> 
> ```
> Unexpected end-of-input within/between OBJECT entries
> 
> ```
> 
> so it's not that either.
> 
> I'm a bit stumped. What do you have in your config? Are you using index  
> templates or something?
> 
> Have you tried on a new install?
> 
> Just to be absolutely sure that we're doing the same thing, I attach a  
> shell script. Just run it as: bash t.sh
> 
> clint
> 
> t.sh  
> \< 1KViewDownload

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 11:42am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/10 "2011-07-15T11:42:31Z")

</div>

Here is what I have in my elasticsearch.yml config file:

node :  
data : true  
gateway :  
type : fs  
index :  
analysis :  
analyzer :  
default :  
type : custom  
tokenizer : standard  
filter : [standard, lowercase, porterStem, stop]

#network.publish\_host: 192.168.50.1  
network.publish\_host: 127.0.0.1  
network.bind\_host: 127.0.0.1  
network.host: 127.0.0.1

node.data: true # Default

http.port: 9200 # Default  
http.max\_content\_length: 100 # Default

cluster.name: "Profusion"

#discovery.zen.ping.unicast.hosts: 192.168.50.2:9300  
#discovery.zen.fd.initial\_ping\_timeout: 30 # Default  
#discovery.zen.fd.fdping\_interval: 10 # Default  
#discovery.zen.fd.ping\_retries: 30 # Default

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 15, 2011, 12:11pm UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/11 "2011-07-15T12:11:30Z")

</div>

On Fri, 2011-07-15 at 04:42 -0700, Michael wrote:

> Here is what I have in my elasticsearch.yml config file:

OK - I tried with this config, and it still worked fine.

Are you absolutely sure that you're using v 0.16.4 (sorry to ask, but  
I'm clutching at straws). You can see the version with:

curl localhost:9200

Not related but you're specifying gateway.type: fs, but you're not  
specifying the dir to use for the shared fs gateway.

Just use the default gateway.

clint

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 12:32pm UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/12 "2011-07-15T12:32:11Z")

</div>

Oppps ... I've installed v 0.16.4 but was running v 0.9.1. Fixed the  
version and got it working. Thank you very much for your time and  
sorry again for taking that much time from you.

Regards,  
Michael

On Jul 15, 5:11 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2011-07-15 at 04:42 -0700, Michael wrote:
> 
> > Here is what I have in my elasticsearch.yml config file:
> 
> OK - I tried with this config, and it still worked fine.
> 
> Are you absolutely sure that you're using v 0.16.4 (sorry to ask, but  
> I'm clutching at straws). You can see the version with:
> 
> curl localhost:9200
> 
> Not related but you're specifying gateway.type: fs, but you're not  
> specifying the dir to use for the shared fs gateway.
> 
> Just use the default gateway.
> 
> clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 15, 2011, 5:17pm UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/13 "2011-07-15T17:17:04Z")

</div>

Heya, some notes on the config:

1. Its enough to set network.host to a single value.
2. The http.max\_content\_length should default to 100mb, not 100 🙂

On Friday, July 15, 2011 at 2:42 PM, Michael wrote:

> Here is what I have in my elasticsearch.yml config file:
> 
> node :  
> data : true  
> gateway :  
> type : fs  
> index :  
> analysis :  
> analyzer :  
> default :  
> type : custom  
> tokenizer : standard  
> filter : [standard, lowercase, porterStem, stop]
> 
> #network.publish\_host: 192.168.50.1  
> network.publish\_host: 127.0.0.1  
> network.bind\_host: 127.0.0.1  
> network.host: 127.0.0.1
> 
> node.data: true # Default
> 
> http.port: 9200 # Default  
> http.max\_content\_length: 100 # Default
> 
> cluster.name ([http://cluster.name](http://cluster.name)): "Profusion"
> 
> #discovery.zen.ping.unicast.hosts: 192.168.50.2:9300  
> #discovery.zen.fd.initial\_ping\_timeout: 30 # Default  
> #discovery.zen.fd.fdping\_interval: 10 # Default  
> #discovery.zen.fd.ping\_retries: 30 # Default

---

<div class="post-metadata">

**Author:** ![michaelvalasanyan](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@michaelvalasanyan](https://discuss.elastic.co/u/michaelvalasanyan)\
**Post date:** [July 15, 2011, 5:20pm UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/14 "2011-07-15T17:20:26Z")

</div>

I've already changed 100 to 100mb 🙂 thanks anyway :))

Regards,  
Michael

On Jul 15, 10:17 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Heya, some notes on the config:
> 
> 1. Its enough to set network.host to a single value.
> 2. The http.max\_content\_length should default to 100mb, not 100 🙂
> 
> On Friday, July 15, 2011 at 2:42 PM, Michael wrote:
> 
> > Here is what I have in my elasticsearch.yml config file:
> 
> > node :  
> > data : true  
> > gateway :  
> > type : fs  
> > index :  
> > analysis :  
> > analyzer :  
> > default :  
> > type : custom  
> > tokenizer : standard  
> > filter : [standard, lowercase, porterStem, stop]
> 
> > #network.publish\_host: 192.168.50.1  
> > network.publish\_host: 127.0.0.1  
> > network.bind\_host: 127.0.0.1  
> > network.host: 127.0.0.1
> 
> > node.data: true # Default
> 
> > http.port: 9200 # Default  
> > http.max\_content\_length: 100 # Default
> 
> > cluster.name ([http://cluster.name](http://cluster.name)):"Profusion"
> 
> > #discovery.zen.ping.unicast.hosts: 192.168.50.2:9300  
> > #discovery.zen.fd.initial\_ping\_timeout: 30 # Default  
> > #discovery.zen.fd.fdping\_interval: 10 # Default  
> > #discovery.zen.fd.ping\_retries: 30 # Default

---

<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 6, 2017, 4:00am UTC](https://discuss.elastic.co/t/-bulk-indexing-problem/4869/15 "2017-07-06T04:00:30Z")

</div>


