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

Handle malformed XMPP packet responses #209

Closed
strugee opened this issue Jul 1, 2017 · 6 comments
Closed

Handle malformed XMPP packet responses #209

strugee opened this issue Jul 1, 2017 · 6 comments

Comments

@strugee
Copy link

strugee commented Jul 1, 2017

On my production Matterbridge install, I noticed that the XMPP user had disconnected. Looking at my systemd logs showed the following:

Jun 28 15:54:55 strugee-net-failover matterbridge-0.15.0[18735]: <message type='groupchat' to='irc-social@im.koderoot.net/56f3bc79-fe64-4835-8404-096e99ce113a' from='w3social@muc.im.koderoot.net/irc-social' xml:lang='en'><body>&lt;cwebber2&gt; q?</body></message>
Jun 28 15:54:55 strugee-net-failover matterbridge-0.15.0[18735]: <message type='groupchat' to='irc-social@im.koderoot.net/56f3bc79-fe64-4835-8404-096e99ce113a' from='w3social@muc.im.koderoot.net/irc-social' xml:lang='en'><body>&lt;Zakim&gt; Zakim sees no one on the speaker queue</body></message>
Jun 28 15:54:56 strugee-net-failover matterbridge-0.15.0[18735]: <message type='groupchat' to='irc-social@im.koderoot.net/56f3bc79-fe64-4835-8404-096e99ce113a' from='w3social@muc.im.koderoot.net/irc-social' xml:lang='en'><body>&lt;puckipedia&gt; it&apos;d show the summary</body></message>
Jun 28 15:55:20 strugee-net-failover matterbridge-0.15.0[18735]: <message type='groupchat' to='irc-social@im.koderoot.net/56f3bc79-fe64-4835-8404-096e99ce113a' from='w3social@muc.im.koderoot.net/irc-social' xml:lang='en'><body>&lt;puckipedia&gt; scribenick: puckipedia</body></message>
Jun 28 15:55:23 strugee-net-failover matterbridge-0.15.0[18735]: <stream:error><not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>

Here's my config file:

[irc]
    [irc.w3c]
    Server="irc.w3.org:6667"
    Nick="xmpp-social"
    RemoteNickFormat="[{NICK}] "

[xmpp]
    [xmpp.koderoot]
    Server="im.koderoot.net:5222"
    Jid="irc-social@im.koderoot.net"
    Password="<password redacted>"
    Muc="muc.im.koderoot.net"
    Nick="irc-social"
    RemoteNickFormat="<{NICK}> "

[[gateway]]
name="gateway1"
enable=true
    [[gateway.inout]]
    account="irc.w3c"
    channel="#social"

    [[gateway.inout]]
    account="xmpp.koderoot"
    channel="w3social"

If really necessary I can adjust my systemd unit to invoke Matterbridge with -debug, but I'd rather not as it will probably take a while for this to happen again and in the meantime my logs will fill up.

For reference, the last IRC message sent before the bridge disconnected was from user puckipedia, who said: scribenick: puckipedia. The message that seemed to cause the malformed packet is here: https://chat.indieweb.org/social/2017-06-28#t1498665324747000

It includes some funky Unicode, perhaps that was it? Happy to file a separate issue if you want to track the buggy XMPP packet generation code separately from the error-handling. Note that nothing was said on the XMPP side at the time.

I'm running version 0.15.0 822605c as reported by matterbridge -version.

@strugee
Copy link
Author

strugee commented Jul 1, 2017

Just confirmed that the Unicode was the problem - filed #210 to track the fact that Matterbridge is generating malformed stanzas. I think this one should probably be kept open though - if another bug like this happens in the future, it really shouldn't break everything. The program should just handle the error.

@42wim
Copy link
Owner

42wim commented Jul 7, 2017

The problem here is with the underlaying library. Maybe it's better to open a bug report there.
I fixed the charset/unicode issue though, so your problem should be fixed for now

@42wim 42wim closed this as completed in bfc7130 Jul 7, 2017
@strugee
Copy link
Author

strugee commented Jul 9, 2017

@42wim I can definitely file this upstream. What XMPP library does Matterbridge use?

@42wim
Copy link
Owner

42wim commented Jul 9, 2017

@strugee that would be https://github.com/mattn/go-xmpp
Thanks!

@strugee
Copy link
Author

strugee commented Mar 5, 2018

This completely dropped off my radar lol, but I just filed xmppo/go-xmpp#96 👍

Sorry for the (extreme) delay!

@42wim
Copy link
Owner

42wim commented Mar 5, 2018

Thanks!

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

No branches or pull requests

2 participants