Troubleshooting OpenSearch x_content_parse_exception Error

Original Slack Thread

I am getting below error, how to rectify it.

ERROR c.l.m.s.e.query.ESSearchDAO:204 - Search query failed: SearchRequest{searchType=QUERY_THEN_FETCH, indices=[datahubpolicyindex_v2], indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, expand_wildcards_hidden=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false, ignore_throttled=true], routing=‘null’, preference=‘null’, requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=null, allowPartialSearchResults=null, localClusterAlias=null, getOrCreateAbsoluteStartMillis=-1, ccsMinimizeRoundtrips=true, source={“size”:1000,“query”:{“bool”:{“must”:[{“function_score”:{“query”:{“bool”:{“should”:[{“bool”:{“should”:[{“simple_query_string”:{“query”:““,“fields”:[“urn^10.0”,“displayName^1.0”,“description^1.0”],“analyzer”:“keyword”,“flags”:-1,“default_operator”:“and”,“analyze_wildcard”:false,“auto_generate_synonyms_phrase_query”:true,“fuzzy_prefix_length”:0,“fuzzy_max_expansions”:50,“fuzzy_transpositions”:true,“boost”:1.0}},{“simple_query_string”:{“query”:””,“fields”:[“displayName.delimited^0.4”,“description.delimited^0.4”,“urn.delimited^5.0”],“analyzer”:“query_word_delimited”,“flags”:-1,“default_operator”:“and”,“analyze_wildcard”:false,“auto_generate_synonyms_phrase_query”:true,“fuzzy_prefix_length”:0,“fuzzy_max_expansions”:50,“fuzzy_transpositions”:true,“boost”:1.0}}],“adjust_pure_negative”:true,“boost”:1.0}},{“bool”:{“should”:[{“term”:{“urn”:{“value”:““,“boost”:20.0,”_name":“urn”}}},{“term”:{“urn”:{“value”:"”,“case_insensitive”:true,“boost”:14.0,“_name”:“urn”}}},{“match_phrase_prefix”:{“urn.delimited”:{“query”:““,“slop”:0,“max_expansions”:50,“zero_terms_query”:“NONE”,“boost”:5.6,”_name":“urn”}}},{“term”:{“displayName.keyword”:{“value”:"”,“boost”:2.0,“_name”:“displayName”}}},{“term”:{“displayName.keyword”:{“value”:““,“case_insensitive”:true,“boost”:1.4,”_name":“displayName”}}},{“term”:{“description.keyword”:{“value”:"”,“boost”:2.0,“_name”:“description”}}},{“term”:{“description.keyword”:{“value”:““,“case_insensitive”:true,“boost”:1.4,”_name":“description”}}},{“match_phrase_prefix”:{“description.delimited”:{“query”:"”,“slop”:0,“max_expansions”:50,“zero_terms_query”:“NONE”,“boost”:0.448,“_name”:“description”}}},{“match_phrase_prefix”:{“displayName.delimited”:{“query”:“*”,“slop”:0,“max_expansions”:50,“zero_terms_query”:“NONE”,“boost”:0.448,“_name”:“displayName”}}}],“adjust_pure_negative”:true,“boost”:1.0}}],“adjust_pure_negative”:true,“minimum_should_match”:“1”,“boost”:1.0}},“functions”:[{“filter”:{“match_all”:{“boost”:1.0}},“weight”:1.0}],“score_mode”:“avg”,“boost_mode”:“multiply”,“max_boost”:3.4028235E38,“boost”:1.0}}],“filter”:[{“bool”:{“must_not”:[{“match”:{“removed”:{“query”:true,“operator”:“OR”,“prefix_length”:0,“max_expansions”:50,“fuzzy_transpositions”:true,“lenient”:false,“zero_terms_query”:“NONE”,“auto_generate_synonyms_phrase_query”:true,“boost”:1.0}}}],“adjust_pure_negative”:true,“boost”:1.0}}],“adjust_pure_negative”:true,“boost”:1.0}},“_source”:{“includes”:[“urn”],“excludes”:},“sort”:[{“_score”:{“order”:“desc”}},{“urn”:{“order”:“asc”}}]}, cancelAfterTimeInterval=null, pipeline=null}
org.opensearch.OpenSearchStatusException: OpenSearch exception [type=x_content_parse_exception, reason=[1:935] [bool] failed to parse field [must]]
at org.opensearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:210)
at org.opensearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2235)
at org.opensearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2212)
at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1931)
at org.opensearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1884)
at org.opensearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1852)
at org.opensearch.client.RestHighLevelClient.search(RestHighLevelClient.java:1095)
at com.linkedin.metadata.search.elasticsearch.query.ESSearchDAO.executeAndExtract(ESSearchDAO.java:196)
at com.linkedin.metadata.search.elasticsearch.query.ESSearchDAO.scroll(ESSearchDAO.java:435)
at com.linkedin.metadata.search.elasticsearch.ElasticSearchService.fullTextScroll(ElasticSearchService.java:347)
at com.linkedin.metadata.search.client.CachingEntitySearchService.getRawScrollResults(CachingEntitySearchService.java:382)
at com.linkedin.metadata.search.client.CachingEntitySearchService.getCachedScrollResults(CachingEntitySearchService.java:319)
at com.linkedin.metadata.search.client.CachingEntitySearchService.scroll(CachingEntitySearchService.java:133)
at com.linkedin.metadata.search.SearchService.scrollAcrossEntities(SearchService.java:259)
at com.linkedin.metadata.client.JavaEntityClient.scrollAcrossEntities(JavaEntityClient.java:469)
at com.datahub.authorization.PolicyFetcher.fetchPolicies(PolicyFetcher.java:87)
at com.datahub.authorization.PolicyFetcher.fetchPolicies(PolicyFetcher.java:77)
at com.datahub.authorization.DataHubAuthorizer$PolicyRefreshRunnable.run(DataHubAuthorizer.java:338)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Suppressed: org.opensearch.client.ResponseException: method [POST], host [http://apm-europa0jupiter.mum1-pp.zeta.in:9200], URI [/datahubpolicyindex_v2/_search?typed_keys=true&max_concurrent_shard_requests=5&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=false], status line [HTTP/1.1 400 Bad Request]
{“error”:{“root_cause”:[{“type”:“parsing_exception”,“reason”:“[term] query does not support [case_insensitive]”,“line”:1,“col”:935}],“type”:“x_content_parse_exception”,“reason”:“[1:935] [bool] failed to parse field [must]”,“caused_by”:{“type”:“x_content_parse_exception”,“reason”:“[1:935] [bool] failed to parse field [should]”,“caused_by”:{“type”:“x_content_parse_exception”,“reason”:“[1:935] [bool] failed to parse field [should]”,“caused_by”:{“type”:“parsing_exception”,“reason”:“[term] query does not support [case_insensitive]”,“line”:1,“col”:935}}}},“status”:400}
at org.opensearch.client.RestClient.convertResponse(RestClient.java:376)
at org.opensearch.client.RestClient.performRequest(RestClient.java:346)
at org.opensearch.client.RestClient.performRequest(RestClient.java:321)
at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1918)
… 20 common frames omitted
Caused by: org.opensearch.OpenSearchException$1: OpenSearch exception [type=x_content_parse_exception, reason=[1:935] [bool] failed to parse field [should]]
at org.opensearch.OpenSearchException.innerFromXContent(OpenSearchException.java:560)
at org.opensearch.OpenSearchException.fromXContent(OpenSearchException.java:471)
at org.opensearch.OpenSearchException.innerFromXContent(OpenSearchException.java:501)
at org.opensearch.OpenSearchException.failureFromXContent(OpenSearchException.java:667)
at org.opensearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:202)
… 23 common frames omitted
Caused by: org.opensearch.OpenSearchException$1: OpenSearch exception [type=x_content_parse_exception, reason=[1:935] [bool] failed to parse field [should]]
at org.opensearch.OpenSearchException.innerFromXContent(OpenSearchException.java:560)
at org.opensearch.OpenSearchException.fromXContent(OpenSearchException.java:471)
at org.opensearch.OpenSearchException.innerFromXContent(OpenSearchException.java:501)
… 27 common frames omitted
Caused by: org.opensearch.OpenSearchException$1: OpenSearch exception [type=parsing_exception, reason=[term] query does not support [case_insensitive]]
at org.opensearch.OpenSearchException.innerFromXContent(OpenSearchException.java:560)
at org.opensearch.OpenSearchException.fromXContent(OpenSearchException.java:471)
at org.opensearch.OpenSearchException.innerFromXContent(OpenSearchException.java:501)
… 29 common frames omitted
2024-04-23 16:49:54,856 [pool-14-thread-1] ERROR c.d.authorization.DataHubAuthorizer:345 - Failed to retrieve policy urns! Skipping updating policy cache until next refresh. count: 1000, scrollId: null
com.datahub.util.exception.ESQueryException: Search query failed:
at com.linkedin.metadata.search.elasticsearch.query.ESSearchDAO.executeAndExtract(ESSearchDAO.java:205)
at com.linkedin.metadata.search.elasticsearch.query.ESSearchDAO.scroll(ESSearchDAO.java:435)
at com.linkedin.metadata.search.elasticsearch.ElasticSearchService.fullTextScroll(ElasticSearchService.java:347)
at com.linkedin.metadata.search.client.CachingEntitySearchService.getRawScrollResults(CachingEntitySearchService.java:382)
at com.linkedin.metadata.search.client.CachingEntitySearchService.getCachedScrollResults(CachingEntitySearchService.java:319)
at com.linkedin.metadata.search.client.CachingEntitySearchService.scroll(CachingEntitySearchService.java:133)
at com.linkedin.metadata.search.SearchService.scrollAcrossEntities(SearchService.java:259)
at com.linkedin.metadata.client.JavaEntityClient.scrollAcrossEntities(JavaEntityClient.java:469)
at com.datahub.authorization.PolicyFetcher.fetchPolicies(PolicyFetcher.java:87)
at com.datahub.authorization.PolicyFetcher.fetchPolicies(PolicyFetcher.java:77)
at com.datahub.authorization.DataHubAuthorizer$PolicyRefreshRunnable.run(DataHubAuthorizer.java:338)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)

Datahub version; 0.9.2 looking to upgrade to version 0.13.0

Hey there! :wave: Make sure your message includes the following information if relevant, so we can help more effectively!

  1. Which DataHub version are you using? (e.g. 0.12.0)
  2. Please post any relevant error logs on the thread!