# ScriptException\[dynamic scripting for \[groovy\] disabled\]

**URL:** <https://discuss.elastic.co/t/scriptexception-dynamic-scripting-for-groovy-disabled/22518>\
**Category:** Elasticsearch\
**Created:** [March 4, 2015, 6:06pm UTC](https://discuss.elastic.co/t/scriptexception-dynamic-scripting-for-groovy-disabled/22518 "2015-03-04T18:06:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Freegard\_2](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@Steve\_Freegard\_2](https://discuss.elastic.co/u/Steve_Freegard_2)\
**Post date:** [March 4, 2015, 6:06pm UTC](https://discuss.elastic.co/t/scriptexception-dynamic-scripting-for-groovy-disabled/22518/1 "2015-03-04T18:06:29Z")

</div>

Hi All,

I've just done a fresh install of ElasticSearch 1.4.4 and I was  
previously using ElasticSearch 1.3 and I've run into an issue with my  
app that I can't resolve.

I converted my MVEL scripts to Groovy and placed them into the  
config/scripts directory, each with .groovy extensions, but whenever I  
use the Update API to attempt to call these scripts I get a  
ScriptException saying that dynamic script is disabled, despite the fact  
that I'm not trying to use dynamic scripting:

[2015-03-04 17:58:15,938][WARN][bulk.udp] [Gardener]  
[21] failed to execute bulk request: failure in bulk execution:  
[2]: index [messages-20150304], type [message], id  
[F982263F-8804-4014-803C-885B6EA04EBD.1], message  
[ElasticsearchIllegalArgumentException[failed to execute script];  
nested: ScriptException[dynamic scripting for [groovy] disabled]; ]

I can see from the logs that ES is seeing the scripts and compiling them:

[2015-03-04 17:36:16,485][INFO][script] [Gardener]  
compiling script file [/etc/elasticsearch/scripts/update\_subsc  
ription.groovy]  
[2015-03-04 17:36:16,449][INFO][script] [Gardener]  
compiling script file [/etc/elasticsearch/scripts/update\_messa  
ge.groovy]  
[2015-03-04 17:36:16,417][INFO][script] [Gardener]  
compiling script file [/etc/elasticsearch/scripts/update\_defer  
red\_message.groovy]  
[2015-03-04 17:36:15,935][INFO][script] [Gardener]  
compiling script file [/etc/elasticsearch/scripts/update\_bounc  
ed\_message.groovy]

I'm using the Bulk UDP API to send the update like this:

{"update":{"\_index":"messages-20150304","\_type":"message","\_id":"CF152663-CA97-45A4-9A16-FAB2E306831F.1"}}  
{"script\_id":"update\_message","params":{"rcpt":"smf@fsl.com","host":"[inbound.mxdomain.com](http://inbound.mxdomain.com)","ip":"98.129.185.132","port":25,"response":"Ok:  
queued as  
44/C5-01861-E0947F45","secured":true,"mode":"SMTP","delay":2.786,"status":"delivered"}}

I was using 'script' instead of 'script\_id' on 1.3.0, but I checked it  
as per the docs.

Can anyone see what I'm doing wrong an point me in the right direction?

Thanks in advance.

Kind regards,  
Steve.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/md7hj5%24rb%241%40ger.gmane.org](https://groups.google.com/d/msgid/elasticsearch/md7hj5%24rb%241%40ger.gmane.org).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [March 5, 2015, 9:39am UTC](https://discuss.elastic.co/t/scriptexception-dynamic-scripting-for-groovy-disabled/22518/2 "2015-03-05T09:39:46Z")

</div>

Hi Steve,

The 'script\_id' parameter is used to find indexed scripts (scripts stored  
in the special .scripts index). This is considered part of dynamic  
scripting. As you are using file scripts you should use the 'script\_file'  
parameter to specify the name of your script. More information on this can  
be found  
here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#modules-scripting)

Hope this helps,

Colin

On Wednesday, 4 March 2015 18:10:48 UTC, Steve Freegard wrote:

> Hi All,
> 
> I've just done a fresh install of Elasticsearch 1.4.4 and I was  
> previously using Elasticsearch 1.3 and I've run into an issue with my  
> app that I can't resolve.
> 
> I converted my MVEL scripts to Groovy and placed them into the  
> config/scripts directory, each with .groovy extensions, but whenever I  
> use the Update API to attempt to call these scripts I get a  
> ScriptException saying that dynamic script is disabled, despite the fact  
> that I'm not trying to use dynamic scripting:
> 
> [2015-03-04 17:58:15,938][WARN][bulk.udp] [Gardener]  
> [21] failed to execute bulk request: failure in bulk execution:  
> [2]: index [messages-20150304], type [message], id  
> [F982263F-8804-4014-803C-885B6EA04EBD.1], message  
> [ElasticsearchIllegalArgumentException[failed to execute script];  
> nested: ScriptException[dynamic scripting for [groovy] disabled]; ]
> 
> I can see from the logs that ES is seeing the scripts and compiling them:
> 
> [2015-03-04 17:36:16,485][INFO][script] [Gardener]  
> compiling script file [/etc/elasticsearch/scripts/update\_subsc  
> ription.groovy]  
> [2015-03-04 17:36:16,449][INFO][script] [Gardener]  
> compiling script file [/etc/elasticsearch/scripts/update\_messa  
> ge.groovy]  
> [2015-03-04 17:36:16,417][INFO][script] [Gardener]  
> compiling script file [/etc/elasticsearch/scripts/update\_defer  
> red\_message.groovy]  
> [2015-03-04 17:36:15,935][INFO][script] [Gardener]  
> compiling script file [/etc/elasticsearch/scripts/update\_bounc  
> ed\_message.groovy]
> 
> I'm using the Bulk UDP API to send the update like this:
> 
> {"update":{"\_index":"messages-20150304","\_type":"message","\_id":"CF152663-CA97-45A4-9A16-FAB2E306831F.1"}}
> 
> {"script\_id":"update\_message","params":{"[rcpt":"smf@fsl.com](mailto:rcpt%22:%22smf@fsl.com)","host":"  
> [inbound.mxdomain.com](http://inbound.mxdomain.com)","ip":"98.129.185.132","port":25,"response":"Ok:  
> queued as  
> 44/C5-01861-E0947F45","secured":true,"mode":"SMTP","delay":2.786,"status":"delivered"}}
> 
> I was using 'script' instead of 'script\_id' on 1.3.0, but I checked it  
> as per the docs.
> 
> Can anyone see what I'm doing wrong an point me in the right direction?
> 
> Thanks in advance.
> 
> Kind regards,  
> Steve.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c066cb0e-e377-43f1-a30b-76d10d389bc9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c066cb0e-e377-43f1-a30b-76d10d389bc9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:28am UTC](https://discuss.elastic.co/t/scriptexception-dynamic-scripting-for-groovy-disabled/22518/3 "2017-07-06T00:28:21Z")

</div>


