# Indexing in elastic search using NEST returns 403 error

**URL:** <https://discuss.elastic.co/t/indexing-in-elastic-search-using-nest-returns-403-error/125158>\
**Category:** Elasticsearch\
**Created:** [March 22, 2018, 9:54am UTC](https://discuss.elastic.co/t/indexing-in-elastic-search-using-nest-returns-403-error/125158 "2018-03-22T09:54:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rezajp](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@rezajp](https://discuss.elastic.co/u/rezajp)\
**Post date:** [March 22, 2018, 9:54am UTC](https://discuss.elastic.co/t/indexing-in-elastic-search-using-nest-returns-403-error/125158/1 "2018-03-22T09:54:12Z")

</div>

I have recently started learning/using elasticsearch and I am trying to index some documents using NEST (c# client) but after I index one document or run a bulk index the read\_only\_allow\_delete is set to true in the index settings. So next call for indexing documents results in 403. If I set this to false again, it is set back to true again after the next call.

Does anybody have an idea why this is happening?  
Have I set up the index wrong?

I know about the solution explained [here](https://discuss.elastic.co/t/forbidden-12-index-read-only-allow-delete-api/110282/4) but next time I index a document it is set back to true again ☹

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [March 26, 2018, 3:35am UTC](https://discuss.elastic.co/t/indexing-in-elastic-search-using-nest-returns-403-error/125158/2 "2018-03-26T03:35:30Z")

</div>

> [@rezajp](#):
>
> Does anybody have an idea why this is happening?

Do the Elasticsearch logs indicate anything e.g. Elasticsearch enforcing a read-only index block (`index.blocks.read_only_allow_delete: true`) on every index that has one or more shards allocated on a node that has at least one disk exceeding the flood stage setting [`cluster.routing.allocation.disk.watermark.flood_stage`](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/disk-allocator.html), which defaults to 95% of disk space used?

---

<div class="post-metadata">

**Author:** ![rezajp](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@rezajp](https://discuss.elastic.co/u/rezajp)\
**Post date:** [March 26, 2018, 9:56am UTC](https://discuss.elastic.co/t/indexing-in-elastic-search-using-nest-returns-403-error/125158/3 "2018-03-26T09:56:20Z")

</div>

Thanks. That was actually the problem. I re-read the document about read only allow delete flag and it'd mentioned the disk space issue. So clearing up some files did the trick .

---

<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:** [April 23, 2018, 9:56am UTC](https://discuss.elastic.co/t/indexing-in-elastic-search-using-nest-returns-403-error/125158/4 "2018-04-23T09:56:27Z")

</div>

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