Adium

Ticket #10353 (closed defect: fixed)

Opened 5 months ago

Last modified 3 months ago

XML Parse error connecting to broken OpenFire Jabber server

Reported by: dhawes Assigned to: evands
Priority: normal Milestone: Adium 1.3
Component: Jabber/XMPP Version: 1.2.7b
Severity: normal Keywords:
Cc: Patch: None
Pending: 0

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

XMLParseError.txt (29.6 kB) - added by chrisbarker on 07/31/2008 12:48:02 PM.
chrisbarker xml Parse Log

Change History

07/04/2008 03:34:28 AM changed by am

  • owner changed from am to evands.

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?

07/04/2008 05:27:55 AM changed by am

  • milestone set to Waiting on libpurple.

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

07/04/2008 11:14:03 AM changed by dhawes

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

07/04/2008 01:14:05 PM changed by evands

  • status changed from new to closed.
  • resolution set to fixed.

(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.

07/04/2008 01:15:47 PM changed by evands

(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.

07/07/2008 01:31:12 PM changed 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)

07/07/2008 04:25:42 PM changed 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?

07/12/2008 09:41:08 AM changed by evands

  • status changed from closed to reopened.
  • resolution deleted.

07/15/2008 12:55:27 PM changed by evands

#10386 has good debug logging.

07/21/2008 06:15:54 PM changed by dmcgahan

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@chat.atlassian.com: Telling the core we disconnected 08:05:47: <ESPurpleJabberAccount:17a7f620 10>:dmcgahan@chat.atlassian.com: Disconnected ("Read Error"): Automatically reconnecting in 5.000000 seconds (0 attempts performed)

We're using OpenFire 3.5.2.

(follow-up: ↓ 14 ) 07/21/2008 07:37:41 PM changed by evands

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.

07/21/2008 08:16:18 PM changed by dmcgahan

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

07/21/2008 08:55:01 PM changed by evands

  • status changed from reopened to closed.
  • resolution set to fixed.

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

(in reply to: ↑ 11 ; follow-up: ↓ 15 ) 07/24/2008 04:35:14 PM changed 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?

(in reply to: ↑ 14 ; follow-up: ↓ 16 ) 07/24/2008 04:41:48 PM changed by evands

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.

(in reply to: ↑ 15 ) 07/24/2008 08:12:11 PM changed 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.

07/30/2008 01:37:51 PM changed by chrisbarker

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)

(follow-up: ↓ 20 ) 07/30/2008 11:26:09 PM changed by evands

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

07/31/2008 12:48:02 PM changed by chrisbarker

  • attachment XMLParseError.txt added.

chrisbarker xml Parse Log

07/31/2008 01:00:55 PM changed by chrisbarker

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@macserv10.ebauer.us/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 ).

(in reply to: ↑ 18 ) 08/04/2008 02:14:56 PM changed by chrisbarker

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?

08/29/2008 02:10:15 PM changed by Robby

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from Waiting on libpurple to Adium 1.3.1.

08/29/2008 02:11:11 PM changed by Robby

chrisbarker, this will be looked into soon now.

08/29/2008 09:46:18 PM changed by jas8522

  • summary changed from 1.2.7b1 does not fix issue in Ticket #10324 to XML Parse error connecting to Jabber server (Tiger only).

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

08/30/2008 03:57:18 PM changed by evands

  • status changed from reopened to closed.
  • summary changed from XML Parse error connecting to Jabber server (Tiger only) to XML Parse error connecting to broken OpenFire Jabber server.
  • resolution set to fixed.
  • milestone changed from Adium 1.3.1 to Adium X 1.3.

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.

09/15/2008 06:58:50 PM changed by chrisbarker

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).