Maximum server connections setting for Akonadi/KMail

Recently I started having some problems with Akonadi/KMail (I have version 23.04.3). I often (about each hour) get this error dialog in KMail saying that authentication did not succeed and the server error message that is appended is the following:

Login failed, server replied: A000002 NO Too many open connections ( 50 of 50 for jlp@holodeck1.com )

The Kolab Now tech support says that there is an Akonadi setting along the lines of “Max number of cached server connections” that I should check and lower if needed. But I can not find this setting anywhere.

Anyone knows anything about this setting or problem?

1 Like

Hi Jure,

I’m not aware of any such configuration in Akonadi. The IMAP resource has hardcoded limit of 2 connections (one for downloading/uploading emails, one for push notifications). What you could try to check is whether the IMAP resource might be losing connection (due to unstable connectivity, firewall cutting the connection or what not), that could cause the connection to not be terminated properly, so the server might not detect the disconnect properly, so you quickly reach the limit of connections?

I know that e.g. GMail has a similar (even stricter) limit on the number of parallel IMAP connections to the same account and I I’m not aware of any reports from users about reaching the limit.

pprkut mentioned the same issue during Akademy and had come to the same conclusion: The IMAP resource disconnects due to a timeout, but the server still considers the connection active.

Late to the party, but exact same problem. Did you figure it out @JLP ?

@Paul_Brown Nope, unfortunately, I have found no solution. As far as I understand it is something wrong either with the Kolab server or its configuration. But I do not know enough about all this to provide useful information. Maybe it would be best for knowledgeable people from Akonadi/KMail to directly step in contact with Kolab and could more directly and easily see what is going on.

In the meantime I now mostly use Kolab through their web interface, since another problem I noticed with KMail was that sometimes after this max server connection problem happens Akonadi/KMail stops checking/retrieving new email and I have to restart Akonadi to get it working again.

My provider uses Kolab too. So that at least is a clue.

Yep, exactly the same here. Which provider are you using, may I ask? I am using Kolabnow.

Same here, Kolab Now

1 Like

Time to inform them of the bug then

Hi,
I’ve looked into how our (kolabnow) imap servers behave in this regard. In my testing the connection limit works reliably (I can open 50 connections, close a connection, open a new connection, etc.), so I’m curious what could be going on here.

I suppose if connections are just dropped the server would never notice and keep them open for ~32minutes. So if that happens 25 times within the 32minutes with two connections I suppose we could get there. This doesn’t seem to be a problem if connections are closed normally, but maybe with interrupted network connectivity?

To check if akonadi is keeping more than two connections for some reason something like this should work: sudo netstat --all --program | grep imap
If you do not see ~50 connections at the time when you get the “Too many open connections” problem, then it seems like the dropped connections could be the culprit.

I’ll investigate if there is a good solution to that (tcpkeepalive I suppose).

1 Like

Thanks! Can @JLP or myself help from our side? Do you want us to to run something to better diagnose the problem?

It would be useful to know:

  • Do you experience this with a wifi connection or also while wired (I’m wondering if this is related to connections being dropped and reestablished)
  • Once akonadi hits the connection limit, what do you get for the “sudo netstat --all --program | grep imap” command ?
1 Like

Do you experience this with a wifi connection or also while wired (I’m wondering if this is related to connections being dropped and reestablished)

Definitely not related to this. I have a tower computer connected by cable directly to the router, which is directly connected to the outside world with fiber. Also it would not explain why your other client and KMail user, @JLP , is also having the same problem, but no-one else I have been able to locate.

And I will tell you another thing: it has been going on for years and I thought it was a KMail/Akonadi quirk, and only recently have I come to realise it is probably more a KMail/Akonadi + Kolab Now thing. I have been unable to find anyone else with other providers that suffer the same problem.

  • Once akonadi hits the connection limit, what do you get
    for the “sudo netstat --all --program | grep imap” command ?

Before hitting limit

$ sudo netstat --all --program | grep imap
tcp        0      0 192.168.1.136:42134     imap.gmx.com:imaps      ESTABLISHED 263400/akonadi_imap 
tcp        0      0 192.168.1.136:52762     mx.kolabnow.com:imap    ESTABLISHED 263402/akonadi_kola 
tcp        0      0 192.168.1.136:42126     imap.gmx.com:imaps      ESTABLISHED 263400/akonadi_imap 
tcp        0      0 192.168.1.136:48720     mx.kolabnow.com:imap    FIN_WAIT2   -                   
tcp        0      0 192.168.1.136:60608     mx.kolabnow.com:imap    FIN_WAIT2   -                   
tcp        0     46 192.168.1.136:51744     mx.kolabnow.com:imap    ESTABLISHED -                   
tcp        0      0 192.168.1.136:50494     mx.kolabnow.com:imap    ESTABLISHED 263402/akonadi_kola 
unix  3      [ ]         STREAM     CONNECTED     5128650  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5152784  263400/akonadi_imap  
unix  2      [ ]         DGRAM                    5147838  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5152783  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5144610  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5128717  263400/akonadi_imap 

After Hitting limit

$ sudo netstat --all --program | grep imap
[sudo] password for paul: 
tcp        0      0 192.168.1.136:42134     imap.gmx.com:imaps      ESTABLISHED 263400/akonadi_imap 
tcp        0      0 192.168.1.136:42126     imap.gmx.com:imaps      ESTABLISHED 263400/akonadi_imap 
tcp        0      0 192.168.1.136:45080     mx.kolabnow.com:imap    FIN_WAIT2   -                   
tcp        0      0 192.168.1.136:50494     mx.kolabnow.com:imap    ESTABLISHED 263402/akonadi_kola 
tcp        0      0 192.168.1.136:50516     mx.kolabnow.com:imap    ESTABLISHED 263402/akonadi_kola 
tcp        0      0 192.168.1.136:49984     mx.kolabnow.com:imap    FIN_WAIT2   -                   
tcp        0      0 192.168.1.136:50516     mx.kolabnow.com:imap    ESTABLISHED 263402/akonadi_kola 
tcp        0      0 192.168.1.136:49984     mx.kolabnow.com:imap    FIN_WAIT2   -                   
unix  3      [ ]         STREAM     CONNECTED     5128650  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5152784  263400/akonadi_imap  
unix  2      [ ]         DGRAM                    5147838  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5152783  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5144610  263400/akonadi_imap  
unix  3      [ ]         STREAM     CONNECTED     5128717  263400/akonadi_imap  

It looks more or less the same to me :person_shrugging: , but I hope that helps anyway.

Thanks!

Thanks for the info. Clearly not 50 connections lingering… It’s a weird issue for sure. I’m not aware of any similar issues of non Kontact users, so there must be some weird interaction going on.

1 Like

Yes. There was a time I thought it was only me, because, however hard I looked, I would always come up empty. But the other case seems to indicate that there is something going on between both ends.

Whatever you folks did, it worked! Thanks a lot!

@JLP I guess we can close this one now, right?

I have switched to using KMail/Kontact for Kolab accounts and have been using this for the last 2 or 3 days and indeed it appears I do not get the errors anymore. Thanks from my side too.