Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 238533

Summary: net-im/bitlbee is unable to connect to local net-im/jabberd2
Product: Gentoo Linux Reporter: Florian Friesdorf <flo>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED UPSTREAM    
Severity: normal CC: jer
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Florian Friesdorf 2008-09-24 01:26:05 UTC
When registering with a local jabberd2, there seems to be a race condition.

03:17:37 <@root> jabber(foo@bar) - Logging in: Connecting
03:17:37 <@root> jabber(foo@bar) - Logging in: Connected to server, logging in
03:17:37 <@root> jabber(foo@bar) - Logging in: Converting stream to TLS
03:17:37 <@root> jabber(foo@bar) - Logging in: Connected to server, logging in
03:17:38 <@root> jabber(foo@bar) - Logging in: Authentication finished
03:17:38 <@root> jabber(foo@bar) - Couldn't log in: Stream error: not-authorized: stanza sent before session start
03:17:38 <@root> jabber(flo@chaoflow.net) - Logging in: Signing off..

The connection to a remote jabberd2 is successfully established. The problem existed already with bitlbee-1.2.2, but bitlbee normally succeeded one out of three times. With bitlbee-1.2.3 I was not able to get a connection even after >20 attempts.

In case of other jabber clients, there is no consent to whether the client or server is violating the protocol. The problem seems similar to: http://mail.jabber.org/pipermail/jabberd/2006-April/003311.html 

Reproducible: Always
Comment 1 Florian Friesdorf 2008-09-24 03:40:06 UTC
I just succeeded to connect, by repetetive trying ('account on'). It very much looks like the race condition described in the link posted before and it is hard to tell whether it got worse with version 1.2.3 or the conditions on my server changed.

Probably the whole thing could be fixed, in bitlbee, by simply waiting a bit (0.5 - 1s) before considering the connection to the jabber server to be established.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-24 03:58:22 UTC
OK, so what package exhibits this problem? bitlbee or jabberd2? Why do you mention both in the summary? Also, why is this Gentoo's problem instead of upstream?
Comment 3 Florian Friesdorf 2008-09-24 04:10:07 UTC
(In reply to comment #2)
> OK, so what package exhibits this problem? bitlbee or jabberd2? Why do you
> mention both in the summary? Also, why is this Gentoo's problem instead of
> upstream?

From that discussion_ it is unclear, whether bitlbee or jabberd2 is violating the protocol. As both programs are shipped with Gentoo, it is a Gentoo problem. I see the pragmatic solution in telling bitlbee to wait a bit (as mentioned above), but I would like to leave it to more knowledgeable people to decide on whether it is a bitlbee or a jabberd2 problem. I am happy to file a bug upstream and reference it here, if you tell me where.

.. _discussion: http://mail.jabber.org/pipermail/jabberd/2006-April/003311.html
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-24 04:34:14 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > OK, so what package exhibits this problem? bitlbee or jabberd2? Why do you
> > mention both in the summary? Also, why is this Gentoo's problem instead of
> > upstream?
> 
> From that discussion_ it is unclear, whether bitlbee or jabberd2 is violating
> the protocol. As both programs are shipped with Gentoo, it is a Gentoo problem.

No no no. Because I can do both `wget http://foo/bar' and `rm bar', and Gentoo ships both wget and rm, that would somehow be Gentoo's problem?

More to the point: Gentoo is there to distribute both packages, not fix XMMP or its implementation in either package, nor to arbitrate in this matter, unless the problem was specific to Gentoo's distribution of either package, which it apparently isn't.