# Failed to execute query exception

**URL:** <https://discuss.elastic.co/t/failed-to-execute-query-exception/143006>\
**Category:** Elasticsearch\
**Created:** [August 4, 2018, 7:33am UTC](https://discuss.elastic.co/t/failed-to-execute-query-exception/143006 "2018-08-04T07:33:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ammu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ammu/32/41904_2.png) [@ammu](https://discuss.elastic.co/u/ammu)\
**Post date:** [August 4, 2018, 7:33am UTC](https://discuss.elastic.co/t/failed-to-execute-query-exception/143006/1 "2018-08-04T07:33:16Z")

</div>

Hi All,

I ma getting below error in my elastic logs.

[2018-08-04T12:34:23,177][DEBUG][o.e.a.s.TransportSearchAction] [MASTER-DATA-] [ao\_axa\_session\_hdr\_1][2], node[NFD6h\_7ETSu\_Prp2W4bVxg], [R], s[STARTED], a[id=vPX\_h\_hpS5y3GCYeHaW9RA]: Failed to execute [SearchRequest{searchType=QUERY\_THEN\_FETCH, indices=[ao\_axa\_session\_hdr\_1\*], indicesOptions=IndicesOptions[id=38, ignore\_unavailable=false, allow\_no\_indices=true, expand\_wildcards\_open=true, expand\_wildcards\_closed=false, allow\_alisases\_to\_multiple\_indices=true, forbid\_closed\_indices=true], types=[], routing='null', preference='null', requestCache=null, scroll=null, source={  
"size" : 0,  
"query" : {  
"bool" : {  
"filter" : [  
{  
"term" : {  
"tenant\_id" : {  
"value" : "2A2B87C7-AB57-B594-446E-7B3166680B22",  
"boost" : 1.0  
}  
}  
},  
{  
"has\_child" : {  
"query" : {  
"match\_all" : {  
"boost" : 1.0  
}  
},  
"type" : "session\_length",  
"score\_mode" : "none",  
"min\_children" : 0,  
"max\_children" : 2147483647,  
"ignore\_unmapped" : false,  
"boost" : 1.0  
}  
},  
{  
"range" : {  
"session\_start" : {  
"from" : "1533279902726",  
"to" : "1533366302726",  
"include\_lower" : true,  
"include\_upper" : true,  
"boost" : 1.0  
}  
}  
}  
],  
"disable\_coord" : false,  
"adjust\_pure\_negative" : true,  
"boost" : 1.0  
}  
},  
"explain" : false,  
"aggregations" : {  
"header" : {  
"terms" : {  
"field" : "\_type",  
"size" : 10,  
"min\_doc\_count" : 1,  
"shard\_min\_doc\_count" : 0,  
"show\_term\_doc\_count\_error" : false,  
"order" : [  
{  
"\_count" : "desc"  
},  
{  
"\_term" : "asc"  
}  
]  
},  
"aggregations" : {  
"session\_length" : {  
"children" : {  
"type" : "session\_length"  
},  
"aggregations" : {  
"length\_buckets" : {  
"range" : {  
"field" : "session\_length",  
"ranges" : [  
{  
"key" : "0to3s",  
"from" : 0.0,  
"to" : 3000.0  
},  
{  
"key" : "3to8s",  
"from" : 3000.0,  
"to" : 8000.0  
},  
{  
"key" : "8to15s",  
"from" : 8000.0,  
"to" : 15000.0  
},  
{  
"key" : "15to30s",  
"from" : 15000.0,  
"to" : 30000.0  
},  
{  
"key" : "30to60s",  
"from" : 30000.0,  
"to" : 60000.0  
},  
{  
"key" : "1to3m",  
"from" : 60000.0,  
"to" : 180000.0  
},  
{  
"key" : "3to10m",  
"from" : 180000.0,  
"to" : 600000.0  
},  
{  
"key" : "10to30m",  
"from" : 600000.0,  
"to" : 1800000.0  
},  
{  
"key" : "30to60m",  
"from" : 1800000.0,  
"to" : 3600000.0  
},  
{  
"key" : "1to2h",  
"from" : 3600000.0,  
"to" : 7200000.0  
},  
{  
"key" : "2to3h",  
"from" : 7200000.0,  
"to" : 1.08E7  
},  
{  
"key" : "3h",  
"from" : 1.08E7  
}  
],  
"keyed" : false  
}  
}  
}  
}  
}  
}  
}  
}}] lastShard [true]  
org.elasticsearch.transport.RemoteTransportException: [MASTER-DATA-][172.22.221.58:9300][indices:data/read/search[phase/query]]  
Caused by: org.elasticsearch.index.query.QueryShardException: [has\_child] no mapping found for type [session\_length]  
at org.elasticsearch.join.query.HasChildQueryBuilder.doToQuery(HasChildQueryBuilder.java:329) ~[?:?]  
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:96) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.AbstractQueryBuilder.toFilter(AbstractQueryBuilder.java:118) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:446) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.BoolQueryBuilder.doToQuery(BoolQueryBuilder.java:419) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:96) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.QueryShardContext.lambda$toQuery$1(QueryShardContext.java:313) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:325) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:312) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:613) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.search.SearchService.createContext(SearchService.java:481) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:457) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:253) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.action.search.SearchTransportService$6.messageReceived(SearchTransportService.java:330) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.action.search.SearchTransportService$6.messageReceived(SearchTransportService.java:327) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.5.3.jar:5.5.3]  
at org.elasticsearch.transport.TcpTransport$RequestHandler.doRun(TcpTransport.java:1544) ~[elasticsearch-5.5.3.jar:5.5.3]

Any help will be great.

Regards  
Amit Singh Bisht

---

<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:** [September 1, 2018, 7:33am UTC](https://discuss.elastic.co/t/failed-to-execute-query-exception/143006/2 "2018-09-01T07:33:27Z")

</div>

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