# Curator stopped working after 7.14.0 upgrade (KeyError: indices)

**URL:** <https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [September 30, 2021, 11:04am UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578 "2021-09-30T11:04:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [September 30, 2021, 11:04am UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/1 "2021-09-30T11:04:59Z")

</div>

After upgrading Elasticsearch from 7.10 to 7.14, Curator 5.4.8 has stopped working: simple delete jobs, create alias jobs, etc. that previously worked fine are now throwing this error:

```auto
2021-09-29 15:12:25,343 DEBUG curator.indexlist iterate_over_stats:124 Index: redacted-x-2021.09.13 Size: xxxx Docs: xx
2021-09-29 15:12:25,343 DEBUG curator.indexlist iterate_over_stats:124 Index: redacted-other-2021.07.23 Size: xxxx Docs: xx
2021-09-29 15:12:26,134 ERROR curator.cli run:213 Failed to complete action: delete_indices. <class 'KeyError'>: 'indices'

 Failed to complete action: delete_indices. <class 'KeyError' >: 'indices'

```

The jobs have 2 filters: regex pattern and age (older+) and it had been working for a year or two.

---

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [September 30, 2021, 11:06am UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/2 "2021-09-30T11:06:35Z")

</div>

It seems that the last line before the error is (around) here:

> <https://github.com/elastic/curator/blob/master/curator/indexlist.py#L124>

---

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [September 30, 2021, 11:38am UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/3 "2021-09-30T11:38:10Z")

</div>

I had to download the source and wrap the part in question in a try-catch (except) block and it's working this way.

I'm doing further investigation and leaving this topic open until I fully understand what was the root cause.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [September 30, 2021, 3:43pm UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/4 "2021-09-30T15:43:59Z")

</div>

How were you installing Curator before downloading source to test this?

---

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [October 1, 2021, 8:53am UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/5 "2021-10-01T08:53:18Z")

</div>

The error is there with a freshly git cloned Curator too. It seems that the action is irrelevant since it dies sooner.

In indexlist.py, around L125 the stats var is an empty dictionary. Two times out of the 1906 indices I have. 🙂  
`def iterate_over_stats(stats):`

Edit: I'm not a black belt Python developer, so I'm not sure where 'stats' come from in that subroutine.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [October 1, 2021, 2:02pm UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/6 "2021-10-01T14:02:06Z")

</div>

This sounds like 2 of your indices do not have the requisite data, or access to that data is possibly blocked by policy or permission.

What two indices are they?

---

<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:** [October 29, 2021, 2:02pm UTC](https://discuss.elastic.co/t/curator-stopped-working-after-7-14-0-upgrade-keyerror-indices/285578/7 "2021-10-29T14:02:54Z")

</div>

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