# Update mapping fails for the elastic (superuser)

**URL:** <https://discuss.elastic.co/t/update-mapping-fails-for-the-elastic-superuser/288450>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 4, 2021, 7:13pm UTC](https://discuss.elastic.co/t/update-mapping-fails-for-the-elastic-superuser/288450 "2021-11-04T19:13:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimitris\_sb](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@dimitris\_sb](https://discuss.elastic.co/u/dimitris_sb)\
**Post date:** [November 4, 2021, 7:13pm UTC](https://discuss.elastic.co/t/update-mapping-fails-for-the-elastic-superuser/288450/1 "2021-11-04T19:13:51Z")

</div>

Dear All,

We tried to update mapping of an existing field

Request:

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

```

and we get the following error:

```auto
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!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 5, 2021, 12:07am UTC](https://discuss.elastic.co/t/update-mapping-fails-for-the-elastic-superuser/288450/2 "2021-11-05T00:07:27Z")

</div>

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

```auto
{
  "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
}

```

---

<div class="post-metadata">

**Author:** ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)\
**Post date:** [November 5, 2021, 12:31am UTC](https://discuss.elastic.co/t/update-mapping-fails-for-the-elastic-superuser/288450/3 "2021-11-05T00:31:11Z")

</div>

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](https://github.com/elastic/elasticsearch/pull/73079) 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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 3, 2021, 12:32am UTC](https://discuss.elastic.co/t/update-mapping-fails-for-the-elastic-superuser/288450/4 "2021-12-03T00:32:12Z")

</div>

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