# Not able to do \_bulk request. Throwing ActionRequestValidationException Error

**URL:** <https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494>\
**Category:** Elasticsearch\
**Created:** [October 31, 2010, 4:39am UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494 "2010-10-31T04:39:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![smruti](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@smruti](https://discuss.elastic.co/u/smruti)\
**Post date:** [October 31, 2010, 4:39am UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/1 "2010-10-31T04:39:29Z")

</div>

Hi,

The bulk operation is throwing error. Could someone please have a  
look. I read some earlier posts but did not get any clue. i am running  
0.12 elastic search version.

Error :  
response status: 500  
{u'error': u'ActionRequestValidationException[Validation Failed:  
1: no requests added]'}

Request :

making POST request to path: localhost 9200 /\_bulk with body: "{"index  
": {"\_type": "india", "\_index": "location"}}\n{"timezone":  
"Asia/Kolkata", "location": {"lat": "27.75", "lon":  
"88.26667"}, "id": "1252676", "name": "Zemu Glacier"}\n"

Thanks  
Smruti

---

<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:** [October 31, 2010, 8:52am UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/2 "2010-10-31T08:52:24Z")

</div>

The format is bulk API has changed in 0.12, it requires setting \_index,  
\_type and \_id (and not index, type, and id).

-shay.banon

On Sun, Oct 31, 2010 at 6:39 AM, Smruti [smruti.parida@gmail.com](mailto:smruti.parida@gmail.com) wrote:

> Hi,
> 
> The bulk operation is throwing error. Could someone please have a  
> look. I read some earlier posts but did not get any clue. i am running  
> 0.12 Elasticsearch version.
> 
> Error :  
> response status: 500  
> {u'error': u'ActionRequestValidationException[Validation Failed:  
> 1: no requests added]'}
> 
> Request :
> 
> making POST request to path: localhost 9200 /\_bulk with body: "{"index  
> ": {"\_type": "india", "\_index": "location"}}\n{"timezone":  
> "Asia/Kolkata", "location": {"lat": "27.75", "lon":  
> "88.26667"}, "id": "1252676", "name": "Zemu Glacier"}\n"
> 
> Thanks  
> Smruti

---

<div class="post-metadata">

**Author:** ![smruti](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@smruti](https://discuss.elastic.co/u/smruti)\
**Post date:** [October 31, 2010, 5:51pm UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/3 "2010-10-31T17:51:59Z")

</div>

Thanks Shay..

But if you observe, i am using the same format as mentiones above.

{"index": {"\_type": "india", "\_index": "location"}}\n  
....

Is not it correct ?

~Smruti

On Oct 31, 1:52 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> The format is bulk API has changed in 0.12, it requires setting \_index,  
> \_type and \_id (and not index, type, and id).
> 
> -shay.banon
> 
> On Sun, Oct 31, 2010 at 6:39 AM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> 
> > Hi,
> 
> > The bulk operation is throwing error. Could someone please have a  
> > look. I read some earlier posts but did not get any clue. i am running  
> > 0.12 Elasticsearch version.
> 
> > Error :  
> > response status: 500  
> > {u'error': u'ActionRequestValidationException[Validation Failed:  
> > 1: no requests added]'}
> 
> > Request :
> 
> > making POST request to path: localhost 9200 /\_bulk with body: "{"index  
> > ": {"\_type": "india", "\_index": "location"}}\n{"timezone":  
> > "Asia/Kolkata", "location": {"lat": "27.75", "lon":  
> > "88.26667"}, "id": "1252676", "name": "Zemu Glacier"}\n"
> 
> > Thanks  
> > Smruti

---

<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:** [October 31, 2010, 5:54pm UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/4 "2010-10-31T17:54:28Z")

</div>

Sorry, I missed that. Does it work via curl? What library do you use to  
interact with elasticsearch?

On Sun, Oct 31, 2010 at 7:51 PM, Smruti [smruti.parida@gmail.com](mailto:smruti.parida@gmail.com) wrote:

> Thanks Shay..
> 
> But if you observe, i am using the same format as mentiones above.
> 
> {"index": {"\_type": "india", "\_index": "location"}}\n  
> ....
> 
> Is not it correct ?
> 
> ~Smruti
> 
> On Oct 31, 1:52 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > The format is bulk API has changed in 0.12, it requires setting \_index,  
> > \_type and \_id (and not index, type, and id).
> > 
> > -shay.banon
> > 
> > On Sun, Oct 31, 2010 at 6:39 AM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> > 
> > > Hi,
> > 
> > > The bulk operation is throwing error. Could someone please have a  
> > > look. I read some earlier posts but did not get any clue. i am running  
> > > 0.12 Elasticsearch version.
> > 
> > > Error :  
> > > response status: 500  
> > > {u'error': u'ActionRequestValidationException[Validation Failed:  
> > > 1: no requests added]'}
> > 
> > > Request :
> > 
> > > making POST request to path: localhost 9200 /\_bulk with body: "{"index  
> > > ": {"\_type": "india", "\_index": "location"}}\n{"timezone":  
> > > "Asia/Kolkata", "location": {"lat": "27.75", "lon":  
> > > "88.26667"}, "id": "1252676", "name": "Zemu Glacier"}\n"
> > 
> > > Thanks  
> > > Smruti

---

