# Elasticsearch indexing error

**URL:** <https://discuss.elastic.co/t/elasticsearch-indexing-error/130981>\
**Category:** Elasticsearch\
**Created:** [May 8, 2018, 10:36am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981 "2018-05-08T10:36:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cybersecc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cybersecc/32/30979_2.png) [@cybersecc](https://discuss.elastic.co/u/cybersecc)\
**Post date:** [May 8, 2018, 10:36am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/1 "2018-05-08T10:36:57Z")

</div>

```auto
[2018-05-08T08:28:00,038][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"02b93158-3f9e-4931-8e2c-1c8186aed688", :_index=>"aa-2018-05-08", :_type=>"bla", :_routing=>nil}, 2018-05-08T08:26:24.694Z machine_ip %{message}], :response=>{"index"=>{"_index"=>"aa-2018-05-08", "_type"=>"bla", "_id"=>"02b93158-3f9e-4931-8e2c-1c8186aed688", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [message] cannot be changed from type [keyword] to [text]"}}}}

```

Any help? all I have found is reindexing thing I can not do since I do not know how the initial template was. It will be great also, if someone could explain the root cause of this error.  
Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 11:35am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/2 "2018-05-08T11:35:52Z")

</div>

Root cause is that you can't change a mapping of an existing field.

---

<div class="post-metadata">

**Author:** ![cybersecc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cybersecc/32/30979_2.png) [@cybersecc](https://discuss.elastic.co/u/cybersecc)\
**Post date:** [May 8, 2018, 1:24pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/3 "2018-05-08T13:24:33Z")

</div>

And what should I do, because I no longer have events in elasticsearch due to this error 😕

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 1:38pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/4 "2018-05-08T13:38:42Z")

</div>

May be change the mapping or the index template?

---

<div class="post-metadata">

**Author:** ![cybersecc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cybersecc/32/30979_2.png) [@cybersecc](https://discuss.elastic.co/u/cybersecc)\
**Post date:** [May 8, 2018, 1:46pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/5 "2018-05-08T13:46:30Z")

</div>

the index template, by doing reindex.. it means that I must first create a new index template. The problem is that I don't know the template I should use ( I'm new to elasticsearch)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 2:01pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/6 "2018-05-08T14:01:40Z")

</div>

Is that an old cluster? A new one?

---

<div class="post-metadata">

**Author:** ![cybersecc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cybersecc/32/30979_2.png) [@cybersecc](https://discuss.elastic.co/u/cybersecc)\
**Post date:** [May 8, 2018, 2:02pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/7 "2018-05-08T14:02:18Z")

</div>

3 month old. But I must preserve the data 😕

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 2:34pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/8 "2018-05-08T14:34:54Z")

</div>

Daily indices I believe?

What gives

```
GET _templates
```

---

<div class="post-metadata">

**Author:** ![cybersecc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cybersecc/32/30979_2.png) [@cybersecc](https://discuss.elastic.co/u/cybersecc)\
**Post date:** [May 8, 2018, 2:38pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/9 "2018-05-08T14:38:30Z")

</div>

````auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "No endpoint or operation is available at [_templates]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "No endpoint or operation is available at [_templates]"
  },
  "status": 400
}
```.
may this is because I did some bad manipulations, but When I issue _template(without s) I got a response
````

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 3:32pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/10 "2018-05-08T15:32:51Z")

</div>

Sorry. I meant:

```
GET _template
```

---

<div class="post-metadata">

**Author:** ![cybersecc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cybersecc/32/30979_2.png) [@cybersecc](https://discuss.elastic.co/u/cybersecc)\
**Post date:** [May 8, 2018, 3:47pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/11 "2018-05-08T15:47:05Z")

</div>

Here is a link( huge amount of characters ) : [https://pastebin.com/raw/nfZXH53N](https://pastebin.com/raw/nfZXH53N)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 8, 2018, 6:30pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/12 "2018-05-08T18:30:55Z")

</div>

I don't see any template which would match with `aa-2018-05-08`.

So I have no idea of what you are doing. May be explain a bit the context of the first error message you got?

---

<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 5, 2018, 6:30pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-error/130981/13 "2018-06-05T18:30:56Z")

</div>

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