Opensearch Failed to set number of replicas due no permissions

368 views Asked by At

I have the problem with running index managment policy for new indices. I get following error on "set number_of_replicas" step:

{
  "cause": "no permissions for [indices:admin/settings/update] and associated roles [index_management_full_access, own_index, security_rest_api_access]",
  "message": "Failed to set number_of_replicas to 2 [index=sample.name-2022.10.22]"
}

The indices are created by logstash with "sample.name-YYYY.MM.DD" name template, so in the index policy I have "sample.name-*" index pattern.

My policy:

{
    "policy_id": "sample.name-*",
    "description": "sample.name-* policy ",
    "schema_version": 16,
    "error_notification": null,
    "default_state": "set replicas",
    "states": [
        {
            "name": "set replicas",
            "actions": [
                {
                    "replica_count": {
                        "number_of_replicas": 2
                    }
                }
            ]
    ],
    "ism_template": [
        {
            "index_patterns": [
                "sample.name-*"
            ],
            "priority": 1
        }
    ]
}

I don't understand the reason of this error. Am I doing something wrong?

Retry of the policy doesn't work. The policy works only if I manually reassign it to index by Dashboards or API.

Opensearch version: 2.3.0

1

There are 1 answers

0
den_mko On

First time I created the policy using API under custom internal user with mapped “security_rest_api_access” security role only.

So I added all_access rights to my internal user and re-created policy and it works!

Seems that the policy runs under my internal user, which created it