Curator rollover fails with alias on multiple indices but only one is_write_index

I have a series rolled over indices

{
  "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

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

{
  "@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"
}

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

re 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.

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