Open MrDiba opened 3 years ago
It looks like this is not a Docker specific problem; I installed Stackstorm on a clean ubuntu 20.04.2 LTS vm using the quick install script.
using the same configuration in /opt/stackstorm/chatops/st2chatops.env
:
HUBOT_ADAPTER=rocketchat
ROCKETCHAT_URL=<rocketchat url>
ROCKETCHAT_USER=<bot name>
ROCKETCHAT_PASSWORD=<bot password>
ROCKETCHAT_ROOM=<default room>
A tail on /var/log/syslog
reveals the following error in a loop:
Jul 22 09:07:28 stackstorm systemd[1]: Started StackStorm service st2chatops.
Jul 22 09:07:28 stackstorm hubot[44063]: Thu, 22 Jul 2021 09:07:28 GMT body-parser deprecated undefined extended: provide extended option at node_modules/hubot/src/robot.js:445:21
Jul 22 09:07:28 stackstorm hubot[44063]: [Thu Jul 22 2021 09:07:28 GMT+0000 (Coordinated Universal Time)] DEBUG Loading adapter rocketchat
Jul 22 09:07:28 stackstorm hubot[44063]: [Thu Jul 22 2021 09:07:28 GMT+0000 (Coordinated Universal Time)] ERROR Cannot load adapter rocketchat - Error: Cannot find module 'ddp.js'
Jul 22 09:07:28 stackstorm hubot[44063]: Require stack:
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/@rocket.chat/sdk/node_modules/asteroid/dist/asteroid.node.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/@rocket.chat/sdk/dist/lib/driver.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/@rocket.chat/sdk/dist/index.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/hubot-rocketchat/index.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/hubot/src/robot.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/hubot/es2015.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/hubot/index.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/hubot/bin/hubot.js
Jul 22 09:07:28 stackstorm hubot[44063]: - /opt/stackstorm/chatops/node_modules/hubot/bin/hubot
Jul 22 09:07:28 stackstorm systemd[1]: st2chatops.service: Main process exited, code=exited, status=1/FAILURE
Jul 22 09:07:28 stackstorm systemd[1]: st2chatops.service: Failed with result 'exit-code'.
Jul 22 09:07:33 stackstorm systemd[1]: st2chatops.service: Scheduled restart job, restart counter is at 1037.
Jul 22 09:07:33 stackstorm systemd[1]: Stopped StackStorm service st2chatops.
Thanks for the report @MrDiba. Can you please check what nodejs version do you have installed?
Try to verify installing previous stackstorm version and see if error persist.
In latest st2 v3.5.0
we switched to newer nodejs version.
You can try installing an older st2 v3.4.1 from scratch on a clean VM:
bash <(curl -sSL https://stackstorm.com/packages/install.sh) --user=st2admin --password=Ch@ngeMe --version=3.4.1
Let us know if the error persist in the previous st2chatops version or it's really a new regression.
Hi @armab, thank you for your response. I have checked the nodejs version on the v3.5.0
install and it is v14.17.2
After installing a clean Ubuntu 18.04LTS and installing st2 v3.4.1 the rocketchat adapter will start and load. But I'm running into an issue that it can not connect to my rocket chat instance and time-outs. I do not think this is an problem related to the above issue and will try to get it working.
Jul 27 08:57:20 stackstorm2 systemd[1]: Started StackStorm service st2chatops.
Jul 27 08:57:20 stackstorm2 hubot[19569]: Tue, 27 Jul 2021 08:57:20 GMT body-parser deprecated undefined extended: provide extended option at node_modules/hubot/src/robot.js:445:21
Jul 27 08:57:20 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:20 GMT+0000 (Coordinated Universal Time)] DEBUG Loading adapter rocketchat
Jul 27 08:57:20 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:20 GMT+0000 (Coordinated Universal Time)] INFO [startup] Rocket.Chat adapter in use
Jul 27 08:57:20 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:20 GMT+0000 (Coordinated Universal Time)] INFO [startup] Respond to the name: hubot
Jul 27 08:57:20 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:20 GMT+0000 (Coordinated Universal Time)] INFO I will also respond to my Rocket.Chat username as an alias !
Jul 27 08:57:20 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:20 GMT+0000 (Coordinated Universal Time)] INFO [startup] Rooms specified: <room name>
Jul 27 08:57:20 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:20 GMT+0000 (Coordinated Universal Time)] INFO [connect] Connecting { host: '<rocketchat url>', useSsl: false, timeout: 20000 }
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] INFO [connect] Timeout (20000)
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR Unable to connect: {}
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR undefined
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR Unable to login: {}
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR undefined
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR Unable to join rooms: {}
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR undefined
Jul 27 08:57:40 stackstorm2 hubot[19569]: [Tue Jul 27 2021 08:57:40 GMT+0000 (Coordinated Universal Time)] ERROR Unable to subscribe {}
Jul 27 08:57:40 stackstorm2 hubot[19569]: (node:19569) UnhandledPromiseRejectionWarning: Error: Asteroid connection timeout
Jul 27 08:57:40 stackstorm2 hubot[19569]: at Timeout._onTimeout (/opt/stackstorm/chatops/node_modules/@rocket.chat/sdk/dist/lib/driver.js:130:25)
Jul 27 08:57:40 stackstorm2 hubot[19569]: at ontimeout (timers.js:436:11)
Jul 27 08:57:40 stackstorm2 hubot[19569]: at tryOnTimeout (timers.js:300:5)
Jul 27 08:57:40 stackstorm2 hubot[19569]: at listOnTimeout (timers.js:263:5)
Jul 27 08:57:40 stackstorm2 hubot[19569]: at Timer.processTimers (timers.js:223:10)
Jul 27 08:57:40 stackstorm2 hubot[19569]: (node:19569) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Jul 27 08:57:40 stackstorm2 hubot[19569]: (node:19569) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I also tried to use the v3.4.1 docker release but it looks like that one has no st2chatops included with it?
Can confirm that the time-out problem is not related to to the original issue.
The reason it could not connect is because it tried to connect without SSL when the rocketchat server requires a SSL connection.
Thanks to this topic: https://github.com/RocketChat/hubot-rocketchat/issues/95 it suggested to add export ROCKETCHAT_USESSL=true
to the st2chatops.env and that did the trick.
Thanks @MrDiba for the contribution, I've merged your Pull Request.
So looks like st2chatops v3.4.1 works properly with RocketChat, but there's still a regression in v3.5.0 per first message?
ERROR Cannot load adapter rocketchat - Error: Cannot find module 'ddp.js'
That is correct @armab
Thanks for confirming!
In a meantime, you can use the st2-docker
repository with docker-compose https://github.com/StackStorm/st2-docker/blob/master/docker-compose.yml#L224 from the master branch.
Just pin the st2docker
image version to v3.4.1
in there, while keeping the stackstorm running on the v3.5.0
. They're compatible.
I'm trying to use StackStorm latest version (3.6) with rocketchat and chatops 3.4.1. It connects, responds to commands but chatops.post_message, although it says it's successful, doesn't post anything back to rocketchat. Is there a different version of stackstorm I should use? I tried with both docker and VM install with same results.
When I try to use the st2chatops docker container configured for using Rocket Chat the container will give an error that it can't find
ddp.js
and exits.st2chatops log:
.env
configuration:docker-compose.yml
from https://github.com/stackstorm/st2-dockerHow can I solve this issue?