Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

GTalk, xmpp error: If set, the presence stanza type must be one of 'unavailable', 'subscribe', 'unsubscribe', 'subscribed', 'unsubscribed' or 'error'. #6

Closed
lanwin opened this Issue · 5 comments

4 participants

Steve Wagner Mark Story Dan Palmer Susan Potter
Steve Wagner

I currently trying the xmpp since the GTalk one dose not support rooms and from its basic GTalk is xmpp. The bot comes online and joins the room, but short after this error, it disappears.

[Thu, 12 Jan 2012 12:45:53 GMT] INFO Hubot XMPP client online
[Thu, 12 Jan 2012 12:45:53 GMT] ERROR [xmpp error]chatIf set, the presence stanza type must be one of 'unavailable', 'subscribe', 'unsubscribe', 'subscribed', 'unsubscribed' or 'error'.

Mark Story
Owner

Any idea on what stanza triggers the bot to bail?

Steve Wagner

Sorry, the information above is the only in log. If you can tell me where I need to place the right console.log, I would want to test that.

Dan Palmer

Hey guys, I saw this didn't get anywhere, but I am having the same problem, here is the full response I get when trying to join a room with Hubot:

<presence type="error" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><show>chat</show><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">If set, the presence stanza type must be one of 'unavailable', 'subscribe', 'unsubscribe', 'subscribed', 'unsubscribed' or 'error'.</text></error></presence>

Just wondering if someone found a fix for it, and if so, if we could perhaps document it here for others who have the issue.

Susan Potter

So I came across this as well. I initially saw this error in the logs once when I set the ..._ROOMS config envvar to just one MUC chat room, but even after setting the ..._ROOMS envvar to two, I still only see this once. Which lead me to search more around the topic.

According to 5.2 Sending Initial Presence in the XMPP Instance Messaging working document of IETF, I found an interesting tidbit:

Upon authenticating, a client SHOULD send initial presence to its
   server indicating that the connected resource is available for
   communications.  This presence stanza SHOULD have no type.

So I put this change in a fork I created and pushlished a hubot-xmpp2 to npmjs to test. I no longer get the presence error and my bot remains online after many commands. I had to fix another issue with this adapter to get it to respond correctly though, see below.

I then fixed another couple of issues I found when using this XMPP Hubot adapter with GTalk for MUC support (the GTalk adapter doesn't have MUC support /sigh). I submitted a pull request, but realized it was badly formed. I will resubmit again and update this ticket with the number.

See pull request #13 for patch for the two above mentioned issues.

Mark Story
Owner

Since #13 has been merged, I'm going to close this issue as well. If its still a problem we can always re-open and work some more on it :D

Mark Story markstory closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.