# Message: MissingPropertyException\[No such property: red for class

**URL:** <https://discuss.elastic.co/t/message-missingpropertyexception-no-such-property-red-for-class/90296>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 21, 2017, 1:09pm UTC](https://discuss.elastic.co/t/message-missingpropertyexception-no-such-property-red-for-class/90296 "2017-06-21T13:09:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeenon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeenon/32/24883_2.png) [@zeenon](https://discuss.elastic.co/u/zeenon)\
**Post date:** [June 21, 2017, 1:09pm UTC](https://discuss.elastic.co/t/message-missingpropertyexception-no-such-property-red-for-class/90296/1 "2017-06-21T13:09:45Z")

</div>

I am new to watcher so I do a test with exemple from doc.  
I have copied/pasted the exemple [https://www.elastic.co/guide/en/watcher/2.3/watching-marvel-data.html](https://www.elastic.co/guide/en/watcher/2.3/watching-marvel-data.html) and I have an exception No such property: red for class  
If I substitute the inline code with return true; it is OK at execution time but what's wrong with exemple provided by docuementation ?

> [2017-06-21 15:08:27,784][ERROR][watcher.condition.script] [node\_CELIST0028] failed to execute [script] condition for [cluster\_red\_alert\_19-2017-06-21T13:08:27.768Z]  
> ScriptException[failed to run inline script [if (ctx.payload.hits.total \< 1) return false; def rows = ctx.payload.hits.hits; if (rows[0].\_source.cluster\_state.status != red) return false; if (ctx.payload.aggregations.minutes.buckets.size() \< 12) return false; def last60Seconds = ctx.payload.aggregations.minutes.buckets[-12..-1]; return last60Seconds.every { it.status.buckets.every { s -\> s.key == red }}] using lang [groovy]]; nested: MissingPropertyException[No such property: red for class: 1bb568efecae062d5e5deb7f3d122e79b25973c6];  
> at org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript.run(GroovyScriptEngineService.java:320)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 21, 2017, 1:39pm UTC](https://discuss.elastic.co/t/message-missingpropertyexception-no-such-property-red-for-class/90296/2 "2017-06-21T13:39:56Z")

</div>

The documentation states that `red` is written in ticks, but it is not in your exception.

In addition you should make sure you use a newer version of Elasticsearch and Watcher, 2.3 is pretty old already.

If you upgrade to 5.0, watcher is part of the `x-pack` plugin.

--Alex

---

<div class="post-metadata">

**Author:** ![zeenon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeenon/32/24883_2.png) [@zeenon](https://discuss.elastic.co/u/zeenon)\
**Post date:** [June 21, 2017, 2:18pm UTC](https://discuss.elastic.co/t/message-missingpropertyexception-no-such-property-red-for-class/90296/3 "2017-06-21T14:18:08Z")

</div>

thanks for your answer and now it is fixed

---

<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 19, 2017, 2:18pm UTC](https://discuss.elastic.co/t/message-missingpropertyexception-no-such-property-red-for-class/90296/4 "2017-07-19T14:18:18Z")

</div>

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