# Failed to find action \[org.elasticsearch.script.mustache.SearchTemplateAction@76440dba\] to execute

**URL:** <https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644>\
**Category:** Elasticsearch\
**Created:** [November 17, 2020, 9:12am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644 "2020-11-17T09:12:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshdkaatkar](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rakeshdkaatkar](https://discuss.elastic.co/u/rakeshdkaatkar)\
**Post date:** [November 17, 2020, 9:12am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/1 "2020-11-17T09:12:22Z")

</div>

Im getting below exception when im trying to use mustache template.

failed to find action [org.elasticsearch.script.mustache.SearchTemplateAction@76440dba] to execute

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2020, 10:47pm UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/2 "2020-11-17T22:47:03Z")

</div>

Please share the template and the entire error you are seeing.

---

<div class="post-metadata">

**Author:** ![rakeshdkaatkar](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rakeshdkaatkar](https://discuss.elastic.co/u/rakeshdkaatkar)\
**Post date:** [November 18, 2020, 5:04am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/3 "2020-11-18T05:04:14Z")

</div>

Hi please find below template and im not able to see any logs apart from this.

{

```
"script": {

    "lang": "mustache",

    "source": "{\"query\":{\"bool\":{\"should\":[{\"{{#orFields}}nested\":{\"path\":\"{{path}}\",\"query\":{\"terms\":{\"{{path}}.{{key}}.{{key}}_keyword\":[\"{{#toJson}}values{{\/toJson}}\"]}}}},{\"{{\/orFields}}bool\":{\"must_not\":{\"terms\":{\"mock\":[\"mock\"]}}}}],\"must\":[{\"{{#andFields}}nested\":{\"path\":\"{{path}}\",\"query\":{\"terms\":{\"{{path}}.{{key}}.{{key}}_keyword\":[\"{{#toJson}}values{{\/toJson}}\"]}}}},{\"{{\/andFields}}{{#rangeFields}}range\":{\"processInstrumentCreatedDate\":{\"{{#from}}gte\":\"{{from}}{{#to}}\",\"{{\/to}}{{\/from}}{{#to}}lte\":\"{{to}}{{\/to}}\"}}},{\"{{\/rangeFields}}bool\":{\"must_not\":{\"terms\":{\"mock\":[\"mock\"]}}}}]}},\"{{#pageFields}}{{#page_size}}size\":\"{{page_size}}{{\/page_size}}\",\"from{{#page_from}}\":\"{{page_from}}{{\/page_from}}\",\"{{\/pageFields}}sort\":[{\"{{#sortFields}}{{sortKey}}\":{\"order\":\"{{sortOrder}}\",\"nested\":{\"path\":\"{{sortPath}}\"}}}],\"{{\/sortFields}}_source\":{\"includes\":[\"{{#include_path}}\",\"{{.}}\",\"{{\/include_path}}\"],\"excludes\":[\"{{#exclude_path}}\",\"{{.}}\",\"{{\/exclude_path}}\"]}{{#isSearch}},\"search_after\":[{{#join}}search_after{{\/join}}]{{\/isSearch}}}"

}

```

}

---

<div class="post-metadata">

**Author:** ![rakeshdkaatkar](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rakeshdkaatkar](https://discuss.elastic.co/u/rakeshdkaatkar)\
**Post date:** [November 18, 2020, 6:26am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/4 "2020-11-18T06:26:31Z")

</div>

Also if I dont delete lang-mustache from module folder and place those jar in lib folder i'm getting below error.

java.lang.NoClassDefFoundError: org/elasticsearch/script/mustache/SearchTemplateRequestBuilder  
at com.wipro.basenxt.search.core.query.QueryTemplateAdapter.adapt(QueryTemplateAdapter.java:29)  
at com.wipro.basenxt.search.core.query.QueryExecEngine.execute(QueryExecEngine.java:49)  
at com.wipro.basenxt.search.core.rest.QueryProcessor.getResult(QueryProcessor.java:35)  
at com.wipro.basenxt.search.core.rest.AbstractRestHandler.prepareRequest(AbstractRestHandler.java:110)  
at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:94)  
at org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:81)  
at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:236)  
at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:318)  
at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:176)  
at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:318)  
at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:372)  
at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:308)  
at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:42)  
at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:28)  
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:58)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)  
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 18, 2020, 7:14am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/5 "2020-11-18T07:14:33Z")

</div>

Please format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you 🙂

---

<div class="post-metadata">

**Author:** ![rakeshdkaatkar](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rakeshdkaatkar](https://discuss.elastic.co/u/rakeshdkaatkar)\
**Post date:** [November 18, 2020, 10:29am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/6 "2020-11-18T10:29:40Z")

</div>

But what i see from code is that issue is with mustache jar because same thing is working in 7.0.0 but not working in 7.9.0.

Can you please tell me if i need to change anything particular to 7.9.0

---

<div class="post-metadata">

**Author:** ![rakeshdkaatkar](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rakeshdkaatkar](https://discuss.elastic.co/u/rakeshdkaatkar)\
**Post date:** [November 19, 2020, 7:24am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/7 "2020-11-19T07:24:29Z")

</div>

I have a custom plugin which uses mustache and i have upgarded both plugin and ES to 7.9.0 from 7.0..0.

After upgrading im not able to query using mustache.

I have placed lang-mustache-client-7.9.0.jar to libs and deleted lang-mustache folder from modules.But im getting below error.

TenantNull failed to find action [org.elasticsearch.script.mustache.SearchTemplateAction@76440dba] to execute

Same works in 7.0.0

Can u please help

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 17, 2020, 7:24am UTC](https://discuss.elastic.co/t/failed-to-find-action-org-elasticsearch-script-mustache-searchtemplateaction-76440dba-to-execute/255644/8 "2020-12-17T07:24:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
