-
Notifications
You must be signed in to change notification settings - Fork 103
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
Hubot does not reconnect on disconnect #58
Comments
using hubot 2.7.1 and hubot-xmpp 0.1.9. |
Is there an update on this? Am I doing something wrong (i.e., is there another config var I missed to enable restarts on disconnects)? |
I'm not sure, the bots I run reconnect properly. |
Hrm. Are there any known issues with the versions of either hubot-xmpp or hubot that I listed? |
Update: just tested reverting hubot-xmpp back to 0.1.8; that version reconnects after the offline event is received. |
Thanks for looking into that I can take a look at what has changed between those versions. |
I'm still not sure why hubot is disconnecting so fast. I thought it might be related to timeouts. But I don't think it is. I configured my ejabberd setup to use pings via mod_ping, and hubot-xmpp was able to keep the connection active via pings.
|
Our Hubot also keeps the connection alive via pings; however, every so often, Slack resets their gateway and all clients are expected to reconnect. This is where Hubot gets the offline message and never reconnects. |
Interesting, the offline event handling hasn't changed since v0.1.8, I wonder how it worked previously. |
i going to try 0.1.8 now too |
ok i let him running now over 20hours and he dont die and stay alive!!! awesome with 0.1.8 |
Well one change in 0.1.9 was that empty packets are not sent, and instead the library uses the connection setKeepAlive options. Since those seem to be problematic I'll revert those changes. |
I can confirm that my bot receives an offline event just a few minutes after connecting with 0.1.10, but the issue does not occur in 1.1.8. As far as I know, we're using the Openfire server. |
Are you using SSL or TLS? I was wrong about the empty packet changes in 0.1.9, those were in 0.1.10. The main changes in 0.1.9 were adding the |
Unfortunately I don't know much about jabber, but in my chat client, I'm connecting to port 5223 with SSL. If I specify the same port for hubot-xmpp it just hangs so I'm using port 5222 which works fine in 0.1.8. I haven't changed any TLS settings. |
So, update: on 0.1.8, the server does attempt to reconnect. However, it seems to completely forget its authentication information: Reconnect in 0 It looks like it loses all of its info, which is strange. Any thoughts? |
Not really, I'm only really familiar with ejabberd which doesn't trigger these same issues. |
just small update |
@markstory can you confirm what version of node-xmpp you're running? |
I was using 0.1.10 of hubot-xmpp which uses node-xmpp 0.10.0. I did do some additional testing with ejabberd. When restarting ejabberd with I'm going to handle this case in hubot-xmpp and attempt to manually reconnect the bot on the 'end' event. |
Cool, thanks. For now, I've made a fork of hubot-xmpp that terminates the node process on an offline event (we're running our bot via supervisord), so that fixes the issue from my end. Once your have the code written on your side, I'll switch it back to upstream to test it out. |
@bnied I have a pull request option for the changes I think will solve the issue. |
@markstory looks good. I like that it terminates if it can't connect, so that you get better visibility into a connection issue. Let me know when it's committed and I'll give it a spin. |
So, I finally got a chance to use this with our dev Hubot. Some weirdness:
|
Thanks for giving it a spin, I'll get those duplicated messages in the logs fixed up. |
I've added some code to remove the bound event listeners, that seems to solve the problem as I've not seen duplicated log messages. |
Hubot does not reconnect when it receives an offline event from the server:
[Tue Feb 18 2014 14:45:50 GMT-0500 (EST)] DEBUG Loading adapter xmpp
[Tue Feb 18 2014 14:45:50 GMT-0500 (EST)] INFO { username: 'hubot@not.a.real.site',
password: '********',
host: 'conference.not.a.real.site',
port: '5222',
rooms:
[ { jid: 'test@conference.not.a.real.site',
password: false } ],
keepaliveInterval: 30000,
legacySSL: undefined,
preferredSaslMechanism: undefined,
disallowTLS: undefined }
[Tue Feb 18 2014 14:45:50 GMT-0500 (EST)] DEBUG Received offline event
The text was updated successfully, but these errors were encountered: