RocketChat / hubot-rocketchat-boilerplate

An example Hubot demonstrating usage of the Rocket.Chat adaptor.
MIT License
36 stars 32 forks source link

Failed: unable to run hubot-rocketchat-boilerplate | UnhandledPromiseRejectionWarning: Error: Asteroid connection timeout | ERROR Unable to connect: {} #6

Closed jitendra-kr closed 5 years ago

jitendra-kr commented 5 years ago

can some explain why throwing this error

hubot@staging-rocket:~/hubot-rocketchat-boilerplate$ bin/hubot audited 345 packages in 2.343s found 1 low severity vulnerability run npm audit fix to fix them, or npm audit for details body-parser deprecated undefined extended: provide extended option node_modules/hubot/src/robot.js:445:21 [Thu Sep 27 2018 12:41:09 GMT+0000 (UTC)] INFO [startup] Rocket.Chat adapter in use [Thu Sep 27 2018 12:41:09 GMT+0000 (UTC)] INFO [startup] Respond to name: Hubot [Thu Sep 27 2018 12:41:09 GMT+0000 (UTC)] INFO [startup] Respond to alias: mybotuser [Thu Sep 27 2018 12:41:09 GMT+0000 (UTC)] INFO [connect] Connecting { username: 'mybotuser', password: 'mypassword', ldap: false, host: 'chatqa.imobisoft.co.uk', useSsl: true, timeout: 20000, rooms: [ 'general' ], allPublic: false, dm: false, livechat: false, edited: false, integrationId: 'js.SDK', roomCacheMaxSize: 10, roomCacheMaxAge: 300000, dmCacheMaxSize: 10, dmCacheMaxAge: 100000 } [Thu Sep 27 2018 12:41:29 GMT+0000 (UTC)] INFO [connect] Timeout (20000) [Thu Sep 27 2018 12:41:29 GMT+0000 (UTC)] ERROR Unable to connect: {} [Thu Sep 27 2018 12:41:29 GMT+0000 (UTC)] ERROR undefined [Thu Sep 27 2018 12:41:29 GMT+0000 (UTC)] ERROR Unable to login: {} [Thu Sep 27 2018 12:41:29 GMT+0000 (UTC)] ERROR undefined [Thu Sep 27 2018 12:41:29 GMT+0000 (UTC)] ERROR Unable to subscribe {} (node:1667) UnhandledPromiseRejectionWarning: Error: Asteroid connection timeout at Timeout._onTimeout (/home/hubot/hubot-rocketchat-boilerplate/node_modules/@rocket.chat/sdk/dist/lib/driver.js:94:25) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)

(node:1667) 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) (node:1667) [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.

p-hash commented 5 years ago

Hello @jitendra-kr I'm glad you resolved the issue, but could you be so kind and share the solution?

p-hash commented 5 years ago

Solved If you can connect to rocketchat in browser and hubot can not - check websocket protocol.

alfijuan commented 5 years ago

Hello, I'm having the same issue here. Any thoughts on how to solve this?

RADHAKRISHNAMOHAN commented 5 years ago

Hi,

I am getting the same error (see below). @p-hash I couldn't be able to solve even though i disconnected from rockchat in browser.

audited 349 packages in 1.794s found 1 low severity vulnerability run npm audit fix to fix them, or npm audit for details body-parser deprecated undefined extended: provide extended option ..\node_modules\hubot\src\robot.js:445:21 [Mon Feb 04 2019 15:58:53 GMT+0530 (India Standard Time)] INFO [startup] Rocket.Chat adapter in use [Mon Feb 04 2019 15:58:53 GMT+0530 (India Standard Time)] INFO [startup] Respond to name: Hubot [Mon Feb 04 2019 15:58:53 GMT+0530 (India Standard Time)] INFO [startup] Respond to alias: chat.bot [Mon Feb 04 2019 15:58:53 GMT+0530 (India Standard Time)] INFO [connect] Connecting { username: '----------', password: '-------', ldap: false, host: '---------', useSsl: true, timeout: 20000, rooms: [ 'general' ], allPublic: false, dm: false, livechat: false, edited: false, integrationId: 'js.SDK', roomCacheMaxSize: 10, roomCacheMaxAge: 300000, dmCacheMaxSize: 10, dmCacheMaxAge: 100000 } [Mon Feb 04 2019 15:59:13 GMT+0530 (India Standard Time)] INFO [connect] Timeout (20000) [Mon Feb 04 2019 15:59:13 GMT+0530 (India Standard Time)] ERROR Unable to connect: {} [Mon Feb 04 2019 15:59:13 GMT+0530 (India Standard Time)] ERROR undefined [Mon Feb 04 2019 15:59:13 GMT+0530 (India Standard Time)] ERROR Unable to login: {} [Mon Feb 04 2019 15:59:13 GMT+0530 (India Standard Time)] ERROR undefined [Mon Feb 04 2019 15:59:13 GMT+0530 (India Standard Time)] ERROR Unable to subscribe {} (node:3224) UnhandledPromiseRejectionWarning: Error: Asteroid connection timeout at Timeout._onTimeout (C:\Users\user\hubot-rocketchat-boilerplate\node_modules\@rocket.chat\sdk\dist\lib\d river.js:94:25) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)

(node:3224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing insi de of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:3224) [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.

PLEASE PROVIDE THE SOLUTION ASAP.

p-hash commented 5 years ago
  1. Check if it is possible to connect with provided login and password.
  2. If you can log in with bot's credentials, check if the chat's host is accessible from bot's host.
  3. If above didnt help, make sure websocket protocol is not blocked by any kind of proxy.
RADHAKRISHNAMOHAN commented 5 years ago

@p-hash thanks for the reply.

I have installed bot in my local host(running hubot.cmd from here using bat file (instead of .env) as mine is windows os) and i would be able to connect to that through browser and postman and getting responses but not from CLI when running hubot.cmd command

How to check this -->[ make sure websocket protocol is not blocked by any kind of proxy.]

ranjith-murugasamy commented 5 years ago

I am facing similar issue. Please share the resolution

rdgx commented 4 years ago

same issue here in .env :: export ROCKETCHAT_USESSL=true in log :: useSsl: False ... so :: export ROCKETCHAT_URL="https://mydomain.com" ( rather than :: export ROCKETCHAT_URL=mydomain.com ) and ... voilà

Hellmy commented 4 years ago

Not sure if this is really the best solution but for me it was good enough to allow also self signed certificates with another environment variable NODE_TLS_REJECT_UNAUTHORIZED=0 after setting that variable the connection worked just fine

ci2014 commented 4 years ago

@rdgx Solution works.

TrushnaPawar13 commented 2 years ago

@rdgx I don't have SSL enabled, so in .env it is set to false and in in log it is coming the same, so what could be the reason?

HuXinjing commented 1 year ago

@rdgx I don't have SSL enabled, so in .env it is set to false and in in log it is coming the same, so what could be the reason?

Did u solve that?