# Reindex error : "type":"mapper\_parsing\_exception","reason":"failed to parse field \[date\] of type \[date\]

**URL:** <https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798>\
**Category:** Elasticsearch\
**Created:** [May 18, 2023, 5:46pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798 "2023-05-18T17:46:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GenSSC](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@GenSSC](https://discuss.elastic.co/u/GenSSC)\
**Post date:** [May 18, 2023, 5:46pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/1 "2023-05-18T17:46:55Z")

</div>

Hello,

While using the reindexing API, I am running into 4 indices that are giving me errors.  
It seems like the date in the document matches the template but I guess it is not.

I don't really know how to tackle this. I looked for a template for that index but there's nothing that seems related.

* * *

Preview of field's value: '2019-04-15T18:33:05Z'","caused\_by":{"type":"illegal\_argument\_exception","reason":"failed to parse date field [2019-04-15T18:33:05Z] with format [yyyy-MM-dd'T'HH:mm:ssZ]","caused\_by":{"type":"date\_time\_parse\_exception","reason":"date\_time\_parse\_exception: Text '2019-04-15T18:33:05Z' could not be parsed at index 19"}}},"status":400},{"index":"reindexed-v7-hpcarchive","type":"\_doc","id":"xbRGImoBl-KJ5-6JLaQg","cause":

---

<div class="post-metadata">

**Author:** ![dhondup](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dhondup](https://discuss.elastic.co/u/dhondup)\
**Post date:** [May 18, 2023, 7:57pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/2 "2023-05-18T19:57:26Z")

</div>

@GenSSC What is the date mapping for your source and destination indices? It sounds like a mapping mismatch.

---

<div class="post-metadata">

**Author:** ![GenSSC](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@GenSSC](https://discuss.elastic.co/u/GenSSC)\
**Post date:** [May 19, 2023, 12:39pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/3 "2023-05-19T12:39:45Z")

</div>

I'm thinking it has something to do with the T being in bracket...or maybe the Z needs to have brackets?

"hpcarchive" : {  
"aliases" : { },  
"mappings" : {  
"properties" : {  
"date" : {  
"type" : "date",  
"format" : "yyyy-MM-dd'T'HH:mm:ssZ"  
},

---

<div class="post-metadata">

**Author:** ![dhondup](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dhondup](https://discuss.elastic.co/u/dhondup)\
**Post date:** [May 19, 2023, 3:21pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/4 "2023-05-19T15:21:53Z")

</div>

@GenSSC

The format looks incorrect. Try the following format.

```auto
"format": "yyyy-MM-dd HH:mm:ss"

```

See [Date field type | Elasticsearch Guide [8.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html) for more details.

---

<div class="post-metadata">

**Author:** ![GenSSC](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@GenSSC](https://discuss.elastic.co/u/GenSSC)\
**Post date:** [May 19, 2023, 3:23pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/5 "2023-05-19T15:23:21Z")

</div>

@dhondup How can I change it?

---

<div class="post-metadata">

**Author:** ![dhondup](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dhondup](https://discuss.elastic.co/u/dhondup)\
**Post date:** [May 19, 2023, 3:25pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/6 "2023-05-19T15:25:12Z")

</div>

@GenSSC

Create the destination index with correct mappings and settings before reindexing

> The destination should be configured as wanted before calling `_reindex` . Reindex does not copy the settings from the source or its associated template.

See [Reindex API | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

---

<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:** [June 16, 2023, 3:25pm UTC](https://discuss.elastic.co/t/reindex-error-type-mapper-parsing-exception-reason-failed-to-parse-field-date-of-type-date/333798/7 "2023-06-16T15:25:31Z")

</div>

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