# InvalidJsonResponseError when rebuild\_index on heroku

**URL:** <https://discuss.elastic.co/t/invalidjsonresponseerror-when-rebuild-index-on-heroku/9702>\
**Category:** Elasticsearch\
**Created:** [November 13, 2012, 7:04pm UTC](https://discuss.elastic.co/t/invalidjsonresponseerror-when-rebuild-index-on-heroku/9702 "2012-11-13T19:04:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salma\_Hamed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/salma_hamed/32/2622_2.png) [@Salma\_Hamed](https://discuss.elastic.co/u/Salma_Hamed)\
**Post date:** [November 13, 2012, 7:04pm UTC](https://discuss.elastic.co/t/invalidjsonresponseerror-when-rebuild-index-on-heroku/9702/1 "2012-11-13T19:04:32Z")

</div>

I just started using elasticSearch with my django project deployed on  
heroku.  
I am using SearchBox addon. I did as mentioned in the document to set  
things up.  
But when running "heroku run python manage.py rebuild\_index"

I get the following exception:  
pyelasticsearch.exceptions.InvalidJsonResponseError

Any Idea what is the problem ??

--

---

<div class="post-metadata">

**Author:** ![Chris\_Male](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_male/32/2607_2.png) [@Chris\_Male](https://discuss.elastic.co/u/Chris_Male)\
**Post date:** [November 13, 2012, 10:53pm UTC](https://discuss.elastic.co/t/invalidjsonresponseerror-when-rebuild-index-on-heroku/9702/2 "2012-11-13T22:53:37Z")

</div>

Hi Salma,

There isn't any real way we can help you without information about your  
Elasticsearch setup, any error logs you're seeing on the Elasticsearch  
side, information about what you're indexing, your mappings etc. If you  
can give us some more information we'll try to help.

Alternatively, it also looks like you're getting a pyelasticsearch  
exception which maybe related to that library, so maybe raise the issue  
with them?

On Wednesday, November 14, 2012 8:04:32 AM UTC+13, Salma Hamed wrote:

> I just started using elasticSearch with my django project deployed on  
> heroku.  
> I am using SearchBox addon. I did as mentioned in the document to set  
> things up.  
> But when running "heroku run python manage.py rebuild\_index"
> 
> I get the following exception:  
> pyelasticsearch.exceptions.InvalidJsonResponseError
> 
> Any Idea what is the problem ??

--

---

<div class="post-metadata">

**Author:** ![ferhatsb](https://avatars.discourse-cdn.com/v4/letter/f/977dab/32.png) [@ferhatsb](https://discuss.elastic.co/u/ferhatsb)\
**Post date:** [November 14, 2012, 6:49am UTC](https://discuss.elastic.co/t/invalidjsonresponseerror-when-rebuild-index-on-heroku/9702/3 "2012-11-14T06:49:20Z")

</div>

Hi All,

It was a bug at SearchBox side. Refresh request was returning an invalid  
json, fixed.

Also manage.py rebuild\_index command deleting the index and sending a bulk  
request without creating an index. SearchBox does not supports auto index  
creation at bulk requests.  
So creating index via dashboard or API then using "heroku run python  
manage.py update\_index" works better.

Regards,  
Ferhat

[www.searchbox.io](http://www.searchbox.io)

On Wednesday, November 14, 2012 12:53:37 AM UTC+2, Chris Male wrote:

> Hi Salma,
> 
> There isn't any real way we can help you without information about your  
> Elasticsearch setup, any error logs you're seeing on the Elasticsearch  
> side, information about what you're indexing, your mappings etc. If you  
> can give us some more information we'll try to help.
> 
> Alternatively, it also looks like you're getting a pyelasticsearch  
> exception which maybe related to that library, so maybe raise the issue  
> with them?
> 
> On Wednesday, November 14, 2012 8:04:32 AM UTC+13, Salma Hamed wrote:
> 
> > I just started using elasticSearch with my django project deployed on  
> > heroku.  
> > I am using SearchBox addon. I did as mentioned in the document to set  
> > things up.  
> > But when running "heroku run python manage.py rebuild\_index"
> > 
> > I get the following exception:  
> > pyelasticsearch.exceptions.InvalidJsonResponseError
> > 
> > Any Idea what is the problem ??

--

---

<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, 3:04am UTC](https://discuss.elastic.co/t/invalidjsonresponseerror-when-rebuild-index-on-heroku/9702/4 "2017-07-06T03:04:27Z")

</div>


