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

Failing to connect with matrix-org/node-irc >= 1.0.0 #181

Open
raucao opened this issue Sep 13, 2021 · 7 comments · May be fixed by #182
Open

Failing to connect with matrix-org/node-irc >= 1.0.0 #181

raucao opened this issue Sep 13, 2021 · 7 comments · May be fixed by #182

Comments

@raucao
Copy link

raucao commented Sep 13, 2021

Not too long after the last release of hubot-irc, which unpinned node-irc from a specific version, Matrix have released a 1.0.0 version and later a few other minor versions of their node-irc fork.

I just tried to upgrade our hubot to the latest hubot-irc release, and then encountered the following exception during the connect. I hunted it down, and was able to reproduce it working with the last node-irc version tag just before their 1.0.0 release. As soon as I use 1.0.0 or higher, the exception appears and prevents the bot from connecting.

13 Sep 15:54:12 - Sending irc NICK/USER
13 Sep 15:54:12 - SEND: CAP LS 302
13 Sep 15:54:12 - SEND: NICK botka_dev
[Mon Sep 13 2021 15:54:12 GMT+0200 (Central European Summer Time)] ERROR TypeError: Cannot read property 'match' of undefined
    at Client._send (/home/basti/src/kosmos/hubot-irc/node_modules/irc/lib/irc.js:1173:35)
    at Client._connectionHandler (/home/basti/src/kosmos/hubot-irc/node_modules/irc/lib/irc.js:932:14)
    at TLSSocket.<anonymous> (/home/basti/src/kosmos/hubot-irc/node_modules/irc/lib/irc.js:1045:22)
    at Object.onceWrapper (events.js:482:28)
    at TLSSocket.emit (events.js:376:20)
    at TLSSocket.onConnectSecure (_tls_wrap.js:1537:10)
    at TLSSocket.emit (events.js:376:20)
    at TLSSocket._finishInit (_tls_wrap.js:932:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12)
13 Sep 15:54:13 - SEND: CAP END

My guess is that they changed the API slightly for the 1.0 release, but I haven't looked into that yet.

@raucao raucao linked a pull request Sep 13, 2021 that will close this issue
@sam-mark
Copy link

sam-mark commented Nov 24, 2021

No issue with Matrix-org/node-irc for Me yet

I updated irc.coffee because it was setting many undefined var that was the cause of it

after updating irc.coffee theses values same as matrix-org/node-irc worked

      userName: process.env.HUBOT_IRC_USERNAME or 'nodebot'	  
      realName: process.env.HUBOT_IRC_REALNAME or 'nodeJS IRC client'
      port:     process.env.HUBOT_IRC_PORT or 6667

@raucao
Copy link
Author

raucao commented Nov 24, 2021

@sam-mark Great, thanks! Care to open a pull request for your fix then, so it works for all hubot-irc users again?

@sam-mark
Copy link

done already #183 😄

@raucao
Copy link
Author

raucao commented Nov 25, 2021

Cool.

However, I don't see anything changed about the config. The sort order of the respective lines has been changed, and default values have been added. But how does it solve the issue when you already set the correct environment variables?

@sam-mark
Copy link

sam-mark commented Nov 26, 2021

it fixed two issue.

  1. Default Port, UserName, RealName are Required but they were undefined hence causing errors
  2. When Nick Pass and SASL set it doesn't join any channels. for Auth HUBOT_IRC_PASSWORD required

they can be set as

      userName: process.env.HUBOT_IRC_USERNAME?
      realName: process.env.HUBOT_IRC_REALNAME?
      port:     process.env.HUBOT_IRC_PORT?

source matrix-org/node-irc to get defaults

            userName: 'nodebot',
            realName: 'nodeJS IRC client',
            port: 6667,

so all those fields i set are optional but required because they didn't get default values

@raucao
Copy link
Author

raucao commented Jan 5, 2022

Thanks. I tried those changes, and normal connections work now. However, SASL connections still time out for me. (I verified that the same credentials work fine in a desktop client, with the same chat network and from the same IP.)

@sam-mark
Copy link

sam-mark commented Jan 7, 2022

Thanks. I tried those changes, and normal connections work now. However, SASL connections still time out for me. (I verified that the same credentials work fine in a desktop client, with the same chat network and from the same IP.)

Working fine for me. I tested same account on both hubot-irc and desktop client . Maybe port number issue for you.

I tested it will irc.libera.chat and i got logged in from both hubot-irc and desktop client

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

Successfully merging a pull request may close this issue.

2 participants