# Data Loss or a chance

**URL:** <https://discuss.elastic.co/t/data-loss-or-a-chance/56480>\
**Category:** Elasticsearch\
**Created:** [July 27, 2016, 8:10am UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480 "2016-07-27T08:10:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![graubitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/graubitz/32/11080_2.png) [@graubitz](https://discuss.elastic.co/u/graubitz)\
**Post date:** [July 27, 2016, 8:10am UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480/1 "2016-07-27T08:10:03Z")

</div>

Hi all,

my colleague mixed up the mappings in ES 2.1.0 for the same idnex. Since our server crashed a week ago we are not able to restart our server with the old data as ES throws the error:

. . . is defined as an object in mapping [. . .] but this name is already used for a field in other types . . .

(for a million of entries)

Now I am in a dilemma: all proposed solutions are based on POST and GET using localhost:9200. But I can not start on ES on localhost:9200.

Although I tried by connection with Java Code using the "org.elasticsearch.\*" Package. I end in the same result.

In this forum I did not find similiar solutions I am searching for.

Question: is there a way to read out the data? I just need the entries (reproducing the json) Maybe with Lucene? Or do I have to name it "Data Loss forever"

Any links, blogs, whatever are welcome.

Thanks in advance,

Henner

---

<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:** [July 27, 2016, 9:08am UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480/2 "2016-07-27T09:08:04Z")

</div>

This is really unclear.

Could you explain exactly what you did and what you are trying to do ?  
Don't you have a source of truth somewhere? I mean where are the data coming from?

---

<div class="post-metadata">

**Author:** ![graubitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/graubitz/32/11080_2.png) [@graubitz](https://discuss.elastic.co/u/graubitz)\
**Post date:** [July 27, 2016, 10:47am UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480/3 "2016-07-27T10:47:48Z")

</div>

Hi David,

thanks for your reply.

Just to explain: my colleague produced conflicting field mappings as descripted [hier](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html#_conflicting_field_mappings)

As also described "Elasticsearch will not start in the presence of conflicting field mappings." This is exactly what happens: our server crashed a week ago, I tried to start ES with ./bin/elasticsearch, but ES complains about the mappings:

. . .  
java.lang.IllegalArgumentException: [payload.response] is defined as an object in mapping [passformLogs] but this name is already used for a field in other types  
. . .

Without a running ES I can not e.g. delete an index with

curl -XDELETE '[http://localhost:9200/myindex/](http://localhost:9200/myindex/)'

or make all other proposed stuff.

At the moment we moved the old data folder to data\_folder\_bak and started a new one. But we need access to the old data.

Same for trying to read the old data using Java: it crashes the same way.

So the question is: is there any chance to reconstruct the old data.

Any links, blogs, whatever are very welcome.

Hope it is more clear,

Henner

---

<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:** [July 27, 2016, 11:42am UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480/4 "2016-07-27T11:42:03Z")

</div>

> [@graubitz](#):
>
> Just to explain: my colleague produced conflicting field mappings as descripted hier

That's what I don't get. How did he do that?  
Did he send a "wrong" mapping that has been accepted by elasticsearch?

I mean that it should not be possible.

---

<div class="post-metadata">

**Author:** ![graubitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/graubitz/32/11080_2.png) [@graubitz](https://discuss.elastic.co/u/graubitz)\
**Post date:** [July 27, 2016, 12:16pm UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480/5 "2016-07-27T12:16:09Z")

</div>

Hi David,

to be honest: I don't know how he got it to work. As I read it was possible to do such mappings in older ES versions, but since version 2.x it is not possible anymore. Fact is: it is hard to reproduce how it happened.

More interesting is: how can I get it to work.

Still looking for a solution, e.g. curl '[http://localhost:9200/\_cluster/state/routing\_table?pretty=true](http://localhost:9200/_cluster/state/routing_table?pretty=true)' shows UNASSIGNED Shards:

. . .  
"0" : [ {  
"state" : "INITIALIZING",  
"primary" : true,  
"node" : "EMwwUPoDR-GB6UdZ2fETEQ",  
"relocating\_node" : null,  
"shard" : 0,  
"index" : "eventlog",  
"version" : 1985,  
"allocation\_id" : {  
"id" : "X8eoBYYnQiKyinEZWQqP1Q"  
},  
"unassigned\_info" : {  
"reason" : "ALLOCATION\_FAILED",  
"at" : "2016-07-27T12:08:21.799Z",  
"details" : "failed to update mappings, failure IllegalArgumentException[Mapper for [payload] conflicts with existing mapping in other types[Can't merge a non object mapping [payload.response] with an object mapping [payload.response], Can't merge a non object mapping [payload.request] with an object mapping [payload.request]]]"  
}  
}, {  
"state" : "UNASSIGNED",  
"primary" : false,  
"node" : null,  
"relocating\_node" : null,  
"shard" : 0,  
"index" : "eventlog",  
"version" : 1985,  
"unassigned\_info" : {  
"reason" : "REPLICA\_ADDED",  
"at" : "2016-07-27T11:36:01.810Z"  
}  
} ]  
}

. . .

E.g. trying to fix UNASSIGNED SHARD like described on [https://t37.net/how-to-fix-your-elasticsearch-cluster-stuck-in-initializing-shards-mode.html](https://t37.net/how-to-fix-your-elasticsearch-cluster-stuck-in-initializing-shards-mode.html) (command: curl -XPOST 'localhost:9200/\_cluster/reroute' -d '{ "commands" : [{ "allocate" : { "index" : "eventlog", "shard" : "1", "node" : "Red Ronin", "allow\_primary" : true } }] }')

stops with the unassigned error.

Maybe there are a few more commands I can check.

Thanks for any advice,

Henner

---

<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:** [July 5, 2017, 10:32pm UTC](https://discuss.elastic.co/t/data-loss-or-a-chance/56480/6 "2017-07-05T22:32:34Z")

</div>


