title: Zipkin with elasticsearch storage (QueryParsingException)
body: <p>I have a question regarding Zipkin with elasticsearch storage.</p>
  
  <p>After updating spring-cloud-sleuth to <code>1.1.1.RELEASE</code>(because we updated spring boot from 1.3.8 to 1.4.4 and spring cloud from Brixton.SR6 to Camden.SR4) we also updated <code>zipkin-storage-elasticsearch</code> and <code>zipkin-autoconfigure-storage-elasticsearch</code> to version <code>1.16.2</code> in the pom.xml of our zipkin service. We are using elasticsearch version <code>2.4.1</code>.
  When we boot up the service we get an 
  <a href="https://i.stack.imgur.com/KMSiw.png" rel="nofollow noreferrer">error on zipkin's ui</a> and a stacktrace:</p>
  
  <pre><code>Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is Failed to execute phase [query], all shards failed; shardFailures {[cAMggVueTv67tHV7aykwlg][zipkin-2017-03-29][0]: RemoteTransportException[[Infamnia][172.18.0.20:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{"size":0,"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"should":[{"nested":{"query":{"term":{"annotations.endpoint.serviceName":"xxx"}},"path":"annotations"}},{"nested":{"query":{"term":{"binaryAnnotations.endpoint.serviceName":"xxx"}},"path":"binaryAnnotations"}}]}}}},"aggregations":{"name_agg":{"terms":{"field":"name","size":2147483647,"order":{"_term":"asc"}}}}}]]; nested: QueryParsingException[[nested] nested object under path [annotations] is not of nested type]; }{[cAMggVueTv67tHV7aykwlg][zipkin-2017-03-29][1]: RemoteTransportException[[Infamnia][172.18.0.20:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{"size":0,"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"should":[{"nested":{"query":{"term":{"annotations.endpoint.serviceName":"xxx"}},"path":"annotations"}},{"nested":{"query":{"term":{"binaryAnnotations.endpoint.serviceName":"xxx"}},"path":"binaryAnnotations"}}]}}}},"aggregations":{"name_agg":{"terms":{"field":"name","size":2147483647,"order":{"_term":"asc"}}}}}]]; nested: QueryParsingException[[nested] nested object under path [annotations] is not of nested type]; }{[cAMggVueTv67tHV7aykwlg][zipkin-2017-03-29][2]: RemoteTransportException[[Infamnia][172.18.0.20:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{"size":0,"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"should":[{"nested":{"query":{"term":{"annotations.endpoint.serviceName":"xxx"}},"path":"annotations"}},{"nested":{"query":{"term":{"binaryAnnotations.endpoint.serviceName":"xxx"}},"path":"binaryAnnotations"}}]}}}},"aggregations":{"name_agg":{"terms":{"field":"name","size":2147483647,"order":{"_term":"asc"}}}}}]]; nested: QueryParsingException[[nested] nested object under path [annotations] is not of nested type]; }{[cAMggVueTv67tHV7aykwlg][zipkin-2017-03-29][3]: RemoteTransportException[[Infamnia][172.18.0.20:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{"size":0,"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"should":[{"nested":{"query":{"term":{"annotations.endpoint.serviceName":"xxx"}},"path":"annotations"}},{"nested":{"query":{"term":{"binaryAnnotations.endpoint.serviceName":"xxx"}},"path":"binaryAnnotations"}}]}}}},"aggregations":{"name_agg":{"terms":{"field":"name","size":2147483647,"order":{"_term":"asc"}}}}}]]; nested: QueryParsingException[[nested] nested object under path [annotations] is not of nested type]; }{[cAMggVueTv67tHV7aykwlg][zipkin-2017-03-29][4]: RemoteTransportException[[Infamnia][172.18.0.20:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{"size":0,"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"should":[{"nested":{"query":{"term":{"annotations.endpoint.serviceName":"xxx"}},"path":"annotations"}},{"nested":{"query":{"term":{"binaryAnnotations.endpoint.serviceName":"xxx"}},"path":"binaryAnnotations"}}]}}}},"aggregations":{"name_agg":{"terms":{"field":"name","size":2147483647,"order":{"_term":"asc"}}}}}]]; nested: QueryParsingException[[nested] nested object under path [annotations] is not of nested type]; }] with root cause    
  
  
  org.elasticsearch.index.query.QueryParsingException: [nested] nested object under path [annotations] is not of nested type
  at org.elasticsearch.index.query.support.NestedInnerQueryParseSupport.setPath(NestedInnerQueryParseSupport.java:162)
  at org.elasticsearch.index.query.NestedQueryParser.parse(NestedQueryParser.java:82)
  at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)
  at org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:120)
  at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)
  at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:263)
  at org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:91)
  at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)
  at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:320)
  at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:223)
  at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:218)
  at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
  at org.elasticsearch.search.SearchService.parseSource(SearchService.java:856)
  at org.elasticsearch.search.SearchService.createContext(SearchService.java:667)
  at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:633)
  at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:377)
  at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:368)
  at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:365)
  at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
  at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)
  at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:376)
  at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Zipkin was working with spring-cloud-sleuth <code>1.0.0.RELEASE</code>, zipkin-storage-elasticsearch, zipkin-autoconfigure-storage-elasticsearch <code>1.7.0</code> and elasticsearch <code>2.3.5</code>. What am I missing here? Which versions should work together?</p>