# Jabberd v2+ XML parse error (not well-formed (invalid token))



## rtwingfield (Sep 1, 2011)

Following an upgrade from Jabberd v2.2.11 to v2.2.14, the client to server component is complaining and indicating an invalid token when attempting to connect with Pidgin; otherwise, all Jabberd components (router, sm, s2s and c2s) load and seem happy.  Pidgin as configured worked well prior to the Jabberd upgrade.

from the c2s.log

```
c2s.log
--------------------
Wed Aug 31 13:36:00 2011 [notice] [8] [192.168.1.1, port=1397] connect
Wed Aug 31 13:36:01 2011 [notice] [8] [192.168.1.1, port=1397] 
error: XML parse error (not well-formed (invalid token))
```

Should I be looking for a problem with a string sent by Pidgin, or a problem with the c2s.xml file?


----------



## rtwingfield (Sep 30, 2011)

I have invested several days pursuing a recursive portmaster upgrade of Jabberd v2.2.14 and Pidgin v2.10.0 . . .all running on FreeBSD v7.2.   (Geez . . .what an ordeal.)

The Pidgin client running on FreeBSD will connect and the Jabberd session manager will start a session
	
	



```
Fri Sep 30 12:53:46 2011 [notice] session started: jid=rtwingfield@archaxis.net/1d62...(etc.)...89b
```
I have also installed the MS/Windows binary version of Pidgin v2.10.0 on Windows boxes.  I cannot establish a session from the Windows client.  The Jabberd c2s.log displays
	
	



```
Fri Sep 30 14:14:49 2011 [notice] [10] [192.168.1.1, port=2586] connect
Fri Sep 30 14:14:49 2011 [notice] [10] [192.168.1.1, port=2586] error: XML parse error (not well-formed (invalid token))
Fri Sep 30 14:14:49 2011 [notice] [10] [192.168.1.1, port=2586] disconnect jid=unbound, packets: 0
```
. . .and the Pidgin Debug Log (on the Windows Client) reports

```
(14:14:49) jabber: Recv (51): <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
(14:14:49) sasl: DIGEST-MD5 client step 2
(14:14:49) sasl: no server challenge
(14:14:49) connection: Connection error on 032DBD08 (reason: 3 description: Invalid response from server)
(14:14:49) account: Disconnecting account rtwingfield@archaxis.net/ (003FECF0)
(14:14:49) connection: Disconnecting connection 032DBD08
(14:14:49) jabber: Sending (rtwingfield@archaxis.net): </stream:stream>
(14:14:49) connection: Destroying connection 032DBD08
```

It's a puzzle that the FreeBSD Pidgin client works as advertised, but the _Windoze_ Pidgin client fails.   Any suggestions?


----------



## rtwingfield (Oct 1, 2011)

*Jabberd and GSASL Problem in Digest-MD5 Module*

I have googled-up a lot of complaints regarding Jabberd v2.2.14 and GSASL v1.6.1.  Apparently, there is a bug in the GSASL DIGEST-MD5 module that fails when interfacing with either PSi or Pidgin.  From the Jabberd2 List Archives, see this discussion between Julius Schwartzenberg and Eric Schnoebelen.

Krayon also reports problems with later versions of gsasl and jabberd2 2.2.14 and following the application of the reverting patch (see below), that "everything works once again".

This commit from the GNU gSASL Organization suggests that "*The server code [will now return] GSASL_OK after the final token*" after applying this Patch (see the commitdiff page).

A tarball of the entire GSASL ap. is downloadable if you click on snapshot from the commit page.

The problem I'm trying to solve now is finding the *server.c* source in the FreeBSD port . . .it's gone.  I assume it was part of the work files associated with the make.  I'm going to try a make build on the gsasl port and see what I can find, apply the patch, and remake the ap.

Film at eleven!


----------



## rtwingfield (Oct 1, 2011)

*Solution*

I have reinstalled gsasl-1.6.1 after substituting the patched */usr/ports/security/gsasl/work/gsasl-1.6.1/lib/digest-md5/server.c* source file and IT WORKS!  I have attached the patched file for your convenience.

To install the patch:


```
1) [FILE]# cd /usr/ports/security/gsasl[/FILE]
2) [FILE]# make configure[/FILE]
3) [FILE]# cd /usr/ports/security/gsasl/work/gsasl-1.6.1/lib/digest-md5/server.c[/FILE]
4) [FILE]# cp server.c server.c.portdist[/FILE] ([I]just for insurance, etc.[/I])
5) [I]gunzip the attached patched file into[/I] [FILE]/usr/ports/security/gsasl/work/gsasl-1.6.1/lib/digest-md5/server.c[/FILE]
6) [FILE]# make build[/FILE]
7) [FILE]# make deinstall[/FILE]
8) [FILE]# make reinstall[/FILE]
```

You might hold off on make clean for a while (to preserve the work files), and don't forget to restart the Jabberd server!

*Pidgin v2.10.0* and *PSi v0.14* Windows clients now work.


----------

