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

Hubot instance does not reconnect on restart of Prosody server #87

Open
mrijke opened this issue Aug 5, 2015 · 2 comments
Open

Hubot instance does not reconnect on restart of Prosody server #87

mrijke opened this issue Aug 5, 2015 · 2 comments

Comments

@mrijke
Copy link

mrijke commented Aug 5, 2015

When I restart my XMPP server (Prosody), my hubot instance does not reconnect automatically.
Instead, the hubot instance keeps trying to ping the server, but does not get a response.

[Wed Aug 05 2015 14:09:04 GMT+0200 (CEST)] DEBUG [sending ping] <iq type="get"><ping xmlns="urn:xmpp:ping"/></iq>
[Wed Aug 05 2015 14:09:34 GMT+0200 (CEST)] DEBUG [sending ping] <iq type="get"><ping xmlns="urn:xmpp:ping"/></iq>

I'm using the following package versions:

    "hubot": "^2.13.2",
    "hubot-xmpp": "^0.1.16"

And Prosody 0.10.

Any thoughts on what could be the issue? My normal clients reconnect fine.
If you need further information I'd be happy to debug this more.

@markstory
Copy link
Contributor

No idea, I've never used that xmpp server before. If you want to dig in more, this code handles attempting to reconnect.

@ReformedGeek
Copy link

@markstory

I have the same issue with an OpenFire server whenever the server is shut down or restarted. My debug logs show pings with no responses, but the bot never seems to timeout the connection and attempt a reconnect, even after the server comes back up.

[Mon Jul 10 2017 14:27:54 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:28:24 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:28:54 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:29:24 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:29:54 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:30:24 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:30:54 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:31:24 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:31:54 GMT-0400 (EDT)] DEBUG [sending ping]
[Mon Jul 10 2017 14:32:24 GMT-0400 (EDT)] DEBUG [sending ping]

Normally the response will be something like unto
[Thu Jul 13 2017 20:38:44 GMT-0400 (EDT)] DEBUG [sending ping]
[Thu Jul 13 2017 20:38:44 GMT-0400 (EDT)] DEBUG [received iq]

The relevant environment variables are:
HUBOT_XMPP_RECONNECT_TRY=2880
HUBOT_XMPP_RECONNECT_WAIT=30000

As seen from the above keepalive logs, I use the default of 30000 ms for the keepalive.

From the code you linked, it would seem that on line 84, you set

@client.connection.socket.setTimeout 0

Could this be the root cause? The lack of response to pings doesn't seem to trigger a reconnect attempt.

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

No branches or pull requests

3 participants