Adium

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#10353 closed defect (fixed)

XML Parse error connecting to broken OpenFire Jabber server

Reported by: dhawes Owned by: evands
Milestone: Adium 1.3 Component: Service/XMPP (Jabber)
Version: Severity: normal
Keywords: Cc:
Patch Status:

Description

Adium 1.2.6 sent ASCII control characters in the <version> string of an XMPP message, which caused an XML parser error that caused XML processing to stop which eventually resulted in a ping timeout. (I'm fairly certain this is the explanation for the reconnects people were experiencing.)

1.2.7b1 fixed the version string that 1.2.6 was sending, which would alleviate the reconnects if everyone in your contact list upgraded from 1.2.6 (a downgrade would have worked as well). If anyone in your contact list was still running 1.2.6, however, the invalid version string would be sent, the XML parser would fail, and you would eventually get the ping timeout which would cause a reconnect. As such, the fix would only work if there were no 1.2.6 clients in your contact list that could respond to the jabber:iq:version request.

The real issue seems to be that the XML parser will not process XMPP messages after an invalid XML character is encountered. This is effectively similar to a ticket I posted to Pidgin:

http://developer.pidgin.im/ticket/6031

This could be the reason for:

http://trac.adiumx.com/ticket/10347

Perhaps the user had an Adium 1.2.6 client in their contact list, which caused the ping timeouts. This is speculation, but this issue could cause what the user was seeing.

It also can explain what other users were experiencing under that ticket (10347). In this case, not receiving XMPP messages and the disconnection issues are related.

I have posted this in some of the comments of the bug reports I have referenced, but I felt like it deserved a new ticket as the original issue (http://trac.adiumx.com/ticket/10324) still exists: connections will cycle if invalid XML characters are sent, presumably because XML parsing ceases.

Attachments (1)

XMLParseError.txt (29.6 KB) - added by Chris Barker 12 years ago.
chrisbarker xml Parse Log

Download all attachments as: .zip

Change History (26)

comment:1 Changed 12 years ago by Andreas Monitzer

Owner: changed from Andreas Monitzer to Evan Schoenberg

When the server sends us invalid XML, the connection should be dropped (and the server devs should be notified about their bug). What server are you using?

comment:2 Changed 12 years ago by Andreas Monitzer

Milestone: Waiting on libpurple

Uh, if the server actually sends &#1;, Adium should handle that gracefully.

comment:3 Changed 12 years ago by dhawes

The server is Openfire, and yes, the server sends character references.

comment:4 Changed 12 years ago by Evan Schoenberg

Resolution: fixed
Status: newclosed

(In [24247]) libpurple.framework im.pidgin.pidgin 2.5.0mtn @ 2b2d7fb52, which should fix problems with XMPP XML parser error handling. Investigation and fix a combined effort of dhawes, catfish_man42, and myself.

Fixes #10347. Fixes #10353. Refs #10324.

May fix other issues, as well, or at least make them more debuggable, as there was no error handling previously.

comment:5 Changed 12 years ago by Evan Schoenberg

(In [24249]) libpurple.framework im.pidgin.pidgin.2.4.3, with all patches on adium-1.2 as of [24245], which should fix problems with XMPP XML parser error handling. Investigation and fix a combined effort of dhawes, catfish_man42, and myself.

Fixes #10347. Fixes #10353. Refs #10324.

May fix other issues, as well, or at least make them more debuggable, as there was no error handling previously.

comment:6 Changed 12 years ago by dhawes

This does not fix the Adium version string problem for me. The client will still disconnect when control characters are sent.

I do not have a version of 1.2.7 with the debug window (will 1.2.7 be in svn any time soon?), but I would assume that this is because of the XML_ERR_DOCUMENT_END error like in the pidgin ticket referenced here.

These could be related:

http://trac.adiumx.com/ticket/10400 http://trac.adiumx.com/ticket/10386 http://trac.adiumx.com/ticket/10382 (maybe)

comment:7 Changed 12 years ago by dhawes

Adium compiled from svn://svn.adiumx.com/adium/branches/adium-1.2 fails in the same way as the Pidgin client (XML_ERR_DOCUMENT_END).

Should I open a new ticket for this?

comment:8 Changed 12 years ago by Evan Schoenberg

Resolution: fixed
Status: closedreopened

comment:9 Changed 12 years ago by Evan Schoenberg

#10386 has good debug logging.

comment:10 Changed 12 years ago by Donna McGahan

This problem seems to continue in 1.3b9.

08:05:47: (Libpurple: jabber) XML parser error for JabberStream 0x0: Domain 1, code 5, level 3: Extra content at the end of the document

08:05:47: Disconnected: gc=1943e8b0 08:05:47: <ESPurpleJabberAccount:17a7f620 10>:dmcgahan@…: Telling the core we disconnected 08:05:47: <ESPurpleJabberAccount:17a7f620 10>:dmcgahan@…: Disconnected ("Read Error"): Automatically reconnecting in 5.000000 seconds (0 attempts performed)

We're using OpenFire 3.5.2.

comment:11 Changed 12 years ago by Evan Schoenberg

dmcgahan, your debug logging doesn't show the received XML which is invalid.

In any case, Adium 1.3b9 and Adium 1.2.7 are behaving correctly, if you're experiencing the same bug. When invalid XML is received, the receiving client should immediately disconnect with an XML parsing error.

OpenFire 3.5.2 was supposed to fix this issue (JM-1388), so it would be very helpful if you would attach a complete debug log of this occurring which includes the offending XML.

comment:12 Changed 12 years ago by Donna McGahan

Apologies for not providing the XML. Actually checked with our sysadmin today and it seems this was a result of blocking Adium in OpenFire, not Adium itself. Adium is working like a champ. Sorry for the false alarm.

Cheers, Donna

comment:13 Changed 12 years ago by Evan Schoenberg

Resolution: fixed
Status: reopenedclosed

Ah! Glad to hear the OpenFire fix was good :)

comment:14 in reply to:  11 ; Changed 12 years ago by dhawes

Replying to evands:

In any case, Adium 1.3b9 and Adium 1.2.7 are behaving correctly, if you're experiencing the same bug. When invalid XML is received, the receiving client should immediately disconnect with an XML parsing error.

I just wanted to note that this is not the behavior Adium (or Pidgin) exhibits. The disconnects are not immediate, but rather occur after 2 more messages are recieved from the server, at which time XML_ERR_DOCUMENT_END occurs and *then* the client disconnects.

OpenFire 3.5.2 was supposed to fix this issue (JM-1388)

What exactly is it supposed to fix? There isn't much information in that issue.

OpenFire 3.5.2 is what I have been testing with...how does it come in to play with this ticket?

comment:15 in reply to:  14 ; Changed 12 years ago by Evan Schoenberg

Replying to dhawes:

Replying to evands:

In any case, Adium 1.3b9 and Adium 1.2.7 are behaving correctly, if you're experiencing the same bug. When invalid XML is received, the receiving client should immediately disconnect with an XML parsing error.

I just wanted to note that this is not the behavior Adium (or Pidgin) exhibits. The disconnects are not immediate, but rather occur after 2 more messages are recieved from the server, at which time XML_ERR_DOCUMENT_END occurs and *then* the client disconnects.

*nod* My initial attempt at fix for this issue, which is present in the current versions of Adium and Pidgin, was misguided. I thought we could recover from the invalid character error, so wrote code to handle that condition... but that just delays our disconnection until the XML_ERR_DOCUMENT_END which comes with the next parse attempt. I have since learned that the correct behavior is to disconnect immediately, and I'll be reverting my change which delayed this disconnection.

OpenFire 3.5.2 was supposed to fix this issue (JM-1388)

What exactly is it supposed to fix? There isn't much information in that issue.

OpenFire 3.5.2 is what I have been testing with...how does it come in to play with this ticket?

Sorry for the confusion I caused with that comment. A similar but different issue was fixed in JM-1388, apparently, involving malformed entities, or something like that. The fix to OpenFire to prevent clients from sending invalid characters such as the ASCII control characters from Adium 1.2.6 has been committed to OpenFire's code base but is not in a released version yet. The fix was made by David Smith after Adium 1.2.6's release, so of course it's not present in OpenFire 3.5.2 which was released a month prior. It will be in OpenFire 3.6.

comment:16 in reply to:  15 Changed 12 years ago by dhawes

Replying to evands:

Sorry for the confusion I caused with that comment. A similar but different issue was fixed in JM-1388, apparently, involving malformed entities, or something like that. The fix to OpenFire to prevent clients from sending invalid characters such as the ASCII control characters from Adium 1.2.6 has been committed to OpenFire's code base but is not in a released version yet. The fix was made by David Smith after Adium 1.2.6's release, so of course it's not present in OpenFire 3.5.2 which was released a month prior. It will be in OpenFire 3.6.

Cool, thanks for the explanation and your help with this issue.

comment:17 Changed 12 years ago by Chris Barker

I am seeing the same error under 10.4 with Adium 1.3b9 authenticating to an iChat Server under 10.5.4 server, using keberos.

Same application, same user, same code, under 10.5.4 logs in without a problem. I can post relevant logs , here is the snippet from the 10.4 client:

18:20:07: (Libpurple: jabber) XML parser error for JabberStream 0x0: Domain 1, code 5, level 3: Extra content at the end of the document 18:20:07: (Libpurple: jabber) xmlParseChunk returned error 5 18:20:07: Connection Disconnected: gc=f4ad590 (XML Parse error)

comment:18 Changed 12 years ago by Evan Schoenberg

Please back the start of taht snippet up a bit; what is the XML received which is giving the XML Parse error?

Changed 12 years ago by Chris Barker

Attachment: XMLParseError.txt added

chrisbarker xml Parse Log

comment:19 Changed 12 years ago by Chris Barker

I have uploaded the two debug logs (once file, comments label sections), showing the failed 10.4.11 login and the successful 10.5.4 login.

The problem appears to be something in between step 3 and 4 of bind, as the initial bind succeeds, but under 10.4.11 following (line 55): 09:43:37: (Libpurple: jabber) RecvSASL (165): <iq xmlns='jabber:client' id='purple50d063f3' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>cbarker@…/mac-041</jid></bind></iq>

it throws: "XML parser error for JabberStream 0x0: Domain 1, code 5, level 3: Extra content at the end of the document" as an error and the connection fails (while both logs as you see have the same error following Connecting: gc=0xf4e2270 (Re-initializing Stream) 4 / 5 ).

comment:20 in reply to:  18 Changed 11 years ago by Chris Barker

Replying to evands:

Please back the start of taht snippet up a bit; what is the XML received which is giving the XML Parse error?

sample logs have been, should I investigate opening a new ticket if this is unrelated, or what?

comment:21 Changed 11 years ago by Robert

Milestone: Waiting on libpurpleAdium 1.3.1
Resolution: fixed
Status: closedreopened

comment:22 Changed 11 years ago by Robert

chrisbarker, this will be looked into soon now.

comment:23 Changed 11 years ago by Jordan

Summary: 1.2.7b1 does not fix issue in Ticket #10324XML Parse error connecting to Jabber server (Tiger only)

I think that's a slightly better description - please correct me if it's inaccurate.

comment:24 Changed 11 years ago by Evan Schoenberg

Milestone: Adium 1.3.1Adium X 1.3
Resolution: fixed
Status: reopenedclosed
Summary: XML Parse error connecting to Jabber server (Tiger only)XML Parse error connecting to broken OpenFire Jabber server

I don't believe this is connected to Tiger. It only occurs if the Jabber server is broken. It should be fixed in Adium 1.3. Please reopen if this can be reproduced in 1.3.

comment:25 Changed 11 years ago by Chris Barker

http://www.apple.com/support/downloads/macosxservercombo1055.html

Again, this was related specifically to Adium (even 1.3.1) connecting to 10.5 Server's Jabber Server, but only when Adium was running on a 10.4 client, not a 10.5 client. The above link appears to mention a specific fix in this case, we will be upgrading our 10.5 Server to 10.5.5 tomorrow evening, and I will report back if the issue was Apple related and has been fixed (oh how I wish I could search their bugs like I can here).

Note: See TracTickets for help on using tickets.