SOLVED: Index stuck in ISM policy transition

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch 2.18

Describe the issue:
Indices are stuck after trying to update them using the ISM policy update API

Configuration:

Update existing indices via ISM update API like this:


POST _plugins/_ism/change_policy/app-prod-logs-2025.03.08
{
  "policy_id": "app-policy",
  "state": "read_only",
  "include": [
    {
      "state": "open"
    }
  ]
}

Relevant Logs or Screenshots:
There is a typo in the above configuration. The correct state is “read only” but not “read_only”. Since the target state does not exist, the following happens:

"app-prod-logs-2025.03.08": {
    "index.plugins.index_state_management.policy_id": "app-policy",
    "index.opendistro.index_state_management.policy_id": "app-policy",
    "index": "app-prod-logs-2025.03.08",
    "index_uuid": "kdqeyzbwSw26r8PWDuZxXQ",
    "policy_id": "app-policy",
    "policy_seq_no": 50914457,
    "policy_primary_term": 58,
    "index_creation_date": 1741392005498,
    "transition_to": "read_only",
    "retry_info": {
      "failed": true,
      "consumed_retries": 0
    },
    "info": {
      "message": "Failed to find state=read_only in policy=app-policy"
    },
    "enabled": false

The affected indices remain in this state (for several days now).

When trying to change them, again, an error is returned.

 {
      "index_name": "app-prod-logs-2025.03.08",
      "index_uuid": "kdqeyzbwSw26r8PWDuZxXQ",
      "reason": "Cannot change policy while transitioning to new state"
    }

Any ideas? How can I resolve this?

I just found the Retry Endpoint.

This helps: