Using the temporal helm charts with MySQL and elasticsearch.enabled=true, I’m seeing a “search_phase_execution_exception” when using Temporal Web:
This stack trace pops up in the logs for elasticsearch-master-0:
{“type”: “server”, “timestamp”: “2020-07-07T18:01:11,425Z”, “level”: “DEBUG”, “component”: “o.e.a.s.TransportSearchAction”, “cluster.name”: “elasticsearch”, “node.name”: “elasticsearch-master-0”, “message”: “All shards failed for phase: [query]”, “cluster.uuid”: “5p7x6DWoRBOMkXWlKRewTg”, “node.id”: “6bA93ZRJTdSCLPRcIUgw2A” ,
“stacktrace”: [“org.elasticsearch.index.query.QueryShardException: No mapping found for [StartTime] in order to sort on”,
“at org.elasticsearch.search.sort.FieldSortBuilder.resolveUnmappedType(FieldSortBuilder.java:506) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder.java:399) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:159) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService.parseSource(SearchService.java:858) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService.createContext(SearchService.java:678) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:631) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:428) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService.access$200(SearchService.java:135) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService$2.lambda$onResponse$0(SearchService.java:395) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.search.SearchService.lambda$runAsync$0(SearchService.java:411) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:692) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-7.7.0.jar:7.7.0]”,
“at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]”,
“at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]”,
“at java.lang.Thread.run(Thread.java:832) [?:?]”] }
I can also verify the keys are setup properly by running:
bash-5.0# tctl --namespace default cl get-search-attr
±----------------------±-----------+
| KEY | VALUE TYPE |
±----------------------±-----------+
| BinaryChecksums | Keyword |
| CloseTime | Int |
| CustomBoolField | Bool |
| CustomDatetimeField | Datetime |
| CustomDoubleField | Double |
| CustomIntField | Int |
| CustomKeywordField | Keyword |
| CustomStringField | String |
| ExecutionStatus | Int |
| ExecutionTime | Int |
| HistoryLength | Int |
| NamespaceId | Keyword |
| RunId | Keyword |
| StartTime | Int |
| TaskQueue | Keyword |
| TemporalChangeVersion | Keyword |
| WorkflowId | Keyword |
| WorkflowType | Keyword |
±----------------------±-----------+
I’m not sure where to go from here, perhaps there’s an Elasticsearch mapping template that hasn’t been applied? Any help would be appreciated.