# Python bulk insert error

**URL:** https://discuss.elastic.co/t/python-bulk-insert-error/275044
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [June 6, 2021, 12:54am UTC](https://discuss.elastic.co/t/python-bulk-insert-error/275044 "2021-06-06T00:54:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [June 6, 2021, 12:54am UTC](https://discuss.elastic.co/t/python-bulk-insert-error/275044/1 "2021-06-06T00:54:36Z")

</div>

Using python code I am getting this error.  
if I use same code same data and just change index name it works.

Is something wrong with existing index? how do I find this out?

```
 raise BulkIndexError("%i document(s) failed to index." % len(errors), errors)
elasticsearch.helpers.errors.BulkIndexError: ('1 document(s) failed to index.', [{'index': {'_index': 'myindex-2021-05', '_type': '_doc', '_id': '685056415-1.0', 'status': 403, 'error': {'type': 'cluster_block_exception', 'reason': 'index [myindex-2021-05] blocked by: [FORBIDDEN/8/index write (api)];'}

```

Document is already exist in myindex-2021-05 index. but I can't overwrite it.

but if I change name to yourindex-2021-05 then I can ovrwite as many time as I test.  
I do not have space issue. plenty of space available

index is in green status and open.

green open myindex-2021-05 gp5uwRdEShqhOBDEDyjxXg 3 1 32312084 13000 8.7gb 4.3gb

This is 7.10.1. and I do not have any ILM policy on it.

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [June 7, 2021, 9:33pm UTC](https://discuss.elastic.co/t/python-bulk-insert-error/275044/2 "2021-06-07T21:33:28Z")

</div>

This is fixed.

I just put that index as frozen/readonly and then open it up again. and I am able to write to it.

---

<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 5, 2021, 9:34pm UTC](https://discuss.elastic.co/t/python-bulk-insert-error/275044/3 "2021-07-05T21:34:10Z")

</div>

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