Bug 288364

Summary: "Retrieving Folder Contents" hanging without showing content
Product: [Applications] kmail2 Reporter: Dario Bertero <anrvrx>
Component: message listAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED WORKSFORME    
Severity: major CC: abrahams, amantia, anderslund, asturm, blagozlatev, blaueshawaiihemd, bmikowski, dbjh, fresh.road1272, gerrysw11, jospoortvliet, leonardomateo, lists, Martin, mmtsales, ndladis, shai, silver.salonen, talmage, werner.merk
Priority: NOR    
Version: 4.9.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: attachment-11087-0.html

Description Dario Bertero 2011-12-06 22:56:26 UTC
Version:           4.7 (using KDE 4.7.3) 
OS:                Linux

Instead of showing the content of a message, it shows "Retrieving Folder Contents" screen forever. Starting the program from terminal it shows "kontact(5365) MessageList::Core::ModelPrivate::findMessageParent: Circular reference loop detected in the message tree". Only some few old emails are shown correctly after a while and not always.  Mails are apparently fetched correctly (via POP3), but set filters are not applied properly.

Reproducible: Always

Steps to Reproduce:
It started one day after launching the program, and then always (except once). Just open a message folder.

Actual Results:  
What described above.

Expected Results:  
Show the content of the email.
Comment 1 Blagovest Zlatev 2011-12-09 08:22:47 UTC
I couldn't reproduce the bug or find duplicates. Could you tell us if you remember installing/changing something around the time of the bug starting to appear? Everything would be helpful.
Comment 2 Myriam Schweingruber 2011-12-09 10:44:48 UTC
I was able to reproduce the bug by changing simply the option to "Work offline", then going back online again. It shows the Retrieving folder content screen forever.
As a side note: trying to edit the ressource in Akonadi is not possible either, although the Akonadi server is running. Restarting Akonadi did not help either.
Comment 3 András Manţia 2011-12-10 07:33:02 UTC
Is this for an online IMAP account? Or something else?
Comment 4 Myriam Schweingruber 2011-12-12 09:46:32 UTC
The OR uses a POP3 account, mine is an offline IMAP. Using KDE 4.7.3 on Kubuntu 11.10
Comment 5 dbjh 2011-12-18 22:45:48 UTC
Hello,

Same thing here. Using Kmail 4.7.3 on "Linux (x86_64) release 3.1.5-2.fc16.x86_64". I have accepted all updates since installing Fedora 16.
I started with a clean install of Fedora 15, then after a few days I upgraded to Fedora 16. KMail was fine when using Fedora 15. After the upgrade KMail appears to be completely fubar, as in, *many* things simply not working, among which:
- the bug under discussion
- loss of all old e-mail, after KMail detected that I had e-mail from an older version (the one of Fedora 15)
- no longer being able to retrieve e-mail, after having worked at least once (since I have two messages in my inbox)
- when I attempt to reply to a message (as in clicking on the Reply button) a popup window opens telling me to wait a moment while transmitting the message. After a while that window closes and then nothing (no e-mail composing window).

About the bug under discussion, apparently the data hasn't been lost, because when I hover over the subject line, I see part of the e-mail message, while the pane that should show the contents in full continues to display the message "Retrieving Folder Contents" (in Dutch).

Is there a way to reinstall Kmail without having to reinstall Fedora 16? There doesn't appear to be a package specifically for kmail though. Using:
# yum list|grep -i kmail
yields nothing. Same thing for:
# yum list|grep -i kontact
Of course I have also tried "yum install" with both kmail and kontact as package name.

I hope you can at least provide me with a work-around, because I have used KMail for several years and would like to continue using it. For now, I am forced to look for an alternative.

Kind regards,
Daniël
Comment 6 dbjh 2011-12-24 22:18:54 UTC
Hi,

