-
Notifications
You must be signed in to change notification settings - Fork 101
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
going offline after some time #63
Comments
It sounds like your server is sending the offline message. What jabber server are you using? |
i dont know exactly which server version this is i think its a modded version for this game: |
thats some parts of my pidgin connection log:
here connecting a user to the channel:
And this is the bot:
here a ping via pidgin:
and 1 warning via pidgin:
and here the leave log from basebot:
the weird thing wen i set ssl to 1 and port to 5223 it wont let me connect with the bot. |
what variables i have for the disable tls option 0,1,2 etc? |
This sounds similar to my issue, where Hubot won't automatically reconnect once it receives the offline event from the server. |
markstory can you write a workaround like: |
@markstory is the disconnect thing now fixxed in 1.10? so i can use it? |
I was never able to reproduce the issues on the ejabberd servers I have access to. |
@markstory if you restart your ejabberd server while hubot is still connected, does it reconnect as expected? |
I have not tried that. Based on reading the code the bot will not reconnect, as the offline event handler does not attempt to reconnect. |
I thought #37 was supposed to add that functionality. |
True, I totally forgot about that, if a reconnect is not happening it might poi t to a problem in node-xmpp, as the main change in #37 was to set the reconnect option. I can see how hubot handles ejabberd restarting. |
If it does work, can you let me know which version of node-xmpp you're running? |
I'm having this issue too. But I don't see the server (slack) sending an offline event. Instead, what I see in the log is that hubot sends a ping every 30 seconds and receives a bad-request "Missing 'id'" error:
At the moment hubot disconnects, nothing else shows in the logs, but the ping with its error still continues every 30 seconds. |
Still stuck on the above issue. Can anyone confirm this "Missing id" error is causing hubot to disconnect? My workaround is a cron restart every 30 minutes. Any advice? Thanks. |
@pixelrebel are you using this with slack? There's a slack adapter for hubot, which should be a better choice: https://github.com/slackhq/hubot-slack If you have to use this, your problem seems to be beacuse hubot-xmpp currently does not include 'id' field in the ping messages: https://github.com/markstory/hubot-xmpp/blob/master/src/xmpp.coffee#L112 |
@anupdhml: I am using the hubot-xmpp adapter with slack because my bot needs to upload files and send attachments which (correct me if I'm wrong) isn't currently supported by hubot-slack. Perhaps I can fork this project and add a line for the id. Do you know what id this error is referring to? Can this just be a random number? |
Well, adding the id to iq ping stanza didn't solve my disconnection problem, but it does make the "bad-request" error go away. I submitted a PR for this fix: |
@pixelrebel I found this for slack: slackapi/node-slack-sdk#56, but merging it could be tricky. hubot-xmpp does not currently support sending attachments though: you would have to write in the functionality. So maybe give hubot-slack with that PR a try? From the xmpp specification:
But looks like slack has different expectations. Adding id to ping stanzas probably won't have any side effects, so your PR should be all right. I used ids in #90 (comment) and haven't noticed anything off. |
@anupdhml That's interesting about the xmpp spec. I actually found this example which includes the Now I'm thinking it's best abide by the spec. I can just keep my own fork if I continue to use this adapter with slack. In fact, #93 does not fix my connection problem, so it just a petty fix to avoid an error from slack. |
@pixelrebel yes #93 does not solve your connection issues. Have you tried debugging from here: https://github.com/markstory/hubot-xmpp/blob/master/src/xmpp.coffee#L194 Add something like |
Thanks for the tip @anupdhml . I gave that a try, but I didn't see anything that stood out. I have a support ticket open asking them to check their server logs around the last time I was booted. I'll let you know if they come back with anything interesting. I'm thinking about going back to the hubot-slack adapter. This recent commit slackapi/hubot-slack@d8d6660 is sort of a revelation to me. It seems slack now allows real users to use the adapter. Which is all I really need at this point. Attachments are also supported, and I'm using curl to upload files anyway. |
@anupdhml Here's what slack support came back with:
This makes sense to me because it doesn't seem to disconnect when the bot is actively posting. So, is there a way to keep the bot from going idle? |
@pixelrebel If that's the case, you should be able to keep hubot online by broadcasting presence messages at fixed intervals. http://xmpp.org/rfcs/rfc3921.html#rfc.section.5.1.2 If slack's XMPP implementation follows the spec here, it should work. You can model the code on the initial presence stanza that hubot currently sends. There should be a better way of doing it though: the underlying node-xmpp client should have detected the disconnect from slack, and hubot-xmpp should be able to catch that and reconnect. There's already some code for reconnecting, but looks like slack behaves differently. See if the disconnect event used here helps. Let me know if you need help as you go about this, good luck! |
Hi,
the bot just going offline after some time of idle and i dont know how to fix that:
sometimes it takes 30min sometime over 2 hours then he´s going offline
The text was updated successfully, but these errors were encountered: