# Not able to create watcher

**URL:** https://discuss.elastic.co/t/not-able-to-create-watcher/125915
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [March 28, 2018, 11:14am UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915 "2018-03-28T11:14:14Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Rahulkumar](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rahulkumar](https://discuss.elastic.co/u/Rahulkumar)
#### Post date: [March 28, 2018, 11:14am UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/1 "2018-03-28T11:14:14Z")

</div>

Hi,

I have created a watcher. When I am trying to execute the same, I am getting below error:

```
{
  "error": {
    "root_cause": [
      {
        "type": "cluster_block_exception",
        "reason": "blocked by: [SERVICE_UNAVAILABLE/2/no master];"
      }
    ],
    "type": "cluster_block_exception",
    "reason": "blocked by: [SERVICE_UNAVAILABLE/2/no master];"
  },
  "status": 503
}

```

Please let me know, what to do to resolve this?

---

<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: [March 28, 2018, 11:34am UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/2 "2018-03-28T11:34:15Z")

</div>

your cluster is lacking a master node. This also means you cannot index new data, so you should fix this now.

--Alex

---

<div class="post-metadata">

### Author: ![Rahulkumar](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rahulkumar](https://discuss.elastic.co/u/Rahulkumar)
#### Post date: [March 28, 2018, 11:38am UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/3 "2018-03-28T11:38:02Z")

</div>

Hi @spinscale, how can I fix the same? I can see below in my Overview page.

```
tiebreaker-0000000000 running 1024 tiebreaker AlQvnwUMTgi5XcDtVwFtRg 6.2.3 	
24%
	
0.0%
instance-0000000002 running 4096 zone-1 6.2.3 	
58%
	
2.3%
instance-0000000001 running 4096 zone-0 AlQvnwUMTgi5XcDtVwFtRg 6.2.3 	
6%
	
0.0%
```

---

<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: [March 28, 2018, 11:39am UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/4 "2018-03-28T11:39:14Z")

</div>

can you show the output of `GET _cat/nodes?v`

---

<div class="post-metadata">

### Author: ![Rahulkumar](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rahulkumar](https://discuss.elastic.co/u/Rahulkumar)
#### Post date: [March 28, 2018, 11:40am UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/5 "2018-03-28T11:40:37Z")

</div>

> [@spinscale](#):
>
> GET \_cat/nodes?v

here is the output of the same:

```
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
172.25.166.159 30 98 13 0.41 0.50 0.59 mi * tiebreaker-0000000000
172.25.108.147 11 97 1 0.41 1.05 1.06 mdi - instance-0000000001
172.25.5.91 57 99 21 11.50 13.87 12.76 mdi - instance-0000000002

```

---

<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: [March 28, 2018, 12:01pm UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/6 "2018-03-28T12:01:43Z")

</div>

you do have a master node here, can you retry? If it does not work, can you restart watcher and paste the responses?

Also can you show the **exact** comands you executed to create/execute the watch?

---

<div class="post-metadata">

### Author: ![Rahulkumar](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rahulkumar](https://discuss.elastic.co/u/Rahulkumar)
#### Post date: [March 28, 2018, 12:15pm UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/7 "2018-03-28T12:15:21Z")

</div>

Hi @spinscale, I am trying from long time, but it is not working.  
Sorry, but I do not have an idea on how to restart only watcher in x-pack?  
Actually watcher is not created only!  
When I am trying to create the watcher(qa-mon-oom) in dev tool, I am getting error, I mentioned earlier.

```
PUT _xpack/watcher/watch/qa-mon-oom
{
  "trigger": {
    "schedule": {
      "interval": "1s"
    }
  },
  "input": {
    "search": {
      "request": {
        "indices": "qa-mon-serverlogs*",
        "types": "doc",
        "body": {
          "query": {
            "match_all": {}
          },
          "sort":[
            {
              "logTimestamp":{
                "order": "desc"
              }
            }
          ]
        }
      }
    }
  },
  "condition": {
    "compare":{
      "ctx.payload.hits.hits.0._source.syslog_message": {
        "gt": "OutOfMemoryErrro"
      }
    }
  },
  "actions": {
  "send_email" : { 
    "throttle_period": "10m",
    "email": {
      "to": "abc@def.com", 
      "subject": "QA-mon-OOM", 
      "body": "Error message: {{ctx.payload.hits.hits.0._source.syslog_message}} "
    }
  }
 }
}
```

---

<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: [March 28, 2018, 12:23pm UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/8 "2018-03-28T12:23:11Z")

</div>

You should start reading your logfiles, and find out why no master node is being elected (I have the assumption there might be more than one node elected, btu it is super hard to tell with the given information, you would need to run the cat nodes API against all nodes).

This is not a watcher issue, but a cluster issue. You could also restart your nodes, but I have no idea if this will solve your issue, so reading logfiles first makes more sense.

---

<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: [April 25, 2018, 12:23pm UTC](https://discuss.elastic.co/t/not-able-to-create-watcher/125915/9 "2018-04-25T12:23:21Z")

</div>

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