Today I got the update of KDE 4.7.4 (and Linux (x86_64) release 3.1.6-1.fc16.x86_64) and now KMail works fine again.
So, I no longer have the problem of the bug under discussion. It also turned out that KMail hadn't deleted all e-mail, even though it previously displayed only 2 e-mail messages in my inbox. After the update of KDE 4.7.4 KMail showed my old e-mail again (including the e-mail I had sent while I was still using Fedora 15). Retreiving, sending and replying to e-mail also works again.
I have not tried the option "Work offline". I will leave that to Myriam Schweingruber after she has upgraded.

Kind regards,
Daniël
Comment 7 Leonardo Mateo 2011-12-29 11:01:33 UTC
I'm having the same problem using KDE 4.7.4 on Arch Linux.
My account is an online IMAP, and the behavior is random. It mostly happens when I start kontact offline, but it also happens suddenly after using it for several hours.
Comment 8 MK 2011-12-30 10:15:49 UTC
Hi all!

Same problem here on kubuntu 11.10 KDE 4.7.3. Accounts are POP3 and local mbox. Problem occurred after applying update from 4.7.2 to 4.7.3. Kmail ist not usable anymore.

Bug 263223 says to look for mails with empty remoteID's by using DB query in akonadi-console. I got several of those mails, but is this really the cause of the problem?

Leonardo states in comment #7, that the problem persists in 4.7.4 whereas comment #6 indicates it's already solved in that version...?

Any hints from the devs?

Regards,
Martin
Comment 9 Leonardo Mateo 2011-12-30 10:45:40 UTC
I can confirm it still happens on 4.7.4, at least for IMAP accounts. I built it from source, using only kmail, not kontact and happened again yesterday after a few hours of use.
Comment 10 MK 2011-12-30 11:35:22 UTC
more (perhaps helpful) info for the devs:

akonadi-console shows on tab "job tracker": Job kmail2:

JobType Akonadi::ItemFetchJob - State: Failed: Unknown error: (Unable to fetch item from backend)


excerpt from file akonadiserver.error:
ItemRetrieverException :  Unable to retrieve item from resource: Did not receive a reply.
Comment 11 Leonardo Mateo 2011-12-30 13:21:02 UTC
Maybe the problem is the lack of retries. Last time it happened to me (yesterday) I was able to get the email by switching Work Offline and back to Online. Then it retried to fetch emails and I got it.
Comment 12 abrahams 2011-12-31 13:06:58 UTC
Similar problem here with KDE/kmail 4.73 -- according to Synaptic, the latest available for my Kubuntu system.  I can clear the "Waiting" message sometimes by moving to another message in the inbox, but something is clearly very wrong here.  A recent update is probably responsible, since I never saw this message until recently.
Comment 13 MK 2012-01-10 18:50:57 UTC
Dear fellow sufferers! Please vote for this annoying bug! I really consider switching to thunderbird to get rid of buggy akonadi.

To the devs: Can we provide any information / backtrace / log on akonadi-console which will help to solve this bug?

Regards, 
Martin
Comment 14 dbjh 2012-01-11 19:27:26 UTC
I gave it the maximum number of votes. There must be *really* bad bugs in KMail if a bug as serious as this one is getting so little (visible) attention...
Comment 15 András Manţia 2012-01-11 20:10:42 UTC
Does removing the nepomuk agents help? Run akonadiconsole, Agents tab and remove the agents. If they keep starting up, find the .desktop file for the agents $KDEDIR/share/akonadi/agents and remove the Autostart feature there. $KDEDIR might be /usr or /opt/kde4 or anything else (depends on your distro).
Comment 16 MK 2012-01-11 20:53:13 UTC
Hi Andras!

Removing the nepomuk agents is of no use for me. The error persists.

Sometimes things work and the choosen mail is shown. Seems random to me.
In that case akonadi-console shows this log:

