# Error Uploading Template to Elasticsearch

**URL:** <https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 6, 2021, 10:19am UTC](https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275 "2021-05-06T10:19:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [May 6, 2021, 10:19am UTC](https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275/1 "2021-05-06T10:19:03Z")

</div>

Hi.  
I'm adding the 7.12.1 template to our elasticsearch cluster. However, I'm getting this error:

```auto
Exiting: error loading template: could not load template. Elasticsearch returned: couldn't load template: 400 Bad Request: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"No handler for type [flattened] declared on field [metadata]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: No handler for type [flattened] declared on field [metadata]","caused_by":{"type":"mapper_parsing_exception","reason":"No handler for type [flattened] declared on field [metadata]"}},"status":400}. Response body: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"No handler for type [flattened] declared on field [metadata]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: No handler for type [flattened] declared on field [metadata]","caused_by":{"type":"mapper_parsing_exception","reason":"No handler for type [flattened] declared on field [metadata]"}},"status":400}.

```

I've read elsewhere that this is caused by the oss release not supporting the flattened type. However, we're running elasticsearch with a basic license. Would appreciate some guidance here 🙂

Thx  
D

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [May 6, 2021, 1:43pm UTC](https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275/2 "2021-05-06T13:43:26Z")

</div>

Hi!

I'm not sure what could be the actual root cause but usually when I hit issues like this I used to delete old mappings/templates and try again so as to avoid hitting tricky override issues.

Hope that it could help.

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [May 6, 2021, 1:59pm UTC](https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275/3 "2021-05-06T13:59:31Z")

</div>

Hi,  
The template names are different and so can't be clashing with one another.

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [May 10, 2021, 8:58am UTC](https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275/4 "2021-05-10T08:58:58Z")

</div>

@ChrsMark to be a little clearer. This is a new install and we haven't been writing to the `filebeat-*` index pattern before. So there shouldn't be any mapping clash problems to account for.

---

<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 7, 2021, 10:59am UTC](https://discuss.elastic.co/t/error-uploading-template-to-elasticsearch/272275/5 "2021-06-07T10:59:48Z")

</div>

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