<div class="post-metadata">

**Author:** ![smruti](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@smruti](https://discuss.elastic.co/u/smruti)\
**Post date:** [November 1, 2010, 4:42am UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/5 "2010-11-01T04:42:23Z")

</div>

it does not work via curl as well. I am using pyes present at

> **[GitHub - aparo/pyes: Python connector for ElasticSearch - the pythonic way to...](https://github.com/aparo/pyes)**
>
> Python connector for ElasticSearch - the pythonic way to use ElasticSearch - GitHub - aparo/pyes: Python connector for ElasticSearch - the pythonic way to use ElasticSearch

I checked the pyes connector code, and I think it is fine according to  
the bulk upload protocol.

On Oct 31, 10:54 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Sorry, I missed that. Does it work via curl? What library do you use to  
> interact with elasticsearch?
> 
> On Sun, Oct 31, 2010 at 7:51 PM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> 
> > Thanks Shay..
> 
> > But if you observe, i am using the same format as mentiones above.
> 
> > {"index": {"\_type": "india", "\_index": "location"}}\n  
> > ....
> 
> > Is not it correct ?
> 
> > ~Smruti
> 
> > On Oct 31, 1:52 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > The format is bulk API has changed in 0.12, it requires setting \_index,  
> > > \_type and \_id (and not index, type, and id).
> 
> > > -shay.banon
> 
> > > On Sun, Oct 31, 2010 at 6:39 AM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> > > 
> > > > Hi,
> 
> > > > The bulk operation is throwing error. Could someone please have a  
> > > > look. I read some earlier posts but did not get any clue. i am running  
> > > > 0.12 Elasticsearch version.
> 
> > > > Error :  
> > > > response status: 500  
> > > > {u'error': u'ActionRequestValidationException[Validation Failed:  
> > > > 1: no requests added]'}
> 
> > > > Request :
> 
> > > > making POST request to path: localhost 9200 /\_bulk with body: "{"index  
> > > > ": {"\_type": "india", "\_index": "location"}}\n{"timezone":  
> > > > "Asia/Kolkata", "location": {"lat": "27.75", "lon":  
> > > > "88.26667"}, "id": "1252676", "name": "Zemu Glacier"}\n"
> 
> > > > Thanks  
> > > > Smruti

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [November 1, 2010, 7:46am UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/6 "2010-11-01T07:46:09Z")

</div>

Hi,

did you check the following thread in mail list?  
[http://elasticsearch-users.115913.n3.nabble.com/Bulk-via-curl-not-working-in-data-in-file-tp1793039p1793039.html](http://elasticsearch-users.115913.n3.nabble.com/Bulk-via-curl-not-working-in-data-in-file-tp1793039p1793039.html)

I had problems using bulk api via curl and I was getting the same exception.  
Obviously the problem was the "new line" character.  
Note that when I used curl I did not explicitly included "\n" into data.

Regards,  
Lukas

On Mon, Nov 1, 2010 at 5:42 AM, Smruti [smruti.parida@gmail.com](mailto:smruti.parida@gmail.com) wrote:

> it does not work via curl as well. I am using pyes present at  
> [GitHub - aparo/pyes: Python connector for ElasticSearch - the pythonic way to use ElasticSearch](http://github.com/aparo/pyes)  
> I checked the pyes connector code, and I think it is fine according to  
> the bulk upload protocol.
> 
> On Oct 31, 10:54 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Sorry, I missed that. Does it work via curl? What library do you use to  
> > interact with elasticsearch?
> > 
> > On Sun, Oct 31, 2010 at 7:51 PM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> > 
> > > Thanks Shay..
> > 
> > > But if you observe, i am using the same format as mentiones above.
> > 
> > > {"index": {"\_type": "india", "\_index": "location"}}\n  
> > > ....
> > 
> > > Is not it correct ?
> > 
> > > ~Smruti
> > 
> > > On Oct 31, 1:52 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > 
> > > > The format is bulk API has changed in 0.12, it requires setting  
> > > > \_index,  
> > > > \_type and \_id (and not index, type, and id).
> > 
> > > > -shay.banon
> > 
> > > > On Sun, Oct 31, 2010 at 6:39 AM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Hi,
> > 
> > > > > The bulk operation is throwing error. Could someone please have a  
> > > > > look. I read some earlier posts but did not get any clue. i am  
> > > > > running  
> > > > > 0.12 Elasticsearch version.
> > 
> > > > > Error :  
> > > > > response status: 500  
> > > > > {u'error': u'ActionRequestValidationException[Validation Failed:  
> > > > > 1: no requests added]'}
> > 
> > > > > Request :
> > 
> > > > > making POST request to path: localhost 9200 /\_bulk with body:  
> > > > > "{"index  
> > > > > ": {"\_type": "india", "\_index":  
> > > > > "location"}}\n{"timezone":  
> > > > > "Asia/Kolkata", "location": {"lat": "27.75", "lon":  
> > > > > "88.26667"}, "id": "1252676", "name": "Zemu Glacier"}\n"
> > 
> > > > > Thanks  
> > > > > Smruti

---

<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:17am UTC](https://discuss.elastic.co/t/not-able-to-do--bulk-request-throwing-actionrequestvalidationexception-error/3494/7 "2017-07-06T04:17:22Z")

</div>


