I want to automatically delete indexes that are 60 days old and have set up the following lifecycle policy.
# curl -XGET '_ilm/policy/its_index-policy?pretty'
{
"its_index-policy" : {
"version" : 1,
"modified_date" : "2023-02-21T08:37:18.466Z",
"policy" : {
"phases" : {
"warm" : {
"min_age" : "5d",
"actions" : { }
},
"hot" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_size" : "20gb",
"max_age" : "2d",
"max_docs" : 50000000
}
}
},
"delete" : {
"min_age" : "60d",
"actions" : {
"delete" : {
"delete_searchable_snapshot" : true
}
}
}
}
},
"in_use_by" : {
"indices" : [
... snip ...
],
"data_streams" : [ ],
"composable_templates" : [
"its_index_template"
]
}
}
}
However, there are still indexes that are 60 days old.
# curl -XGET 'example-2023.02.22/_ilm/explain?pretty'
{
"indices" : {
"example-2023.02.22" : {
"index" : "example-2023.02.22",
"managed" : true,
"policy" : "its_index-policy",
"index_creation_date_millis" : 1677054544127,
"time_since_index_creation" : "75.75d",
"lifecycle_date_millis" : 1677054544127,
"age" : "75.75d",
"phase" : "hot",
"phase_time_millis" : 1683599336458,
"action" : "rollover",
"action_time_millis" : 1677054544636,
"step" : "ERROR",
"step_time_millis" : 1683599936449,
"failed_step" : "check-rollover-ready",
"is_auto_retryable_error" : true,
"failed_step_retry_count" : 5454,
"step_info" : {
"type" : "illegal_argument_exception",
"reason" : "index.lifecycle.rollover_alias [its_index-policy-alias] does not point to index [example-2023.02.22]"
},
"phase_execution" : {
"policy" : "its_index-policy",
"phase_definition" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_size" : "20gb",
"max_age" : "2d",
"max_docs" : 50000000
}
}
},
"version" : 1,
"modified_date_in_millis" : 1676968638466
}
}
}
}
What am I doing wrong?