# Getting RoutingMissingException while migrating from ES 2.2.0 to ES 2.3.0

**URL:** <https://discuss.elastic.co/t/getting-routingmissingexception-while-migrating-from-es-2-2-0-to-es-2-3-0/45852>\
**Category:** Elasticsearch\
**Created:** [March 30, 2016, 9:41pm UTC](https://discuss.elastic.co/t/getting-routingmissingexception-while-migrating-from-es-2-2-0-to-es-2-3-0/45852 "2016-03-30T21:41:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![apanimesh061](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apanimesh061/32/927_2.png) [@apanimesh061](https://discuss.elastic.co/u/apanimesh061)\
**Post date:** [March 30, 2016, 9:41pm UTC](https://discuss.elastic.co/t/getting-routingmissingexception-while-migrating-from-es-2-2-0-to-es-2-3-0/45852/1 "2016-03-30T21:41:21Z")

</div>

I am using `prepareDelete` query in a `BulkRequest` where I have a set of IDs which I have to delete.

I used:

```
BulkRequestBuilder bulkRequest = searchClient.prepareBulk();
for id in ids {
    bulkRequest.add(searchClient.prepareDelete("indexName", "childType", id));
}
BulkResponse bulkResponse = bulkRequest.execute().actionGet();

```

This structure for deletion was working in ES 2.2.0 but in ES 2.3.0 I get `RoutingMissingException`.

If I print `bilkResponse.buildFailureMessage()` and I get

```
[0]: index [indexName], type [childType], id [215f3228a3c53970883ae0d3b22dae6f], message [[indexName] RoutingMissingException[routing is required for [indexName]/[childType]/[215f3228a3c53970883ae0d3b22dae6f]]]

```

I have not even changed the settings/mapping of the existing index.

What could be the reason?

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [April 1, 2016, 1:21pm UTC](https://discuss.elastic.co/t/getting-routingmissingexception-while-migrating-from-es-2-2-0-to-es-2-3-0/45852/2 "2016-04-01T13:21:54Z")

</div>

I think this is the cause: [https://github.com/elastic/elasticsearch/pull/16675](https://github.com/elastic/elasticsearch/pull/16675) . You have set routing required in your mapping (can you please confirm this?), but you are not providing the routing value as part of the delete call. We previously broadcasted the delete operation to all shards in that case and tried the delete on all shards rather than failing, but that mechanism was initially removed from the delete api in 2.0. As part of bulk, the broadcast delete had bugs in it and could cause more harm than benefits. You can read [here](https://github.com/elastic/elasticsearch/issues/16645#issuecomment-184251436) what the problems were around it , which is why we treated it as a bugfix rather than a breaking change.

Cheers  
Luca

---

<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, 11:03pm UTC](https://discuss.elastic.co/t/getting-routingmissingexception-while-migrating-from-es-2-2-0-to-es-2-3-0/45852/3 "2017-07-05T23:03:14Z")

</div>


