# Curator rollover fails with alias on multiple indices but only one is\_write\_index

**URL:** <https://discuss.elastic.co/t/curator-rollover-fails-with-alias-on-multiple-indices-but-only-one-is-write-index/163093>\
**Category:** Elasticsearch\
**Created:** [January 6, 2019, 7:58pm UTC](https://discuss.elastic.co/t/curator-rollover-fails-with-alias-on-multiple-indices-but-only-one-is-write-index/163093 "2019-01-06T19:58:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![memelet](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@memelet](https://discuss.elastic.co/u/memelet)\
**Post date:** [January 6, 2019, 7:58pm UTC](https://discuss.elastic.co/t/curator-rollover-fails-with-alias-on-multiple-indices-but-only-one-is-write-index/163093/1 "2019-01-06T19:58:55Z")

</div>

I have a series rolled over indices

```auto
{
  "test-000003" : {
    "aliases" : {
      "test-xxx" : {
        "is_write_index" : true
      },
      "test-yyy" : { }
    }
  },
  "test-000002" : {
    "aliases" : {
      "test-xxx" : {
        "is_write_index" : false
      },
      "test-yyy" : { }
    }
  },
  "test-000001" : {
    "aliases" : {
      "test-xxx" : {
        "is_write_index" : false
      },
      "test-yyy" : { }
    }
  }
}

```

If I do a rollover directly via the rollover api is works as expected, setting `is_write_index:false` on the rolled-over index and `is_write_index:true` on the new index.

But if I try to rollover the same alias via curator\_cli

```auto
curator_cli --dry-run --config /etc/curator/curator.yml --logformat logstash rollover --name test-xxx --max_age 30d --max_size 20gb --wait_for_active_shards 1 --extra_settings '{}'

```

I get an error

```auto
{
  "@timestamp": "2019-01-06T19:50:23.534Z",
  "function": "rollable_alias",
  "linenum": 98,
  "loglevel": "ERROR",
  "message": "\"alias\" must only reference one index: {u'test-000002': {u'aliases': {u'test-xxx': {u'is_write_index': True}}}, u'test-000001': {u'aliases': {u'test-xxx': {u'is_write_index': False}}}}",
  "name": "curator.utils"
}
{
  "@timestamp": "2019-01-06T19:50:23.534Z",
  "function": "do_singleton_action",
  "linenum": 188,
  "loglevel": "CRITICAL",
  "message": "Failed to complete action: rollover. <type 'exceptions.ValueError'>: Unable to perform index rollover with alias \"test-xxx\". See previous logs for more details.",
  "name": "curator.cli_singletons.cli_action.rollover"
}

```

---

<div class="post-metadata">

**Author:** ![memelet](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@memelet](https://discuss.elastic.co/u/memelet)\
**Post date:** [January 6, 2019, 8:07pm UTC](https://discuss.elastic.co/t/curator-rollover-fails-with-alias-on-multiple-indices-but-only-one-is-write-index/163093/2 "2019-01-06T20:07:02Z")

</div>

Well looking at [https://github.com/elastic/curator/blob/59a030c4c83f4e2ce15a1f70b7c70020fef21158/curator/utils.py#L78](https://github.com/elastic/curator/blob/59a030c4c83f4e2ce15a1f70b7c70020fef21158/curator/utils.py#L78) it seem that the `is_write_index` is not considered by curator.

---

<div class="post-metadata">

**Author:** ![memelet](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@memelet](https://discuss.elastic.co/u/memelet)\
**Post date:** [January 6, 2019, 8:12pm UTC](https://discuss.elastic.co/t/curator-rollover-fails-with-alias-on-multiple-indices-but-only-one-is-write-index/163093/3 "2019-01-06T20:12:11Z")

</div>

re [https://github.com/elastic/curator/issues/1342](https://github.com/elastic/curator/issues/1342)

This really blew my legs off. Guess I have go back to the crufty bash script to do the rollovers.

---

<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:** [February 3, 2019, 8:12pm UTC](https://discuss.elastic.co/t/curator-rollover-fails-with-alias-on-multiple-indices-but-only-one-is-write-index/163093/4 "2019-02-03T20:12:18Z")

</div>

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