# Cannot create index in elasticsearch 7.0.0 using python

**URL:** <https://discuss.elastic.co/t/cannot-create-index-in-elasticsearch-7-0-0-using-python/179214>\
**Category:** Elasticsearch\
**Created:** [May 1, 2019, 2:44pm UTC](https://discuss.elastic.co/t/cannot-create-index-in-elasticsearch-7-0-0-using-python/179214 "2019-05-01T14:44:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)\
**Post date:** [May 1, 2019, 2:44pm UTC](https://discuss.elastic.co/t/cannot-create-index-in-elasticsearch-7-0-0-using-python/179214/1 "2019-05-01T14:44:22Z")

</div>

Hi,

I'm using python to create index in my elasticsearch.

from elasticsearch import Elasticsearch  
es = Elasticsearch(es\_url)  
es.index(index=\<INDEX\_NAME\>, doc\_type="type", body="body", id=record\_id)

But it returns:

```
POST /<INDEX_NAME>/type [status:406 request:0.004s]
The log None failed to send to ES (This is potentially due to a mapping conflict)

```

(I know mapping conflict part was because es 7.0.0 doesn't support 'doc\_type' other than default '\_doc')

As you can see, there's no elasticsearch url in POST it's value is 'None'. But if a make a spell mistake in the es\_url variable, i get proper POST url.

I tried checking setting es\_url to different es endpoint. but got same error as that es too was of 7.0.0 version.

Please help!

Thanks.

---

<div class="post-metadata">

**Author:** ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)\
**Post date:** [May 1, 2019, 5:50pm UTC](https://discuss.elastic.co/t/cannot-create-index-in-elasticsearch-7-0-0-using-python/179214/2 "2019-05-01T17:50:27Z")

</div>

Never mind. The elasticsearch python module version was incompatible. I did pip install --upgrade elasticsearch and it worked.

Thanks,

---

<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:** [May 29, 2019, 5:50pm UTC](https://discuss.elastic.co/t/cannot-create-index-in-elasticsearch-7-0-0-using-python/179214/3 "2019-05-29T17:50:32Z")

</div>

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