discord-irc: IRC disconnects but never re-connects (freenode)
Node version: v6.11.4 Discord IRC Version: 2.4.2 (from npm)
Discord IRC seems to randomly disconnect from IRC, and fail to re-connect at any point. I have to keep going in and restarting it. It stays connected to Discord just fine, but not IRC.
17 Nov 21:23:39 - SEND: PRIVMSG #litecoin :<07redacted> some example message
17 Nov 21:23:39 - Network error: Error: This socket is closed
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 1
- Comments: 22
Had same issue (disconnects every 10+ minutes and reconnects only 10 times). Suggested settings seem to solve the problem, I used these in [code]ircOptions[/code] section: [code]“millisecondsOfSilenceBeforePingSent”: 20000, “millisecondsBeforePingTimeout”: 30000, “retryCount”: null,[/code]
@chaziz94 The comments above explain how you might work around this – you can set
"ircOptions": {"retryCount": null}
inside your configuration :^)If that doesn’t work, you could always come back with some logs of the issue (or if possible a repro), so I could look into solving it, rather than complaining about it remaining unsolved 😛
Okay, everything does seem to be working as intended. I don’t necessarily agree with the design of
retryCount
, but at any rate I can see now that that would be an upstream issue. Thank you very much @Throne3d for taking the time to address all of my concerns, I hope I was not too much of a bother 😞 . For now I’ve setretryCount
tonull
and I’ll see how that goes. 👍This complicates things, but is still explainable without it being a bug, I think.
It does seem to have retried approximately 10 times, actually, for each. The number after “CyclingPingTimer” in the logs is a number that counts up for each connection. As it’s at 21, it seems both instances of the bot have tried reconnecting about 10 times (these numbers start at 0 and 1, because there are two connections, and then if the bots both reconnect 10 times sequentially, these increase to 20 and 21). As far as I know, that only increases when it reconnects, so it seems the connection has reconnected ten times, per instance, over the entire course of the bot’s running. This might not be expected behavior, but I think it’s intended behavior. (I’m not sure, I didn’t write the upstream IRC library originally.)
The error in the logs is due to an
ENOTFOUND
error, which I believe only occurs if it can’t look up the DNS of the server when it tries to connect. This therefore doesn’t occur if freenode is down, or if your DNS can resolve when the bot tries to reconnect; it does occur if your network is down. I’m not completely sure, but I think it doesn’t suggest anything wrong with the behavior.I don’t think so. The bots reset their ping timer upon receiving messages from the server, so if they connect at different times, or take differing lengths to get ping responses or keep track of different messages in different channels, the timers could get out of sync and the network could go down when one is looking for a ping and return before the other does. That is, the following could happen:
Due to them being out of sync, and the ping cycle and ping timeout times being different, the network could have gone down just long enough to cause a timeout on one while the other bot doesn’t even notice a problem. Increasing these values should help stop this problem.
I experienced a similar issue with version 2.5.0 installed from npm (with Node version 8.9.2). I’ve set the recommended debug options and will report back if it happens to me again.
I’m on my phone and reactions don’t show up here. Sorry for the double notification