Policy Action to Stop Replication

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Dashboard v 3.0.0

Describe the issue:
Iam trying to add an action to my replication policy to stop replicating an auto-follow index so i can delete the index. The option is not available in the action type drop down when i edit a state and if i manually add it to the json it fails to load error : “Could not load the policy”
I can manually stop it with an POST /_plugins/_replication//_stop but i want to auto stop and then delete with a policy

Configuration:
{
“policy”: {
“policy_id”: “replication_policy”,
“description”: “A sample description of the policy”,
“last_updated_time”: 1749161665379,
“schema_version”: 24,
“error_notification”: null,
“default_state”: “hot_state”,
“states”: [
{
“name”: “hot_state”,
“actions”: ,
“transitions”: [
{
“state_name”: “cold_state”,
“conditions”: {
“min_index_age”: “2d”
}
}
]
},
{
“name”: “cold_state”,
“actions”: ,
“transitions”: [
{
“state_name”: “delete_state”,
“conditions”: {
“min_rollover_age”: “7d”
}
}
]
},
{
“name”: “delete_state”,
“actions”: [
{
“retry”: {
“count”: 3,
“backoff”: “exponential”,
“delay”: “1m”
},
“stop_replication”: {}
},
{
“retry”: {
“count”: 3,
“backoff”: “exponential”,
“delay”: “1m”
},
“delete”: {}
}
],
“transitions”:
}
],
“ism_template”: [
{
“index_patterns”: [
test
],
“priority”: 2,
“last_updated_time”: 1747950335903
}
]
}
}

@goofinator Thank for the question, in future when adding configuration please surround it in code blocks for better visibility.

I have tried the following using curl PUT command and policy was created correctly:

{
  "policy": {
    "policy_id": "replication_policy",
    "description": "A sample description of the policy",
    "last_updated_time": 1749161665379,
    "schema_version": 24,
    "error_notification": null,
    "default_state": "hot_state",
    "states": [
      {
        "name": "hot_state",
        "actions": [],
        "transitions": [
          {
            "state_name": "cold_state",
            "conditions": {
              "min_index_age": "2d"
            }
          }
        ]
      },
      {
        "name": "cold_state",
        "actions": [],
        "transitions": [
          {
            "state_name": "delete_state",
            "conditions": {
              "min_rollover_age": "7d"
            }
          }
        ]
      },
      {
        "name": "delete_state",
        "actions": [
          {
            "retry": {
              "count": 3,
              "backoff": "exponential",
              "delay": "1m"
            },
            "stop_replication": {}
          },
          {
            "retry": {
              "count": 3,
              "backoff": "exponential",
              "delay": "1m"
            },
            "delete": {}
          }
        ],
        "transitions": []
      }
    ],
    "ism_template": [
      {
        "index_patterns": [
          "test"
        ],
        "priority": 2,
        "last_updated_time": 1747950335903
      }
    ]
  }
}

Which way are you adding this policy? Is there any other errors in the logs?

Hey @Antheon thanks for the reply.

Iam was trying to added through the visual editor in the dashboard(Index Managerment → State management policies → replication_policy) using the admin user. But there is no option to add that action under the state(see below). So I used the JSON editor to add the stop_replication. After i save it and then try to edit that same policy i get this error(see below pix and i dont see an additional error in the dashboard docker logs)… and i cannot edit the policy with the visual editor.. Its not until i remove stop_replication with the JSON editor, then i can edit it as normal.. Could this just be an issue with the visual editor/dashboard and the policy would work just fine?

error
image

missing stop replication

After testing the policy worked.. Its just some type of bug that dashboard visual editor has when it fails to load because i added stop_replication