Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request failed to execute. Call: Status code 400 from: POST /post-index/_search?pretty=true&error_trace=true&typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: "all shards failed" #1

Open
huster-songtao opened this issue Jan 9, 2022 · 1 comment

Comments

@huster-songtao
Copy link

在 Elasticsearch.Net.Transport1.HandleElasticsearchClientException(RequestData data, Exception clientException, IElasticsearchResponse response) 在 Elasticsearch.Net.Transport1.FinalizeResponse[TResponse](RequestData requestData, IRequestPipeline pipeline, List1 seenExceptions, TResponse response) 在 Elasticsearch.Net.Transport1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
在 Elasticsearch.Net.ElasticLowLevelClient.DoRequest[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
在 Nest.ElasticClient.DoRequest[TRequest,TResponse](TRequest p, IRequestParameters parameters, Action1 forceConfiguration) 在 Nest.ElasticClient.Search[TDocument](ISearchRequest request) 在 Nest.ElasticClient.Search[TDocument](Func2 selector)
在 Sample.ElasticSearch.ElastisSearchExtensions.Others(ElasticClient client) 在 C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\ElasticSearch.cs 中: 第 1796 行
在 Sample.ElasticSearch.Test() 在 C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\ElasticSearch.cs 中: 第 58 行
在 Sample.Program.Main(String[] args) 在 C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\Program.cs 中: 第 15 行

@huster-songtao
Copy link
Author

($exception).DebugInformation

FailureReason: BadResponse while attempting POST on http://219.142.106.137:9200/post-index/_search?pretty=true&error_trace=true&typed_keys=true

Server indicated deprecations:

Audit trail of this API call:

OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 400 from: POST /post-index/_search?pretty=true&error_trace=true&typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: "all shards failed"

at Elasticsearch.Net.Transport1.HandleElasticsearchClientException(RequestData data, Exception clientException, IElasticsearchResponse response) at Elasticsearch.Net.Transport1.FinalizeResponse[TResponse](RequestData requestData, IRequestPipeline pipeline, List1 seenExceptions, TResponse response) at Elasticsearch.Net.Transport1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
at Elasticsearch.Net.ElasticLowLevelClient.DoRequest[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
at Nest.ElasticClient.DoRequest[TRequest,TResponse](TRequest p, IRequestParameters parameters, Action1 forceConfiguration) at Nest.ElasticClient.Search[TDocument](ISearchRequest request) at Nest.ElasticClient.Search[TDocument](Func2 selector)
at Sample.ElasticSearch.ElastisSearchExtensions.Others(ElasticClient client) in C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\ElasticSearch.cs:line 1796
at Sample.ElasticSearch.Test() in C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\ElasticSearch.cs:line 58
at Sample.Program.Main(String[] args) in C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\Program.cs:line 15

Request:

{"aggs":{"my terms":{"terms":{"field":"title.keyword"}}},"query":{"match":{"title":{"query":"my query"}}},"sort":[{"title.keyword":{"order":"desc"}}]}

Response:

{
"error" : {
"root_cause" : [
{
"type" : "query_shard_exception",
"reason" : "No mapping found for [title.keyword] in order to sort on",
"index_uuid" : "hHs1r7OeQee8455-MpFFwg",
"index" : "post-index",
"stack_trace" : "[post-index/hHs1r7OeQee8455-MpFFwg] QueryShardException[No mapping found for [title.keyword] in order to sort on]\r\n\tat org.elasticsearch.search.sort.FieldSortBuilder.resolveUnmappedType(FieldSortBuilder.java:589)\r\n\tat org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder.java:432)\r\n\tat org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:154)\r\n\tat org.elasticsearch.search.SearchService.parseSource(SearchService.java:1188)\r\n\tat org.elasticsearch.search.SearchService.createContext(SearchService.java:982)\r\n\tat org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:618)\r\n\tat org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:483)\r\n\tat org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47)\r\n\tat org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)\r\n\tat org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)\r\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:777)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\r\n\tat java.base/java.lang.Thread.run(Thread.java:833)\r\n"
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "post-index",
"node" : "K373iVEsRvyQptrs15YuGA",
"reason" : {
"type" : "query_shard_exception",
"reason" : "No mapping found for [title.keyword] in order to sort on",
"index_uuid" : "hHs1r7OeQee8455-MpFFwg",
"index" : "post-index",
"stack_trace" : "[post-index/hHs1r7OeQee8455-MpFFwg] QueryShardException[No mapping found for [title.keyword] in order to sort on]\r\n\tat org.elasticsearch.search.sort.FieldSortBuilder.resolveUnmappedType(FieldSortBuilder.java:589)\r\n\tat org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder.java:432)\r\n\tat org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:154)\r\n\tat org.elasticsearch.search.SearchService.parseSource(SearchService.java:1188)\r\n\tat org.elasticsearch.search.SearchService.createContext(SearchService.java:982)\r\n\tat org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:618)\r\n\tat org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:483)\r\n\tat org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47)\r\n\tat org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)\r\n\tat org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)\r\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:777)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\r\n\tat java.base/java.lang.Thread.run(Thread.java:833)\r\n"
}
}
],
"stack_trace" : "Failed to execute phase [query], all shards failed; shardFailures {[K373iVEsRvyQptrs15YuGA][post-index][0]: RemoteTransportException[[node-1][219.142.106.137:9300][indices:data/read/search[phase/query]]]; nested: QueryShardException[No mapping found for [title.keyword] in order to sort on]; }\r\n\tat org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:725)\r\n\tat org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:412)\r\n\tat org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:757)\r\n\tat org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:509)\r\n\tat org.elasticsearch.action.search.AbstractSearchAsyncAction.access$000(AbstractSearchAsyncAction.java:64)\r\n\tat org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:343)\r\n\tat org.elasticsearch.action.ActionListener$Delegating.onFailure(ActionListener.java:66)\r\n\tat org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:48)\r\n\tat org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:651)\r\n\tat org.elasticsearch.transport.TransportService$4.handleException(TransportService.java:853)\r\n\tat org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1481)\r\n\tat org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1590)\r\n\tat org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1564)\r\n\tat org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:50)\r\n\tat org.elasticsearch.transport.TransportChannel.sendErrorResponse(TransportChannel.java:45)\r\n\tat org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:41)\r\n\tat org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:77)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:28)\r\n\tat org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)\r\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:777)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\r\n\tat java.base/java.lang.Thread.run(Thread.java:833)\r\nCaused by: [post-index/hHs1r7OeQee8455-MpFFwg] QueryShardException[No mapping found for [title.keyword] in order to sort on]\r\n\tat org.elasticsearch.search.sort.FieldSortBuilder.resolveUnmappedType(FieldSortBuilder.java:589)\r\n\tat org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder.java:432)\r\n\tat org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:154)\r\n\tat org.elasticsearch.search.SearchService.parseSource(SearchService.java:1188)\r\n\tat org.elasticsearch.search.SearchService.createContext(SearchService.java:982)\r\n\tat org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:618)\r\n\tat org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:483)\r\n\tat org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47)\r\n\tat org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62)\r\n\tat org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)\r\n\t... 6 more\r\n"
},
"status" : 400
}

TCP states:

Established: 33
TimeWait: 3
SynSent: 2

ThreadPool statistics:

Worker:
Busy: 1
Free: 32766
Min: 8
Max: 32767
IOCP:
Busy: 0
Free: 1000
Min: 8
Max: 1000

Exception:

Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 400 from: POST /post-index/_search?pretty=true&error_trace=true&typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: "all shards failed"
at Elasticsearch.Net.Transport1.HandleElasticsearchClientException(RequestData data, Exception clientException, IElasticsearchResponse response) at Elasticsearch.Net.Transport1.FinalizeResponse[TResponse](RequestData requestData, IRequestPipeline pipeline, List1 seenExceptions, TResponse response) at Elasticsearch.Net.Transport1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
at Elasticsearch.Net.ElasticLowLevelClient.DoRequest[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
at Nest.ElasticClient.DoRequest[TRequest,TResponse](TRequest p, IRequestParameters parameters, Action1 forceConfiguration) at Nest.ElasticClient.Search[TDocument](ISearchRequest request) at Nest.ElasticClient.Search[TDocument](Func2 selector)
at Sample.ElasticSearch.ElastisSearchExtensions.Others(ElasticClient client) in C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\ElasticSearch.cs:line 1796
at Sample.ElasticSearch.Test() in C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\ElasticSearch.cs:line 58
at Sample.Program.Main(String[] args) in C:\Users\Tao\Downloads\Elasticsearch-NEST-CheatSheet-Tutorials-master\Elasticsearch-NEST-CheatSheet-Tutorials-master\Sample\Program.cs:line 15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant