Bug 204970

Summary: Fails to connect to Freenode due to queue rates config from KDE 3 version config file
Product: [Applications] konversation Reporter: Eike Hein <hein>
Component: generalAssignee: Konversation Developers <konversation-devel>
Status: RESOLVED FIXED    
Severity: major CC: modax, xjakub
Priority: NOR    
Version: 1.2-alpha6   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 187307    
Attachments: #konversation IRC log with "kaddi" on his connection problem
kaddi's konversationrc, from his pastebin

Description Eike Hein 2009-08-24 13:08:44 UTC
People coming from the KDE 3 version of Konversation may have something like this in their konversationrc file:

[QueueRates]
EmptyingRate 0=6,50,0
EmptyingRate 1=6,50,0
EmptyingRate 2=6,50,0


The KDE 4 version fails to make a connection to Freenode with that in the config file:

[13:05] [Info] Looking for server chat.freenode.net:8001...
[13:05] [Info] Server found, connecting...
[13:05] [Info] Connected; logging in...
[13:05] [Notice] -- *** Looking up your hostname...
[13:05] [Notice] -- *** Found your hostname, welcome back
[13:05] [Notice] -- *** Checking ident
[13:05] [Notice] -- *** No identd (auth) response
[13:06] [error] Closing Link: 127.0.0.1 (Connection Timed Out)
[13:06] [Error] Connection to Server chat.freenode.net lost: The remote host closed the connection.
[13:06] [Info] Trying to reconnect to chat.freenode.net in 10 seconds.


Connecting to another ircd (a bahamut-1.8(03) I operate myself) still works, however.

This might be related to the changes we did in konversation.kcfg to accomodate the kconfig_compiler changes: http://websvn.kde.org/?view=rev&revision=991736
Comment 1 Eike Hein 2009-08-24 13:09:51 UTC
Another example of the connection error from the original reporter:

[12:13] [Info] Looking for server irc.freenode.net:8001...
[12:13] [Info] Server found, connecting...
[12:13] [Info] Connected; logging in...
[12:13] [Notice] -- *** Looking up your hostname...
[12:13] [Notice] -- *** Checking ident
[12:13] [Notice] -- *** Couldn't look up your hostname
[12:13] [Notice] -- *** No identd (auth) response
[12:13] [Nick] Nickname already in use. Trying mejla_.
[12:13] [Error] Connection to Server irc.freenode.net lost: The remote host closed the connection.
[12:13] [Info] Trying to reconnect to irc.freenode.net in 10 seconds.
[12:13] [error] Closing Link: 127.0.0.1 (Connection Timed Out)
Comment 2 Eike Hein 2009-08-24 13:37:46 UTC
Prior to the error in comment #1, the reporter had slightly different error output: [13:35] <mejla> Sho_: the original error was almost same, if you look back to http://www.fpaste.org/4THd/, then it just had not lines 8 and 11

For posterity: http://www.fpaste.org/4THd/ is comment #1.
Comment 3 Eike Hein 2009-08-24 17:31:53 UTC
It currently appears that the connection problem may be directly related to the specified queue flushing rates, and that it only worked with the KDE 3 version by stroke of luck / subtle behavioral changes in the underlying networking libraries (KNetwork vs. QtNetwork).

However, the reporter has no memory of changing the flushing rates manually, and the distro this happened on - Fedora - applies no related patches and ships no prepared konversationrc, so it is unclear how those settings have come about.
Comment 4 Eike Hein 2009-08-24 17:38:57 UTC
It turns out we had a walk-in in #konversation on August 18th who was suffering from the same problem, but on Kubuntu. The server status tab output amounts to the same:

[21:24] [Info] Looking for server irc.ubuntu.com:8001...
[21:24] [Info] Server found, connecting...
[21:24] [Info] Connected; logging in...
[21:24] [Notice] -- *** Looking up your hostname...
[21:24] [Notice] -- *** Checking ident
[21:24] [Notice] -- *** No identd (auth) response
[21:24] [Notice] -- *** Found your hostname
[21:25] [Nick] Nickname already in use. Trying kaddi_.
[21:25] [error] Closing Link: 127.0.0.1 (Connection Timed Out)
[21:25] [Error] Connection to Server irc.ubuntu.com lost: The remote host closed the connection.
[21:25] [Info] Trying to reconnect to irc.ubuntu.com in 10 seconds.


konversationrc: http://pastebin.com/f5cf19a8b (I'll attach it and the IRC log momentarily.)
Comment 5 Eike Hein 2009-08-24 17:39:53 UTC
Created attachment 36410 [details]
#konversation IRC log with "kaddi" on his connection problem
Comment 6 Eike Hein 2009-08-24 17:41:20 UTC
Created attachment 36411 [details]
kaddi's konversationrc, from his pastebin

Source: http://pastebin.com/f5cf19a8b

Suspiciously, it contains the same [QueueRates] section the other reporter would up with.
Comment 7 Eike Hein 2009-08-25 04:59:57 UTC
Actually, 1.1+ #3302 fails with basically the same error with the same [QueueRates] section:

[04:57] [Info] Looking for server irc.freenode.org:8001...
[04:57] [Info] Server found, connecting...
[04:57] [Info] Connected; logging in...
[04:57] [Notice] -- *** Looking up your hostname...
[04:57] [Notice] -- *** Checking ident
[04:57] [Notice] -- *** Found your hostname
[04:58] [Notice] -- *** No identd (auth) response
[04:58] [error]  Closing Link: 127.0.0.1 (Connection Timed Out)
[04:58] [Error] Connection to Server irc.freenode.org lost: remote host closed connection.
[04:58] [Info] Trying to reconnect to irc.freenode.org in 10 seconds.


... which means the fatal values probably must've been created at the first start of the KDE 4 version.
Comment 8 Modestas Vainius 2009-09-21 00:10:48 UTC
It appears Application::newInstance() is tricky because it is called via DBus from the parent process. This is kind of fragile and unreliable. So if Application() is constructed, but app.exec() fails (or newInstance() is never called due to DBus problems), Server::_stashRates() and subsequent calls in ~Application() will write wrong config file (destroying settings). I recommend to protect all that configuration file writing stuff in destructor with at least with "if (mainWindow) { ... }" (or better yet new variable which is set at the end of newInstance() or readOptions()).

Reports suggest that something might have happened in a similar way: "<kaddi>     hi, my kubuntu just crashed while konversation was running and now all settings are gone".
Comment 9 argonel 2009-09-21 00:39:13 UTC
SVN commit 1026169 by argonel:

Work around bad values in konversationrc, and attempt to prevent it from
happening again by making the application object own the common queue
rates instead of using a global static.

BUG: 204970

 M  +44 -4     application.cpp  
 M  +8 -0      application.h  
 M  +1 -1      commit.h  
 M  +1 -11     irc/ircqueue.cpp  
 M  +7 -5      irc/ircqueue.h  
 M  +5 -36     irc/server.cpp  
 M  +1 -6      irc/server.h  
 M  +1 -1      queuetuner.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1026169
Comment 10 argonel 2009-09-21 02:48:29 UTC
SVN commit 1026186 by argonel:

only save prefs if there is a mainWindow object

CCBUG: 204970

 M  +8 -5      application.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1026186
Comment 11 argonel 2009-09-21 04:27:06 UTC
SVN commit 1026198 by argonel:

this can't work, mainWindow is a QPointer
CCBUG: 204970

 M  +4 -7      application.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1026198
Comment 12 Eike Hein 2009-09-21 10:48:12 UTC
SVN commit 1026238 by hein:

CCBUG: 204970


 M  +7 -0      application.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1026238