# Exception while creating a template

**URL:** <https://discuss.elastic.co/t/exception-while-creating-a-template/132207>\
**Category:** Elasticsearch\
**Created:** [May 16, 2018, 8:09pm UTC](https://discuss.elastic.co/t/exception-while-creating-a-template/132207 "2018-05-16T20:09:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![satishrao](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@satishrao](https://discuss.elastic.co/u/satishrao)\
**Post date:** [May 16, 2018, 8:09pm UTC](https://discuss.elastic.co/t/exception-while-creating-a-template/132207/1 "2018-05-16T20:09:11Z")

</div>

Hello,  
I am trying to create a template which I deleted. I am using the below curl command :

```
curl -X PUT -H "Content-Type: application/json" -i "http://172.31.38.157:9200/_template/couchbase" -d '{ "couchbase" : {
    "order" : 10,
    "template" : "*",
    "settings" : { },
    "mappings" : {
      "_default_" : {
        "_source" : {
          "includes" : [
            "meta.*"
          ]
        },
        "properties" : {
          "meta" : {
            "include_in_all" : false,
            "type" : "object"
          }
        }
      },
      "couchbaseCheckpoint" : {
        "_source" : {
          "includes" : [
            "doc.*"
          ]
        },
        "dynamic_templates" : [
          {
            "store_no_index" : {
              "mapping" : {
                "include_in_all" : false,
                "index" : "no",
                "store" : "no"
              },
              "match" : "*"
            }
          }
        ]
      }
    },
    "aliases" : { }
  }
}'

```

Getting a response as below :  
HTTP/1.1 400 Bad Request  
content-type: application/json; charset=UTF-8  
content-length: 239

{"error":{"root\_cause":[{"type":"action\_request\_validation\_exception","reason":"Validation Failed: 1: template is missing;"}],"type":"action\_request\_validation\_exception","reason":"Validation Failed: 1: template is missing;"},"status":400}

What is missing? I recreating the template with the same exact settings as was present in the original template

---

<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 13, 2018, 8:09pm UTC](https://discuss.elastic.co/t/exception-while-creating-a-template/132207/2 "2018-06-13T20:09:20Z")

</div>

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