# Compatibility issues in Watcher?

**URL:** <https://discuss.elastic.co/t/compatibility-issues-in-watcher/57154>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 3, 2016, 9:37pm UTC](https://discuss.elastic.co/t/compatibility-issues-in-watcher/57154 "2016-08-03T21:37:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartikvelastic](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kartikvelastic](https://discuss.elastic.co/u/kartikvelastic)\
**Post date:** [August 3, 2016, 9:37pm UTC](https://discuss.elastic.co/t/compatibility-issues-in-watcher/57154/1 "2016-08-03T21:37:49Z")

</div>

PUT \_watcher/watch/my-watch  
{  
"trigger" : {  
"schedule" : { "cron" : "0 0/1 \* \* \* ?" }  
},  
"input" : {  
"search" : {  
"request" : {  
"indices" : [  
"httpd\*"  
],  
"body" : {  
"query" : {  
"filtered": {  
"query": {  
"match": { "response": 404 }  
},  
"filter": {  
"range": {  
"@timestamp" : {  
"from": "{{ctx.trigger.scheduled\_time}}||-5m",  
"to": "{{ctx.trigger.triggered\_time}}"  
}  
}  
}  
}  
}  
}  
}  
}  
},  
"condition" : {  
"script" : "ctx.payload.hits.total \> 1"  
},  
"actions" : {  
"email\_admin" : {  
"email" : {  
"to" : "kartik.unix@gmail.com",  
"subject" : "404 recently encountered"  
}  
}  
}  
}'

{  
"error": {  
"root\_cause": [  
{  
"type": "script\_exception",  
"reason": "failed to compile script [ScriptException[scripts of type [inline], operation [elasticsearch-watcher\_watch] and lang [groovy] are disabled]] with lang [ctx.payload.hits.total \> 1] 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 [ctx.payload.hits.total \> 1] of type [groovy]"  
},  
"status": 500  
}

---

<div class="post-metadata">

**Author:** ![kartikvelastic](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kartikvelastic](https://discuss.elastic.co/u/kartikvelastic)\
**Post date:** [August 3, 2016, 10:50pm UTC](https://discuss.elastic.co/t/compatibility-issues-in-watcher/57154/2 "2016-08-03T22:50:36Z")

</div>

Allright this issue was resolved via:

> [@Watcher Condition "script" : { "script" : ""}}. Not working](https://discuss.elastic.co/t/watcher-condition-script-script-not-working/39710/5):
>
> Im also receiving the same error when attempting to setup a new watch. { "error": { "root\_cause": [{ "type": "script\_exception", "reason": "failed to compile script [ScriptException[scripts of type [inline], operation [elasticsearch-watcher\_watch] and lang [groovy] are disabled]] with lang [if (ctx.payload.aggregations.minutes.buckets.size() == 0) return false; def latest = ctx.payload.aggregations.minutes.buckets[-1]; def node = latest.nodes.buckets[0]; return node && node.memory && node…

---

<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:** [August 4, 2016, 8:01am UTC](https://discuss.elastic.co/t/compatibility-issues-in-watcher/57154/3 "2016-08-04T08:01:20Z")

</div>

Please put more information and effort in your posts.  
Simply having a vague subject and then unformatted code with no explanation of what you are asking for is a guaranteed way to not get any assistance from the community.

---

<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, 1:43pm UTC](https://discuss.elastic.co/t/compatibility-issues-in-watcher/57154/4 "2017-07-06T13:43:52Z")

</div>


