Bug 356751 - akonadi 4:15.08.2-0ubuntu1 fails to read updates from IMAP server, reporting "log_kimap: Socket timeout!"
Summary: akonadi 4:15.08.2-0ubuntu1 fails to read updates from IMAP server, reporting ...
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-15 21:03 UTC by smihaila
Modified: 2021-05-07 21:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description smihaila 2015-12-15 21:03:05 UTC
After recently upgrading from Kubuntu 14.04 Trusty to 15.10 Willy, the akonadi-server is no longer able to sync the local store (MySql-hosted) to the IMAP server, for certain IMAP server folders, reporting an error message like this:

log_imapresource: Starting retrieval for "{folder_name_omitted_for_privacy_reasons}"
log_imapresource: Starting message retrieval. Elapsed(ms): 4112
log_imapresource: MessageCount: 1975 Local message count: 0
log_imapresource: UidNext: 1979 Local UidNext: 1979
log_imapresource: HighestModSeq: 0 Local HighestModSeq: 0
log_imapresource: Detected inconsistency in local cache, we're missing some messages. Server: 1975 Local: 0
log_imapresource: Refetching complete mailbox.
akonadiagentbase_log: 1975
1975
log_imapresource: Fetching 1 intervals
Received: 1 In total: 1 Wanted: 1975
Received: 1 In total: 2 Wanted: 1975
Received: 1 In total: 3 Wanted: 1975
[...]
Received: 1 In total: 44 Wanted: 1975
Received: 1 In total: 45 Wanted: 1975

<== and here it hangs for a while and then it reports the error seen below:

log_kimap: Socket timeout!
log_kimap: close
log_imapresource: online= true
log_imapresource: online= false
log_imapresource:
log_imapresource: Cancel task: "killed"
The item sync is being rolled-back.
log_imapresource: online= true
log_imapresource: Fetch job failed "Connection to server lost."
Pass a valid window to KWallet::Wallet::openWallet().
log_kimap: KIMAP::LoginJob(0x100c4d0)
log_kimap: connectToHost "localhost" 1143
finished
log_imapresource: Cancelling this request. Probably there is no connection.
log_kimap: close

...And after a while the cycle repeats itself - akonadi will issue another IMAP login command and re-try from the beginning to sync itself up with the IMAP server - trying to read 1975 message items and bailing out at item #45.

This issue was not occurring with the akonadi version that came up with Kubuntu 14.10 Trusty.

Please help, now my e-mail send & receive capabilities are disfunctional, and I cannot use Akonadi and KDE Mail anymore.



Reproducible: Always

Steps to Reproduce:
1. Fire up a Konsole shell and run: `akonadictrl restart`.
2. Keep this Konsole shell open, in order to see messages logged by the akonadi-server.
3. Launch the KDE mail (kmail2 5.0.2) application.
4. Select the root of the e-mail folder for my IMAP account in the KDE Mail's left-side folder view.
5. Right-clicking that root IMAP folder and select the "Update this folder and all its subfolders" option.

Actual Results:  
1. Observe the error message reported in the Konsole shell.
2. Note how the KDE mail application's message progress toolbar on the bottom-left does not get to 100%. Also observe how new messages in Inbox or other folders do not get downloaded (not even the header).
3. Also any message deletions that were performed locally, do not seem to be propagated to the IMAP server, and when accessing the IMAP server in a more direct way i.e. via a web-based client provided by the MS Exchange Server implementing the actual IMAP listener, the messages that were supposed to be erased, are still listed there.


Expected Results:  
1. akonadi-server should be able to complete the message retrieval/sync-up i.e. not getting stuck at "Received: 1 In total: 45 Wanted: 1975" log line and no socket error or pending background retrieval job getting auto-canceled.
2. KDE mail should able to finalize the message donwload/syncup progress bar and show new messages.
3. Any message deletions that happened locally, at KDE mail app level (i.e. delete some messages from Inbox - either new or old) should be taken into consideration by the IMAP server (either after the next send/receive cycle which in this care is set to happen at each 5-minute interval, or upon explicit "Synchronize this folder and all of its subfolders content").

A similar bug was submitted here:
https://bugs.launchpad.net/ubuntu/+source/akonadi/+bug/1526529

The IMAP server is a DavMail java process running locally, and acting as a bridge to a corporate Microsoft Exchange server.
Comment 1 Karsten.Fleischer 2016-01-05 11:32:04 UTC
Hello, same problem here (Ubuntu 15.10)

kmail/akonadi is almost unusable with slow/unresponsive imap servers. This bug is triggered easily with davmail as it slowly processes every request via the web interface of exchange. However it is currently the only way to access certain enterprise servers running exchange. 

As a workaround (NOT A FIX) a was playing with some davmail and kde network properties
to mitigate the issue:

davmail (~/.davmail.properties):
davmail.folderSizeLimit=100 (Limit maximum number of messages to be checked (I had 6000 mails which never went through without issues))
davmail.enableKeepAlive=true (davmail will frequently respond to the connected client while it is waiting for the exchange response)

In addition I set the KDE global network settings (System Settings -> Network/Settings ->  Connection Preferences: "Socket read" and "Server response" to 3600 seconds)

While this helps it doe not fix the really issue that kmail is way to impatient when there
are slow connections/large emails/large folders.
Comment 2 robin.jespersen 2016-01-09 22:13:38 UTC
Hi, 
same problem here (Ubuntu 15.10).
Trying to load about 30.000 mails from yahoo imap server.
Comment 3 Justin Zobel 2021-03-09 05:46:54 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 4 Kurt Bennater 2021-05-07 21:53:44 UTC
Possibly the same as https://bugs.kde.org/show_bug.cgi?id=436748, although that report is not restricted to a local mail server.