Stackstorm and Rocketchat issue


(milind) #1

Hi guys,

I am new to stackstorm and chops…

I followed official tutorial and successfully setup st2chatops service in stackstorm.

I created a pack named mychatops and created an alias
mychatops/aliases/remote.yaml:

---
name: "remote_shell_cmd"
action_ref: "core.remote"
description: "Execute a command on a remote host via SSH."
formats:
  - "run {{cmd}} on {{hosts}}"
result:
  format: "action completed!"

reload the service:

st2 run packs.setup_virtualenv packs=mychatops && st2ctl reload --register-all
service st2chatops restart

then go to my rocketChat room(general) and type !help , it works well, but after I type !run date on localhost the bot only reply me ack info:

I'll take it from here! Your execution ID for reference is 58ee0efdfa089f3fa100311e (details available at https://stackstorm01.matrix.corp.com/#/history/58ee0efdfa089f3fa100311e/general)

I checked action history in the webui, the status of chatops.post_result showed succeeded, am I missing some configuration?

I have two default rules
mychatops/rules/notify_hubot.yaml:

---
name: "notify"
pack: "mychatops"
enabled: true
description: "Notification rule to send results of action executions to stream for chatops"
trigger:
  type: "core.st2.generic.notifytrigger"
criteria:
  trigger.route:
    pattern: "hubot"
    type: "equals"
action:
  ref: chatops.post_result
  parameters:
    channel: "{{trigger.data.source_channel}}"
    user: "{{trigger.data.user}}"
    execution_id: "{{trigger.execution_id}}"

I am getting the acknowledgement but no result. In the logs i can see command is getting executed on the remote server and tirgger shows proper data. However in the chat window i won’t get anything.

Thanks in advance

Regards,
Milind


(Lindsay Hill) #2

There’s a few possibilities. The first thing that comes to mind is that you should not have created that mychatops/rules/notify_hubot.yaml rule. If you did a normal installation, you should already have a notification rule in the chatops pack.

Make sure you don’t have duplicate rules.

Check the troubleshooting guide here ChatOps Troubleshooting Guide — StackStorm 2.9.1 documentation


(milind) #3

Hi Lindsay,

Thanks for Quick Reply.
I have tried with removing all the rules that I have added. and also with fresh setup as well. but getting the same issue.

My setup is as below:

Stackstorm is working on server 1 which is ubuntu 16.04 box and rocketchat server is working on another box which is again ubuntu 16.04.

My !help command works perfect but for command !st2 list actions I get acknowledgement only.

As per the link you have shared, I am stuck at rule 3 (Gives an acknowledgement message without result:)

As there is no errors in the logs(st2 logs, nginx) not sure how to move further.

Regards,
Milind