# Watcher 2.3 hipchat action not working

**URL:** <https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 23, 2016, 2:35am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727 "2016-06-23T02:35:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsood](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nsood](https://discuss.elastic.co/u/nsood)\
**Post date:** [June 23, 2016, 2:35am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/1 "2016-06-23T02:35:56Z")

</div>

Hi,

I've been trying to set up a basic watcher, to send alerts to HipChat, on my v2.3 Elasticsearch cluster. However looking at the watch history tells me it has been consistently failing throwing 400-Bad request errors, as follows:  
"actions" : [ {  
"id" : "notify-hipchat",  
"type" : "hipchat",  
"status" : "failure",  
"hipchat" : {  
"account" : "notify-monitoring",  
"sent\_messages" : [ {  
"status" : "failure",  
"reason" : "Bad Request",  
"request" : {  
"host" : "[api.hipchat.com](http://api.hipchat.com)",  
"port" : 443,  
"scheme" : "https",  
"method" : "post",  
"path" : "/v2/room/Room Name/notification",  
"headers" : {  
"Content-Type" : "application/json",  
"Authorization" : "Bearer ValidTokenId"  
},  
"body" : "{\n "message" : "Test ES Cluster status is Green",\n "message\_format" : "text",\n "color" : "green"\n}"  
},  
"response" : {  
"status" : 400,  
"headers" : {  
"content-length" : ["0"],  
"connection" : ["Close"]  
}  
},  
"room" : "Room Name",  
"message" : {  
"body" : "Cluster status is Green",  
"format" : "text",  
"color" : "green"  
}  
} ]

Using RestConsole, I've verified that the under-question HipChat API calls work otherwise, hence the token is valid.

Mentioned below are the watcher installation details:  
{"version":{"number":"2.3.0","build\_hash":"0bd7e1459f2eee2318205f2a168bf2d9c6a8dac3","build\_timestamp":"2016-03-29T19:51:42Z","build\_snapshot":false},"tagline":"You Know, for Alerts & Automation"}

Any help would be deeply appreciated as I am blocked now. Thank you in advance.

---

<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 23, 2016, 7:01am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/2 "2016-06-23T07:01:17Z")

</div>

Hey,

the returned status is 400. So there is some client side problem. Have you tried a room without a space in it or tried to escape it, using a plus sign or `%20`

--Alex

---

<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 23, 2016, 7:07am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/3 "2016-06-23T07:07:23Z")

</div>

also can you show your full watch?

---

<div class="post-metadata">

**Author:** ![nsood](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nsood](https://discuss.elastic.co/u/nsood)\
**Post date:** [June 23, 2016, 9:29am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/4 "2016-06-23T09:29:31Z")

</div>

Hey Alex, I did try making the same request (from the above error logs), via Rest Console & it worked fine, so not sure if it should be related to having space in the room name.

Here is the watcher I am trying to create:  
curl -XPUT '\<ES\_URL\>/\_watcher/watch/cluster\_health\_watch' -d '{  
"trigger" : {  
"schedule" : { "interval" : "10s" }  
},  
"input" : {  
"http" : {  
"request" : {  
"host" : "localhost",  
"port" : 9200,  
"path" : "/\_cluster/health"  
}  
}  
},  
"condition" : {  
"compare" : {  
"ctx.payload.status" : { "eq" : "green" }  
}  
},  
"actions" : {  
"notify-hipchat" : {  
"hipchat" : {  
"account" : "notify-monitoring",  
"message" :{  
"body": "Test ES Cluster status is Green",  
"format": "text",  
"color": "green"  
}  
}  
}  
}  
}'

---

<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 23, 2016, 9:40am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/5 "2016-06-23T09:40:43Z")

</div>

can you also share your account setup (without the tokens of course)?

---

<div class="post-metadata">

**Author:** ![nsood](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nsood](https://discuss.elastic.co/u/nsood)\
**Post date:** [June 23, 2016, 9:43am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/6 "2016-06-23T09:43:51Z")

</div>

Sure Alex. Thank you helping out. Here are the account set-up config :  
watcher.actions.hipchat.service.account.notify-monitoring.profile: integration  
watcher.actions.hipchat.service.account.notify-monitoring.auth\_token: \<auth\_token\>  
watcher.actions.hipchat.service.account.notify-monitoring.room: Room Name

---

<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 23, 2016, 9:50am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/7 "2016-06-23T09:50:32Z")

</div>

Hey,

again, have you tried to sent to a room, that does not contain a space or URL encoded the space? Your tool may do that automatically for you, while watcher does not.

--Alex

---

<div class="post-metadata">

**Author:** ![nsood](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nsood](https://discuss.elastic.co/u/nsood)\
**Post date:** [June 23, 2016, 9:55am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/8 "2016-06-23T09:55:30Z")

</div>

Hmm ok. Let me try that possibility as well. Will get back after verifying.

---

<div class="post-metadata">

**Author:** ![nsood](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nsood](https://discuss.elastic.co/u/nsood)\
**Post date:** [June 23, 2016, 1:25pm UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/9 "2016-06-23T13:25:24Z")

</div>

Phew! That worked. I used the roomId instead of the room name(which had spaces) & it worked fine. Thank you for the help, Alex 🙂

---

<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 23, 2016, 1:50pm UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/10 "2016-06-23T13:50:32Z")

</div>

Hey,

glad to see it working! Do you think we should improve our documentation any emphasize anything there to make sure noone else runs into this? happy to get any input here!

--Alex

---

<div class="post-metadata">

**Author:** ![nsood](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nsood](https://discuss.elastic.co/u/nsood)\
**Post date:** [June 24, 2016, 6:02am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/11 "2016-06-24T06:02:12Z")

</div>

Yeah Alex. We should update the documentation to explicitly mention that spaces in roomName won't work, as this is a common use case. Secondly, there is a way to debug the input received for the action (via the logging action), but I don't see anyway to troubleshoot the action. There are no failure logs generated in ES too.

---

<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 24, 2016, 6:56am UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/12 "2016-06-24T06:56:54Z")

</div>

Hey,

its intentional to not log anything into the files - imagine thousands of watches just doing logging, so you might miss errors on Elasticsearch itself. At some point one has to differentiate between system logs by Elasticsearch and application logs by watcher - which is why the letter part is put into the watch history.

You can also debug using the [Execute Watch API](https://www.elastic.co/guide/en/watcher/current/api-rest.html#api-rest-execute-watch) and - as you did - using the watch History.

I'll try to update the documentation soon, thanks for your input!

--Alex

---

<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:44pm UTC](https://discuss.elastic.co/t/watcher-2-3-hipchat-action-not-working/53727/13 "2017-07-06T13:44:43Z")

</div>


