Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating bot #158

Open
JerryBerry12 opened this issue Mar 24, 2023 · 6 comments
Open

Creating bot #158

JerryBerry12 opened this issue Mar 24, 2023 · 6 comments

Comments

@JerryBerry12
Copy link

Hi,
I tried creating a bot with the tutorial at: https://developer.rocket.chat/bots/creating-your-own-bot-from-scratch/develop-a-rocket.chat-sdk-bot.
The bot keeps trying to connect, and it produces this:

[connect] Connecting {
  username: 'bot',
  password: 'pass',
  ldap: false,
  host: 'localhost',
  useSsl: 'false',
  timeout: 20000,
  rooms: [],
  allPublic: false,
  dm: false,
  livechat: false,
  edited: false,
  integrationId: 'js.SDK',
  roomCacheMaxSize: 10,
  roomCacheMaxAge: 300000,
  dmCacheMaxSize: 10,
  dmCacheMaxAge: 100000
}
[connect] Timeout (20000)
/home/jerryberry12/hopebot/node_modules/@rocket.chat/sdk/dist/lib/driver.js:94
            const err = new Error('Asteroid connection timeout');
                        ^

Error: Asteroid connection timeout
    at Timeout._onTimeout (/home/jerryberry12/hopebot/node_modules/@rocket.chat/sdk/dist/lib/driver.js:94:25)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

Node.js v19.8.1

In my server.js file, all the settings, bot info and passwords are correct. It seems like some default settings are being applied because of this:

[connect] Connecting {
  username: 'bot',
  password: 'pass',

I set these fields correctly in server.js, not bot and pass. Can some one help me?

Server info

I'm using Raspbian 10 Lite, on a raspberry pi. I installed rocketchat.sdk as shown in the tutorial.

@felipecrp
Copy link

Hi, I have the same problem. The snippet provided in the rocket.chat site is not working and it is throwing the same timeout exception on the line:

await driver.connect({ host: HOST, useSsl: SSL })

I already double checked that the HOST and SSL var are corrected setted.

@felipecrp
Copy link

I managed to get it to work. 🙌

Despite my rocket chat is using https, when I used the SSL = true, I got the timeout. But, when i use SSL = false I managed to connect to the rocket.chat instance.

@JerryBerry12
Copy link
Author

hmm.
I was already using SSL = false.
you can see my config above. I'll try setting to true

@JerryBerry12
Copy link
Author

Nope both ways doesn't work
Lemme try botpress, since I just got support for that connecter by updating software to v6.

@MrPoint1400
Copy link

@JerryBerry12 if rocketchat sdk version is 0.2.9-2 must use node 16 else must use node >=18
fot fix a 'Asteroid connection timeout' use this

export NODE_TLS_REJECT_UNAUTHORIZED=0 - Mac
set NODE_TLS_REJECT_UNAUTHORIZED=0 - windows
export NODE_TLS_REJECT_UNAUTHORIZED=0 - linux

@Ananya2001-an
Copy link

Nope both ways doesn't work

You should try setting it to ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants