Update mapping fails for the elastic (superuser)

Dear All,

We tried to update mapping of an existing field

Request:

PUT index-name*
{
  "mappings": {
    "properties": {
      "index_field": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 1024
            }
          }
        }
    }
  }
}

and we get the following error:

action [indices:admin/create] is unauthorized for user [elastic] with roles [superuser], this action is granted by the index privileges [create_index,manage,all]

What else does this user need? It is supposed to be a superuser!

Well first of that all that is an invalid index name you should be getting this error

{
  "error" : {
    "root_cause" : [
      {
        "type" : "invalid_index_name_exception",
        "reason" : "Invalid index name [index-name*], must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?]",
        "index_uuid" : "_na_",
        "index" : "index-name*"
      }
    ],
    "type" : "invalid_index_name_exception",
    "reason" : "Invalid index name [index-name*], must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?]",
    "index_uuid" : "_na_",
    "index" : "index-name*"
  },
  "status" : 400
}

The real error is because you cannot use wildcards for index mapping update request. The complete error response should contain a cause_by section that tells you the underlying error. This cause_by error message could be a bit cryptic before 7.14.0. It would say something like

There are no external requests known to support wildcards that don't support replacing their indices

It has since been improved and you should see something like the followings in 7.14+

the action [...] does not support wildcards; the provided index expression(s) [...] are not allowed

1 Like

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