We have automatic mapping turned for our logstash indexes. Every now and
then our system logs a record that has a "wrong" (out of the ordinary)
field data type.
For example, a field that's been automatically mapped to be a number
occasionally is logged as a string.
This causes ES to crash with the following stack trace:
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:681)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:537)
at
org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:509)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:264)
at
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231)
at
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228)
at
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: "1.0"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:441)
at java.lang.Long.parseLong(Long.java:483)
at
org.elasticsearch.index.mapper.core.NumberFieldMapper.parseLongValue(NumberFieldMapper.java:357)
at
org.elasticsearch.index.mapper.core.LongFieldMapper.termQuery(LongFieldMapper.java:185)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.getFieldQuerySingle(MapperQueryParser.java:257)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.getFieldQuery(MapperQueryParser.java:168)
at
org.apache.lucene.queryparser.classic.QueryParserBase.getFieldQuery(QueryParserBase.java:487)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.getFieldQuery(MapperQueryParser.java:287)
at
org.apache.lucene.queryparser.classic.QueryParserBase.handleQuotedTerm(QueryParserBase.java:875)
at
org.apache.lucene.queryparser.classic.QueryParser.Term(QueryParser.java:464)
at
org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:259)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:183)
at
org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:263)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:183)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:172)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:123)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.parse(MapperQueryParser.java:882)
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:223)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:277)
at
org.elasticsearch.index.query.FQueryFilterParser.parse(FQueryFilterParser.java:66)
at
org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:343)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:324)
at
org.elasticsearch.index.query.BoolFilterParser.parse(BoolFilterParser.java:92)
at
org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:343)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:324)
at
org.elasticsearch.index.query.FilteredQueryParser.parse(FilteredQueryParser.java:74)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:277)
at
org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:382)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:281)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:276)
at
org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:665)
Is there a way to tell ES not to crash when failing to parse a field? I
realize I can override the mapping, and so on, but regardless I'm also
interested in getting ES to run reliably without crashing on rare inputs.
We have automatic mapping turned for our logstash indexes. Every now and
then our system logs a record that has a "wrong" (out of the ordinary)
field data type.
For example, a field that's been automatically mapped to be a number
occasionally is logged as a string.
This causes ES to crash with the following stack trace:
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:681)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:537)
at
org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:509)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:264)
at
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231)
at
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228)
at
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: "1.0"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:441)
at java.lang.Long.parseLong(Long.java:483)
at
org.elasticsearch.index.mapper.core.NumberFieldMapper.parseLongValue(NumberFieldMapper.java:357)
at
org.elasticsearch.index.mapper.core.LongFieldMapper.termQuery(LongFieldMapper.java:185)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.getFieldQuerySingle(MapperQueryParser.java:257)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.getFieldQuery(MapperQueryParser.java:168)
at
org.apache.lucene.queryparser.classic.QueryParserBase.getFieldQuery(QueryParserBase.java:487)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.getFieldQuery(MapperQueryParser.java:287)
at
org.apache.lucene.queryparser.classic.QueryParserBase.handleQuotedTerm(QueryParserBase.java:875)
at
org.apache.lucene.queryparser.classic.QueryParser.Term(QueryParser.java:464)
at
org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:259)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:183)
at
org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:263)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:183)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:172)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:123)
at
org.apache.lucene.queryparser.classic.MapperQueryParser.parse(MapperQueryParser.java:882)
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:223)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:277)
at
org.elasticsearch.index.query.FQueryFilterParser.parse(FQueryFilterParser.java:66)
at
org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:343)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:324)
at
org.elasticsearch.index.query.BoolFilterParser.parse(BoolFilterParser.java:92)
at
org.elasticsearch.index.query.QueryParseContext.executeFilterParser(QueryParseContext.java:343)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:324)
at
org.elasticsearch.index.query.FilteredQueryParser.parse(FilteredQueryParser.java:74)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:277)
at
org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:382)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:281)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:276)
at
org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:665)
Is there a way to tell ES not to crash when failing to parse a field? I
realize I can override the mapping, and so on, but regardless I'm also
interested in getting ES to run reliably without crashing on rare inputs.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.