# Bulk Insert documents - Getting BulkError

**URL:** https://discuss.elastic.co/t/bulk-insert-documents-getting-bulkerror/308198
**Category:** Elasticsearch
**Created:** [June 26, 2022, 11:29pm UTC](https://discuss.elastic.co/t/bulk-insert-documents-getting-bulkerror/308198 "2022-06-26T23:29:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Hardik\_Sanghavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hardik_sanghavi/32/106361_2.png) [@Hardik\_Sanghavi](https://discuss.elastic.co/u/Hardik_Sanghavi)
#### Post date: [June 26, 2022, 11:29pm UTC](https://discuss.elastic.co/t/bulk-insert-documents-getting-bulkerror/308198/1 "2022-06-26T23:29:25Z")

</div>

Hello,  
I am new to inserting bulk documents into ElasticSearch using Python

When I am trying to bulk insert documents, I am getting "elasticsearch.helpers.BulkIndexError: 100 document(s) failed to index."

The index doesnt exist yet and I was thinking that the bulk action will create an index if the index doesnt exist.

Sample Code:

```auto
  actions = [
        {
            "_index": "eventData",
            "_source": d,
        } for d in data
    ]
    success, errors = bulk(client, actions, stats_only=False)
    print(success, errors)

```

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 26, 2022, 11:48pm UTC](https://discuss.elastic.co/t/bulk-insert-documents-getting-bulkerror/308198/2 "2022-06-26T23:48:17Z")

</div>

> [@Hardik\_Sanghavi](#):
>
> `"_index": "eventData"`

Index names can only have lowercase letters, change it to `eventdata` and try again.

---

<div class="post-metadata">

### Author: ![Hardik\_Sanghavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hardik_sanghavi/32/106361_2.png) [@Hardik\_Sanghavi](https://discuss.elastic.co/u/Hardik_Sanghavi)
#### Post date: [June 27, 2022, 1:08am UTC](https://discuss.elastic.co/t/bulk-insert-documents-getting-bulkerror/308198/3 "2022-06-27T01:08:42Z")

</div>

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: [July 25, 2022, 1:09am UTC](https://discuss.elastic.co/t/bulk-insert-documents-getting-bulkerror/308198/4 "2022-07-25T01:09:37Z")

</div>

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