Bug 376808 - Akonadi stuck on retrieving folder content, ItemFetchJob Stuck, Failed: Multiple Merge Candidates
Summary: Akonadi stuck on retrieving folder content, ItemFetchJob Stuck, Failed: Multi...
Status: RESOLVED DUPLICATE of bug 338658
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Maildir Resource (show other bugs)
Version: 5.4.1
Platform: OpenSUSE Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
Depends on:
Reported: 2017-02-22 15:29 UTC by Christian Saemann
Modified: 2018-06-09 09:06 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:

akonadiconsole debugger (830.50 KB, image/png)
2017-02-22 15:29 UTC, Christian Saemann
akonadiconsole job tracker (201.30 KB, image/png)
2017-02-22 15:29 UTC, Christian Saemann
Patch to have akonadi return the first result if her are multiple (2.25 KB, patch)
2017-06-01 18:54 UTC, Joshua Clayton

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Saemann 2017-02-22 15:29:07 UTC
Created attachment 104167 [details]
akonadiconsole debugger

I've got a mail folder into which a filter is moving newsletters upon arrival. Something might have gone wrong when filtering, but a few of the emails appear twice. When I click on an unread email in the folder, kmail gets stuck on "retrieving folder content".

I had applied akonadictl fsck and akonadictl vacuum previously, but this doesn't change the situation.

I've attached pictures from akonadiconsole's debugger and job tracker.
Comment 1 Christian Saemann 2017-02-22 15:29:49 UTC
Created attachment 104168 [details]
akonadiconsole job tracker
Comment 2 Daniel Vrátil 2017-02-23 16:29:48 UTC
Please try the following guide to resolve the problem: http://www.dvratil.cz/2017/01/kmail-multiple-merge-candidates-error-and-how-to-fix-it/
Comment 3 Christian Saemann 2017-02-23 16:44:36 UTC
Thanks for your quick reply, this fixed it. I should have probably googled more thoroughly. BTW: You mentioned in the blog post that this bug should be fixed in 16.12.1, I experienced it on 16.12.2 (openSUSE Tumbleweed packages).
Comment 4 Christian Saemann 2017-03-05 11:18:16 UTC
In case this helps: I've just had to clear the cache of a folder once more, so this still happens in 16.12.2. It seems to be connected to filtering: the folder contains newsletters, which are put there by a filter rule upon receipt. I can't see anything special about the filter I use, though.
Comment 5 farandole 2017-03-21 10:11:10 UTC
I experience a similar issue in 16.12.3 on manjaro.
Comment 6 Frits Spieker 2017-03-22 09:58:38 UTC
Same problem here. Updated on OpenSUSE Tumbleweed. The Kmail/ Akonadi combo is very much a "hit and miss" at the moment. Sometimes I can read quite some emails in a row, sometimes I get the "Retrieving Folder Content" message for hours on end. In the past restarting akonadi seemed to help, but no longer.

Akonadi is at 5.4.3.

I'll be happy to provide any logs, info whatever that could help in fixing this.
Comment 7 Joshua Clayton 2017-06-01 18:54:49 UTC
Created attachment 105826 [details]
Patch to have akonadi return the first result if her are multiple

log multiple merge candidates as an error, but rather than returning nothing, return the first result.

This seems like a less bad result than the stalls that currently happen in kmail/kontact.
Comment 8 Joshua Clayton 2017-06-01 19:00:54 UTC
The patch above is compile tested. The patch applies and builds across a wide range of versions, but finding the right version and variables to work with kubuntu 17.04's kf5 5.31
Comment 9 Daniel Vrátil 2017-06-02 19:49:21 UTC
What your patch does it dangerous as it can potentially overwrite the wrong data (that's why the code bails out if it finds more than one candidate - it cannot tell which one it should overwrite).
Comment 10 Joshua Clayton 2017-06-02 20:54:00 UTC
Hi, Daniel.
I hear what you are saying in theory, but the current situation with kmail/kontact is worse, with mail sync cycles just hanging and the program becoming inoperable, sometimes becoming usable again by restarting akonadi, and sometimes requiring the db to be deleted.

In practice email message ID's may be duplicated in terms of actual copies, but each copy should contain exactly the same message.

The current behavior is clearly wrong.
Either it should be updating ALL the entries, or if it is just returning a reference to the content, then any one of them will do (I was understanding it to be the second).

Can you tell me which it is? Maybe I'm misunderstanding how this is being used.
Comment 11 Maurice Batey 2017-09-09 12:12:54 UTC
(In reply to farandole from comment #5)
> I experience a similar issue in 16.12.3 on manjaro.

Also here on Mageia-6:

Comment 12 Rolf Eike Beer 2018-06-09 09:06:33 UTC

*** This bug has been marked as a duplicate of bug 338658 ***