# Operation \[elasticsearch-watcher\_watch\] and lang \[groovy\] are disabled

**URL:** https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603
**Category:** Elasticsearch
**Created:** [November 15, 2015, 12:18am UTC](https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603 "2015-11-15T00:18:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aanm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aanm/32/528_2.png) [@aanm](https://discuss.elastic.co/u/aanm)
#### Post date: [November 15, 2015, 12:18am UTC](https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603/1 "2015-11-15T00:18:58Z")

</div>

I'm getting this error while I'm trying to push a \_watcher configuration to elasticsearch:  
`{"error":{"root_cause":[{"type":"script_exception","reason":"failed to compile script [ScriptException[scripts of type [inlin], operation [elasticsearch-watcher_watch] and lang [groovy] are disabled]] with lang [return [body: groovy.json.JsonOutput.toJson(ctx.payload.hits.hits)]] of type [groovy]"}],"type":"script_exception","reason":"failed to compile script [ScriptException[scripts of type [inline], operation [elasticsearch-watcher_watch] and lang [groovy] are disabled]] with lang [return [body: groovy.json.JsonOutput.toJson(ctx.payload.hits.hits)]] of type [groovy]"},"status":500}[`

I'm using elasticsearch docker image and I've edit the elasticsearch.yml file and I've write the following,

```auto
echo "script.engine.groovy.inline.aggs: on" >> /etc/elasticsearch/elasticsearch.yml 
echo "script.engine.groovy.inline.mapping: on" >> /etc/elasticsearch/elasticsearch.yml 
echo "script.engine.groovy.inline.search: on" >> /etc/elasticsearch/elasticsearch.yml 
echo "script.engine.groovy.inline.update: on" >> /etc/elasticsearch/elasticsearch.yml 
echo "script.engine.groovy.inline.plugin: on" >> /etc/elasticsearch/elasticsearch.yml 

```

I restart the container but nothing happens, the error still occurs. Am I missing something? Thanks

---

<div class="post-metadata">

### Author: ![aanm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aanm/32/528_2.png) [@aanm](https://discuss.elastic.co/u/aanm)
#### Post date: [November 17, 2015, 5:08pm UTC](https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603/2 "2015-11-17T17:08:12Z")

</div>

Ping @colings86 can you help me?  
Also is it possible to run those options has parameters such as: `-Des.script.engine.groovy.inline.search=on`?

---

<div class="post-metadata">

### Author: ![pgcr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pgcr](https://discuss.elastic.co/u/pgcr)
#### Post date: [February 2, 2016, 5:23pm UTC](https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603/3 "2016-02-02T17:23:50Z")

</div>

Hey @aanm, have you been able to figure out the reason? Im currently attempting to setup a watch under the same conditions, but no luck so far.

---

<div class="post-metadata">

### Author: ![s8sg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s8sg/32/12274_2.png) [@s8sg](https://discuss.elastic.co/u/s8sg)
#### Post date: [October 3, 2016, 10:33am UTC](https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603/4 "2016-10-03T10:33:31Z")

</div>

Edited :

It should work with:  
`script.engine.groovy.inline.elasticsearch-watcher_watch: on`

The error indicates :  
`[ScriptException[scripts of type [inline], operation [elasticsearch-watcher_watch] and lang [groovy] are disabled]]` the Operation: `elasticsearch-watcher_watch` and the script lang is: `groovy`

`script.engine.<script_lang>.<execution_type>.<operation>`

Where the basic operations are described at:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#enable-dynamic-scripting](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#enable-dynamic-scripting)

---

<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 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/operation-elasticsearch-watcher-watch-and-lang-groovy-are-disabled/34603/5 "2017-07-05T22:13:45Z")

</div>


