error of dialback with im.apinc.org, standard compliance problem ?

Michael Scherer misc at mandriva.org
Sat Sep 22 11:03:56 UTC 2007


> Hi,
>
> it seems the dialback code is quite buggy as i cannot connect to people on
> im.apinc.org
>
> Here is the trace ( edited to be more readable ):
>
> Me :
> <?xml version="1.0" encoding="UTF-8"?>
> <stream:stream to='im.apinc.org'
> xmlns:stream='http://etherx.jabber.org/streams'
> xmlns='jabber:server'
> xml:lang='en'
> xmlns:db='jabber:server:dialback'
> version='1.0'>
>
>
> Apinc :
> <?xml version='1.0'?>
> <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
> id='db1a6b6ff7193a90ec62d4d3e21313a8bba291c6'
> from='im.apinc.org'
> version='1.0'
> xmlns='jabber:server'
> xmlns:db='jabber:server:dialback'>
>   <stream:features xmlns:stream='http://etherx.jabber.org/streams'>
>      <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
>   </stream:features>
>
> Me :
> <stream:features></stream:features>
>
> Apinc :
> <stream:error>
>    <improper-addressing xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
>    <text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
>      Invalid Packets Recieved!
>    </text>
> </stream:error>
>
> Me :
> <db:result to='im.apinc.org'
> from='ephaone.org'>i-87bbc9ad5749f6fbc27a4f00e2c7ec3286ec3632</db:result>
>
> After reading rfc 3920, I suspect the problem comes from a missing attribute
> in
> the stream:features stanza sent by djabberd.
>
> "In the 'jabber:server' namespace, a stanza MUST possess a 'from'
> attribute; if a server receives a stanza that does not meet this
> restriction, it MUST generate an <improper-addressing/> stream error
> condition."
>
> Adding to, from, version and xmlns solved the problem ( in fact, it showed a
> different problem related to a dns migration ).
>
> Is the patch enclosed ok or is the server on im.apinc.org is having problem ?
>
> It seems ejabberd do not have the same behavior as I can access to some other
> server without trouble.
> According to a admin of apinc.org, they are running jabberd14 1.6.1.1
>
> As I am waiting on dns propagation, I couldn't check with other servers
> except
> google's one, which seems to be ok.

ok, so now, the dns was propagated and the problem was still there, i was seeing
"invalid-from" error instead. And I was also seeing this from other server as
well.

So I dug into jabberd code in order to see what was wrong. And in fact, the
problem was not at all what I thought. I wonder even how I could be so wrong.
Dialback code on djabberd is correct but there is just one thing, the timing of
the various stanzas.

If we look back at the trace, we can see :
1) me send <stream>
2) apinc answer <stream><stream:features/>
3) me answer <stream:features/>
4) apinc answer error

In fact, the apinc server was thinking that <stream:features/> is the dialback
answer, which is wrong. My current fix is to not send this at all, and so I can
connect to the server without troubles.

However, I think that's quite a hack and that's a part of xmpp I am not
comfortable with.

What would be the proper fix ?

1) send <stream> + <stream:features /> in one shot ?
2) not send <stream:features> ?
3) fix jabberd to do more check about this and not assuming that
everything coming on this socket is a dialback result ?


-- 
Michael Scherer


More information about the Djabberd mailing list