# ES build fails due to illegal\_argument\_exception

**URL:** <https://discuss.elastic.co/t/es-build-fails-due-to-illegal-argument-exception/136713>\
**Category:** Elasticsearch\
**Created:** [June 20, 2018, 2:21pm UTC](https://discuss.elastic.co/t/es-build-fails-due-to-illegal-argument-exception/136713 "2018-06-20T14:21:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thitami](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thitami/32/32205_2.png) [@thitami](https://discuss.elastic.co/u/thitami)\
**Post date:** [June 20, 2018, 2:21pm UTC](https://discuss.elastic.co/t/es-build-fails-due-to-illegal-argument-exception/136713/1 "2018-06-20T14:21:43Z")

</div>

I have recently changed my ES mappings and now getting an exception on deploy

```
Activity execution failed, because:
      Elasticsearch\Common\Exceptions\BadRequest400Exception : {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [created_at] of different type, current_type [text], merged_type [date]"}],"type":"illegal_argument_exception","reason":"mapper [created_at] of different type, current_type [text], merged_type [date]"},"status":400}

  at /var/app/ondeck/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:610
  606| $exception = new ScriptLangNotSupportedException($responseBody. $statusCode);
  607| } elseif ($statusCode === 408) {
  608| $exception = new RequestTimeout408Exception($responseBody, $statusCode);
  609| } else {
  > 610| $exception = new BadRequest400Exception($responseBody, $statusCode);
  611| }
  612|
  613| $this->logRequestFail(
  614| $request['http_method'],

  Exception trace:

  1 Elasticsearch\Connections\Connection::process4xxError(["PUT", "http", "/categories/categories/_mapping", "{"categories":{"_source":{"enabled":true},"properties":{"id":{"type":"integer"},"created_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"},"updated_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"}}}}"], []

```

Anyone would be able to help out with ?

---

<div class="post-metadata">

**Author:** ![tdasch](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@tdasch](https://discuss.elastic.co/u/tdasch)\
**Post date:** [June 20, 2018, 6:34pm UTC](https://discuss.elastic.co/t/es-build-fails-due-to-illegal-argument-exception/136713/2 "2018-06-20T18:34:53Z")

</div>

Theo,

Elasticsearch doesn't allow you to update existing field mappings, which I think is the problem. Check [the doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#_updating_existing_field_mappings). A new index can be created with the appropriate mapping and you can reindex your data into that index. An alias can really help with this process, check [this doc](https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html).

Hope that helped 🙂

---

<div class="post-metadata">

**Author:** ![thitami](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thitami/32/32205_2.png) [@thitami](https://discuss.elastic.co/u/thitami)\
**Post date:** [July 6, 2018, 10:22am UTC](https://discuss.elastic.co/t/es-build-fails-due-to-illegal-argument-exception/136713/3 "2018-07-06T10:22:07Z")

</div>

Sorry for the late reply, @tdasch!

Indeed - that was very helpful. Thanks once again!

---

<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:** [August 3, 2018, 10:22am UTC](https://discuss.elastic.co/t/es-build-fails-due-to-illegal-argument-exception/136713/4 "2018-08-03T10:22:08Z")

</div>

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