kmail2-1778541711 (0x1cb2290) 8 SEARCH "prefix
nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>SELECT DISTINCT
?person WHERE { graph ?g { ?person
<http://akonadi-project.org/ontologies/aneo#akonadiItemId> ?itemId . ?person a
nco:PersonContact ; nco:hasEmailAddress ?email . ?email nco:emailAddress
\"user@host.net\"^^<http://www.w3.org/2001/XMLSchema#string> . } }" FULLPAYLOAD
EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME) 
kmail2-1778541711 (0x1cb2290) 8 OK SEARCH completed 
kmail2-1778541711 (0x1cb2290) 9 UID FETCH 15346 FULLPAYLOAD ALLATTR ANCESTORS 1
EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME
ATR:ErrorAttribute) 
kmail2-1778541711 (0x1cb2290) * 15346 FETCH (UID 15346 REV 2 REMOTEID ""
MIMETYPE "message/rfc822" COLLECTIONID 28 SIZE 5682 DATETIME "11-Jan-2012
20:22:07 +0000" FLAGS (\SEEN) ANCESTORS ((28 "inbox")) ATR:MDNStateAttribute {1}
I PLD:ENVELOPE[1] {402} ("Wed, 11 Jan 2012 20:10:42 +0000" "[Bug 288364] .... = ) 
kmail2-1778541711 (0x1cb2290) 9 OK UID FETCH completed 

****

But for most of the mails "folder content" screen is hanging forever
and akonadi-console shows this log:

kmail2-1778541711 (0x1cb2290) 10 SEARCH "prefix
nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>SELECT DISTINCT
?person WHERE { graph ?g { ?person
<http://akonadi-project.org/ontologies/aneo#akonadiItemId> ?itemId . ?person a
nco:PersonContact ; nco:hasEmailAddress ?email . ?email nco:emailAddress
\"user@kde.org\"^^<http://www.w3.org/2001/XMLSchema#string> . } }"
FULLPAYLOAD EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE
DATETIME) 
kmail2-1778541711 (0x1cb2290) 10 OK SEARCH completed 
kmail2-1778541711 (0x1cb2290) 11 UID FETCH 15314 FULLPAYLOAD ALLATTR ANCESTORS 1
EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME
ATR:ErrorAttribute) 
kmail2-1778541711 (0x1cb2290) 11 NO Unable to fetch item from backend 

It all boils down to this "unable to fetch from backend" Why is the backend not responding? Where can we put "sensors" to see the data flowing through?

Any help appreciated!

Martin
Comment 17 MK 2012-01-19 18:55:31 UTC
additional info:
kmail has got no problem when accessing today's new mails. But just one click on an older mail brings back the forever-hanging "retrieving folder content" screen.
Comment 18 MK 2012-01-20 21:57:29 UTC
Never mind - My wife and I switched over to thunderbird. Goodbye kmail.
Comment 19 dbjh 2012-01-20 22:09:21 UTC
(In reply to comment #17)
> additional info:
> kmail has got no problem when accessing today's new mails. But just one click
> on an older mail brings back the forever-hanging "retrieving folder content"
> screen.
Is there any KMail developer who actually cares about this problem? In case there is one: when I click on older e-mails (older as in before the problem first appeared) the problem does not show up - KMail continues working as it should.
Comment 20 MK 2012-01-21 09:54:37 UTC
Seems to be a regression either in libakonadi-k* or kdepimlibs-kio-plugins/-runtime. When downgrading those packages from 4.7.3-0ubuntu0.1 to 4.7.2+git111007-0ubuntu1 the problem disappears here.
Comment 21 Shai 2012-01-26 13:35:58 UTC
I sometimes see this. Simple workaround: Switch to an empty folder (e.g. outbox), then switch back.

But yes, annoying as hell.
Comment 22 Silver Salonen 2012-01-29 12:32:55 UTC
Duplicate of 257970?
Comment 23 David Talmage 2012-06-04 12:26:41 UTC
This happens to me in Kmail 4.8.3 on Kubuntu 12.04. It just started happening yesterday. I think there was an update to Kmail two days ago. Switching to an empty folder and back to my inbox doesn't help.
Comment 24 Myriam Schweingruber 2012-06-04 12:59:16 UTC
(In reply to comment #21)
> I sometimes see this. Simple workaround: Switch to an empty folder (e.g.
> outbox), then switch back.

Sadly that doesn't work for me at all. It simply stays totally unresponsive.

Any additional information you would need for this, konsole output or the like?
Comment 25 David Talmage 2012-06-07 16:59:51 UTC
In Kmail, I deleted the IMAP account with the problem.  Then I created the account again. The problem disappeared.
Comment 26 Myriam Schweingruber 2012-06-24 06:24:07 UTC
(In reply to comment #25)
> In Kmail, I deleted the IMAP account with the problem.  Then I created the
> account again. The problem disappeared.

I have done that repeatedly in Akonadi, over and over again,still happens.
Comment 27 jos poortvliet 2012-08-06 19:43:17 UTC
might be related to bug #289097 ?!?
Comment 28 Frits Spieker 2012-09-24 13:27:23 UTC
Same problem here. Fresh install of 4.9.1 (OpenSuSE 12.2 64bit).

Firing up kontact from the terminal shows:

kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2292 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2293 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2294 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2295 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2296 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2297 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2298 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2299 
kontact(23366) MessageList::Core::ModelInvariantRowMapper::modelRowsRemoved: Could not find invariant to invalidate at current row  2300
Comment 29 Frits Spieker 2012-10-15 08:27:59 UTC
Is there any developer looking at this extremely annoying bug? Or is everybody celebrating making "KDE the best release ever", totally ignoring that one of the core components (a lot of people do read email on their PC) is a piece of junk at the moment?
Comment 30 Philippe Paravicini 2012-10-24 17:00:08 UTC
I am having this issue with Kmail2 - 4.8.5. 

In addition, attempting to send an email hangs.  The problem appears to clear itself after several minutes, and is happening so frequently that it disrupts my workflow, given that email is mission critical in my work.

The problem appeared along many others after I upgraded my kubuntu-10.04 system to kubuntu-12.04 several weeks ago.  I have setup a kubuntu-12.04 VM and will attempt to migrate to a clean install to see whether that could solve the issue.

It's gotten so bad that I have also installed Evolution and considering abandoning Kmail2/Kontact which has worked so well for me over the last 12 years.
Comment 31 BMikowski 2012-11-18 03:36:31 UTC
My problems started when I imported a rather complex Kmail 1.1x folder structure under another folder (e.g., zzzOldMail).  It has a lot of subfolders with the same names as the existing (default) folders (InBox, Sent, Drafts, etc.) and thousands of emails per folder, and one subfolder was 1.1GB.  I was able to move over many historical emails before everything went nuts.  After I deleted the old folders, I noticed stability in response times and the ability to retrieve messages again (without an endless wait).  I was able to migrate my Wife's less complex email structure without any issues (other than the Folder move bug.)

I still want to import and clean up the rest of my old email, and this bug makes it nearly impossible.  I'd be willing to help gather debug or log info if that will help.

OpenSUSE 12.1, KDE 4.6 --> OpenSuse 12.2 x64, KDE 4.8.5 Migration.
Comment 32 Frits Spieker 2013-01-20 09:45:54 UTC
I am now on 4.10, RC2 and bug is still there. Going into its 3rd year almost without being fixed. 

*ANY* Developer out there; if you need data, examples, log files or whatever, just let me or other users know; we'll be more than happy to help and solve this bug.

Just ignoring this bug does not make it go away; it might make the users go away which in the end also solves the problem. /cynism
Comment 33 András Manţia 2013-01-20 10:14:36 UTC
Have you tried disabling nepomuk (desktop search) completely if it helps?
Comment 34 Frits Spieker 2013-01-20 10:46:03 UTC
On Sunday 20 January 2013 10:14:36 you wrote:
> https://bugs.kde.org/show_bug.cgi?id=288364
> 
> --- Comment #33 from András Manţia <amantia@kde.org> ---
> Have you tried disabling nepomuk (desktop search) completely if it helps?

BINGO!!

Switched off nepomuk desktop search completely and as a result I now have a 
blindingly fast Kmail2, which is responsive and *immediately* shows the 
message content, no matter what message I click. Even works (as expected) 
whilst quickly scrolling through a long message list.

Also; filtering works fast again. I just created an extra filter to move some 
messages in a particular folder to another one (based on a combination of 
sender and subject) and filtering the 500+ messages in that folder went faster 
than a blink of an eye. Trying to do something like that *with* nepomuk 
activated was a sure exercise in frustration.

So now we have found the most likely culprit, where do we take this from here?

Cheers and THANK YOU András for being the developer that -finally- asked the 
"can you try this" question.

Cheers,
Frits
Comment 35 Frits Spieker 2013-01-20 10:49:49 UTC
P.S. I am now on RC3 of 4.10 and with nepomuk enabled the bug immediately rears its ugly head again. Switch off Nepomuk and presto. Blindingly fast Kmail2 again.
Comment 36 Gerry Gavigan 2013-03-14 20:48:29 UTC
I've just upgraded to opensuse 12.3 and then to kde 4.10.1 

kmail 2 appears to have regressed to nearly unusable with nepomuk enabled

I've deleted the original nepomuk folders, I've disabled desktop search

I'm quite disappointed because in 12.2 indexing mysteriously started working in dolphin
Comment 37 Silver Salonen 2013-03-15 07:07:41 UTC
As I had problems with Akonadi overall after upgrading to KDE 4.10, I just deleted all Akonadi and Nepomuk data and started over. At first attempt when Nepomuk was enabled some system components hanged so much that I didn't even get to use Dolphin.
I disabled Nepomuk and started over again. After re-adding Akonadi resources I enabled Nepomuk for email indexing only and now it is working OK.

So maybe you could just try resetting your settings and Akonadi data?

PS. I'm on openSUSE 12.3 and KDE 4.10.1 as well.
Comment 38 Gerry Gavigan 2013-03-15 10:51:38 UTC
@Silver Salonen 

I've just discovered two things

- I don't know my way around akonadi/kmail2 as well as I thought I did  
- lucky backup  "restore" works perfectly

May I ask you to identify the files I should delete? I was too enthusiastic on the first attempt
Comment 39 Silver Salonen 2013-03-15 10:55:50 UTC
I described it in bug 313234 - note that after doing that I had to re-create all the Akonadi resources, which is fortunately easy enough :)
Comment 40 Gerry Gavigan 2013-03-15 11:00:15 UTC
Thank you
Comment 41 Andreas Sturmlechner 2013-07-21 12:22:43 UTC
KDE SC 4.10.95 - Just got that bug after 10+ uptime hours on an imap folder. I had moved several dozen E-Mails during that time, and the troubled folder only displayed the 4 messages that I had moved into it - couldn't load its content. On a stable internet connection, navigating to other folders didn't change a thing. After restarting kmail the problem disappeared.
Comment 42 Andreas Sturmlechner 2015-08-25 10:12:25 UTC
Can't say I've ever seen that error again since my previous message, and I'm (still) a permanent user of kmail2 - good to close?
Comment 43 Frits Spieker 2015-08-26 15:05:36 UTC
Created attachment 94225 [details]
attachment-11087-0.html

Hi. Feel free to close. Seems to be working ok. 

Cheers, 
Frits 

On August 25, 2015 12:12:25 PM GMT+02:00, andreas.sturmlechner@gmail.com wrote:
>https://bugs.kde.org/show_bug.cgi?id=288364
>
>--- Comment #42 from andreas.sturmlechner@gmail.com ---
>Can't say I've ever seen that error again since my previous message,
>and I'm
>(still) a permanent user of kmail2 - good to close?
>
>-- 
>You are receiving this mail because:
>You voted for the bug.
>You are on the CC list for the bug.
Comment 44 Martin Steigerwald 2015-09-10 10:34:21 UTC
Closing as requested. Also any Nepomuk based KMail is unmaintained. If you still have issues with at least KDEPIM 4.14 and latest Akonadi 1.13 please open a new bug report. For performance related reports please wait for KDEPIM/Akonadi 15.08 or even 15.12. Especially 15.12 will contain massive performance improvements by Dan/Volker in both Akonadi and KMail. Thank you and greetings from KDE Randa Meetings, Martin