# It seems mapping update for "date\_range" field type is not idempotent

**URL:** <https://discuss.elastic.co/t/it-seems-mapping-update-for-date-range-field-type-is-not-idempotent/263034>\
**Category:** Elasticsearch\
**Created:** [February 2, 2021, 7:13pm UTC](https://discuss.elastic.co/t/it-seems-mapping-update-for-date-range-field-type-is-not-idempotent/263034 "2021-02-02T19:13:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![0bivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/0bivan/32/83325_2.png) [@0bivan](https://discuss.elastic.co/u/0bivan)\
**Post date:** [February 2, 2021, 7:13pm UTC](https://discuss.elastic.co/t/it-seems-mapping-update-for-date-range-field-type-is-not-idempotent/263034/1 "2021-02-02T19:13:29Z")

</div>

Hi. Want to confirm the issue before posting it on github. ES does not allow to update date\_range field with exact same mapping settings and responds with 500. Tried with docker container ([Docker Hub](https://hub.docker.com/_/elasticsearch/)) 7.10.1 and 7.10.2.  
Here are the steps to reproduce:

```
### add new index
$ curl -XPUT http://localhost:29200/test_index
{"acknowledged":true,"shards_acknowledged":true,"index":"test_index"}

### check settings
$ curl -XGET http://localhost:29200/test_index
{
  "test_index": {
    "aliases": {},
    "mappings": {},
    "settings": {
      "index": {
        "creation_date": "1612290812518",
        "number_of_shards": "1",
        "number_of_replicas": "1",
        "uuid": "jQ2IEe5VTkKgWVnBfDxvoA",
        "version": {
          "created": "7100299"
        },
        "provided_name": "test_index"
      }
    }
  }
}

### add date_range field
$ curl -XPUT http://localhost:29200/test_index/_mapping -H 'Content-Type: application/json' -d '{"properties": {"range": {"type": "date_range", "format": "yyyy-MM-dd"}}}'
{"acknowledged":true}

### ensure mapping is updated
$ curl -XGET http://localhost:29200/test_index/_mapping
{
  "test_index": {
    "mappings": {
      "properties": {
        "range": {
          "type": "date_range",
          "format": "yyyy-MM-dd"
        }
      }
    }
  }
}

### try to put exact same settings for "range" field
$ curl -XPUT http://localhost:29200/test_index/_mapping -H 'Content-Type: application/json' -d '{"properties": {"range": {"type": "date_range", "format": "yyyy-MM-dd"}}}'
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_state_exception",
        "reason": "[index.version.created] is not present in the index settings for index with UUID [null]"
      }
    ],
    "type": "illegal_state_exception",
    "reason": "[index.version.created] is not present in the index settings for index with UUID [null]"
  },
  "status": 500
}

```

Expect to see just confirmation, but get that odd error. Btv, this does not happen with integer or keyword fields.

---

<div class="post-metadata">

**Author:** ![0bivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/0bivan/32/83325_2.png) [@0bivan](https://discuss.elastic.co/u/0bivan)\
**Post date:** [February 16, 2021, 12:21pm UTC](https://discuss.elastic.co/t/it-seems-mapping-update-for-date-range-field-type-is-not-idempotent/263034/2 "2021-02-16T12:21:49Z")

</div>

the issue is fixed in 7.11.0

---

<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:** [March 16, 2021, 12:22pm UTC](https://discuss.elastic.co/t/it-seems-mapping-update-for-date-range-field-type-is-not-idempotent/263034/3 "2021-03-16T12:22:43Z")

</div>

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