martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

Cannot for the life of me figure this out #478

Closed davericher closed 7 years ago

davericher commented 7 years ago

18 Aug 02:56:47 - Unhandled message: { command: 'ERROR', rawCommand: 'ERROR', commandType: 'normal', args: [ 'Closing Link: 127.0.0.1 (Connection timed out)' ] }

Network: Freenode.

This gets shot on the console, the link is not actually closed. I disabled the reconnect logic so it did not fire but i cannot figure out why this is happening, anyone in here experienced with node-irc and freenode?

senektra commented 7 years ago

Did you add a listener for the 'error' event? As mentioned near the end of the README (you might have missed it) it is said that if you don't add an 'error' listener, it will cause a stack trace.

davericher commented 7 years ago

I have always been listening to errors, it seems the client is getting a unexpected disconnect/end event Disabling the logic that deals with this from lib.js stops it from dying or forking itself but I cannot seem to get what this event is being fired from

senektra commented 7 years ago

This is very odd. I just fired up my old bot to try to connect to freenode and got the same problem as you. Got the same issue on a different IRC server as well. Everything was working fine with an old fork I had, so I'm assuming some update along the way broke it? I'll keep doing some detective work.

EDIT: I've come to realize this is only a problem on my windows machine, as my bot connects fine to servers on my Ubuntu server. My old fork doesn't work now either on my windows machine, I'm clueless.

davericher commented 7 years ago

It seems like I am somehow connecting twice, the second connection is failing and an end event is being triggered on both. I ran a barebones instance of this lib and this seems like default behaviour on freenode.

Ne02ptzero commented 7 years ago

Same problem here. The bot get the following:

- Unhandled message: { command: 'ERROR',
  rawCommand: 'ERROR',
  commandType: 'normal',
  args: [ 'Closing Link: xxx.xxx (Registration timed out)' ] }

And then, the connection get closed:

- Connection got "end" event
- Connection got "close" event

This happen on a private IRC Server, running hybrid-ircd.

It is worth mentionning that the bot fail to ping the server (?!) just before this event:

CyclingPingTimer 1: server silent for too long, let's send a PING
CyclingPingTimer 2: server silent for too long, let's send a PING
28 Dec 17:39:08 - SEND: PING 1
CyclingPingTimer 1: ping timeout!
CyclingPingTimer 2: server silent for too long, let's send a PING
28 Dec 17:39:23 - SEND: PING 2
28 Dec 17:39:24 - Unhandled message:  ....
davericher commented 7 years ago

Sorry I did not close this sooner. The issue was during a refactor the do not auto connect flag was removed. Thus the bot was trying to connect twice.