Bug 310899 - Resource KMail Folders is broken. This resource is now online
Summary: Resource KMail Folders is broken. This resource is now online
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.9.3
Platform: unspecified Linux
: NOR critical
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-29 23:48 UTC by Neil
Modified: 2015-11-28 09:46 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil 2012-11-29 23:48:31 UTC
During normal use of kmail I get a notification "Resouce KMail Folders is broken.  This resource is now online."

My upgrade from kmail to kmail2 has been an embarrassing nightmare but I would *really* like to try and help fix it instead of just giving up like others seem to be doing.

Can you please help me troubleshoot this?  My kmail2 installation is a mix of maildir folders and mbox files.  I created a new 'Inbox" as a maildir and use that for the delivery of new messages now.  I keep that folder as small as possible and move messages into my real inbox every day or two.  When I click on other folders (mbox or maildirs) the "... is broken..." message appears regularly and the software hangs.  Sometimes it comes back, sometimes I have to kquitapp, sometimes I have to kill -KILL, and sometimes I just reboot.


Reproducible: Always

Steps to Reproduce:
1. Open kmail or kontact
2. Use normally - send messages, read messages, open other folders to read previous messages, etc.

Actual Results:  
Notification that Resource KMail Folders is broken, frequent hangs, message bodies not showing up.

Expected Results:  
Would like to get this working as well as the previous version (kmail1?) which worked very well and was reliable.

Any troubleshooting tips would be greatly appreciated.

I've deleted the nepomuk and akonadi directories a few dozen times, tried the kmail->kmail2 migration 5-10 times, ran akonadictl fsck and akonadictl vacuum probably 30-40 times.  All over the past month.

My kmail directory (~/Mail) is a mix of Maildir and MBox folders but mostly MBox folders from the previous version of KMail.  Folders range in size from 50 messages up to about 20000 messages.
Comment 1 moron 2012-12-11 17:19:42 UTC
The behaviour seems a lot like concurrency and / or locking problems between Anakondi and Kmail2 as it tends to happen more when system load is higher (or at least it feels that way).   I am curious whether having a faster PC masks the issue somewhat?
Comment 2 Neil 2012-12-11 21:27:51 UTC
I was actually thinking that it's possible any testing that may have been done on this was done on a computer with a solid-state drive so it handles the massive overhead better.  My computer isn't brand new but it's got enough horsepower to reliably run everything i've thrown at it (except kmail2 obviously) including some of the latest games. 
Either way i'm not having much luck troubleshooting.  I tried using Thunderbird to open my big/old MBOX files and it works fine so the problem isn't corrupted files.

Anybody have any ideas how to troubleshoot this?
Comment 3 Gerry Gavigan 2012-12-21 23:24:51 UTC
I've just started getting the same problem.  

KMail2 seems to be working fine but it throws this up while accessing my POP-3 email account 

FWIW it's an SSD on a old machine with memory running at 200 MHz, Athlon 3200XP at 2.2 GHz  

running opensuse 12.2 on i586
KMail2  4.9.4-1.1
libakonadi 4.9.4-1.1 
libakonadiprotocolinternals 1.8.1-138.1
kdebase4-workspace-plasma-engine-akonadi 1.8.1-138.1
Comment 4 Neil 2012-12-23 18:30:06 UTC
Near as i can tell kmail2 with mboxes is a time bomb.  Eventually the size of the mbox gets too big for the new infrastructure to handle and people will start getting failures.  I've done a fair bit of testing and can't find a consistent threshold for when problems start but the problems always start eventually.  I've mostly had success up to about 500 messages in one file but sometimes I can get up to 1000 messages before the error messages start (and sometimes the flakiness happens before 500).  It might be more dependant on the size of the file (attachments, etc) rather than the number of messages.

Seems the new infrastructure is WAY too precariously balanced and it's easy for a big mbox file to bring the whole house of cards down.  The numerous layers of complexity also make troubleshooting real difficult if not impossible.

I'm using a 500G spinning disk on a Core2 Quad 3.2Ghz machine with 4 gigs of RAM.  I haven't tested on an SSD drive but I suspect a SSD will handle more messages before the failures start but the failures will still happen eventually.

Best bet seems to be considering MBOXes unsupported under the new infrastructure and either convert all your folders to Maildirs or switch to something like Thunderbird or Claws that handle large mbox folders reliably.

Kmail2 is definitely a step backwards.
Comment 5 Dj YB 2013-04-21 23:23:21 UTC
got the same problem
moved not long ago from fedora15 to fedora18, migrated my old maildir
kmail is working just fine (except  some minor problems)  but this error notification keep on popping.

kdepim-4.10.2-3.fc18.x86_64
akonadi-1.9.1-1.fc18.x86_64
Comment 6 Shai 2013-07-16 20:36:13 UTC
I seem to be seeing something very similar -- though, no crashes or hangs so far, and there appears to be a workaround -- switching to another folder and coming back allows me to view the message where an error was triggered.

I see this several times in every session of work, since I moved to kmail2 with the introduction of kmail 4.10.5 into Debian unstable. I reported it also there: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717101

Thanks,
Shai.
Comment 7 Serge Ratke 2013-08-29 17:46:52 UTC
i've been seeing this behaviour for years now. wonder if there's a reliable way to work around this.

using kde 4.11 on gentoo ~amd64
Comment 8 mattm3a 2013-11-13 21:29:56 UTC
4.10.5 "release 1" for OpenSUSE
I now receive this same error when trying to send any email message. The mail does not get sent, but increases the new message count in the KMail folders outbox. I now also cannot delete anything from the outbox folder. And the message bodies are not available immediately after trying to send; I have to close KMail and reopen it to make the email body readable. 

Mail does not actually send, which makes kmail unusable.
Comment 9 MAG4 2013-11-22 08:54:11 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Roman Fietze 2014-01-23 08:42:23 UTC
I (temporarily) "fixed" this problem using a small trick.

KMail2 doesn't like it when you are too hasty, e.g. when deleting mail. In my case this seemed to be the reason for this error, I just clicked the "Move to Trash" button to quickly.

Now I just started kmail by hand, watching cout/cerr while I tried to select the message causing this error and going the resource offline. This gave me some output like:

akonadi_mixedmaildir_resource_0(18748)/akonadiresource (maildir): Failed to read item "1390374044.R143......" in Maildir "/home/.../Mail/inbox"

I just changed to my inbox in my mail folder and searched this entry. And of cource I couldn't find it. So I searched for other entries looking similar, some that do not end in ",S" or ",RS", and I found them under new/.

Now I just copied one of the existing files and recreated the missing file again.

After restarting kmail I again selected the bad message, and it appeared. Of cource with the wrong content, but I didn't really care, because I deleted it before.

After that "fix" I detected, that the missing message was already in the trash folder. Where else could it be?!
Comment 11 Laurent RINEAU 2014-04-25 13:54:46 UTC
Should not we open a new bug about a problem in the wording of the notification? It says: " Resource <resourcename> is broken. This resource is now online". Should not the last word be "offline"?
Comment 12 Knut-Olav 2015-01-16 09:40:18 UTC
KMail 4.14.1 reports this error:
  Resource KMail Folders is broken.

With this message on the lower window bar:
  Unable to fetch item from backend (collection -1): Unable to retrieve item from resource: Invalid item retrieved.

My problem occurred after applying a filter on (exact) 1000 messages on a local folder, a filter that moves messages of year 2014 to another local folder. I have at least two messages left failing, maybe more.

After the error happens nothing seem to work as usual, not even looking at IMAP folders - everything locks up, hanging. After KMail restart I can use IMAP again, until I try to move one of the "bad" messages again.
Comment 13 Martin Steigerwald 2015-04-12 10:46:08 UTC
Hello. When I get this correctly, this is related to the Mixedmaildir resource. If so

martin@merkaba:~/.kde/share/config> find -name "*maildir*"            
./akonadi_maildir_resource_0rc

should return a mixedmaildir config file. Can you test this?

Also there may be different reasons why the resource breaks, so I am not sure whether this bug report contains more than one bug report in one already.

Neil and Gerry, can you still reproduce with KMail 4.14 + Akonadi 1.13? If so, please share your setup details and if you can also a description on how to reproduce it.

Knut-Olav your report appears to be a bit similar to my own bug report

Bug 343114 - gets stuck on one request that times out, kmail and 
akonadiconsole do not display any mail payloads anymore, stuck waiting 

as it often appeared that KMail and Akonadi just stopped talking to each other until I restarted just KMail. However that appears to be fixed or gotten at least *much* better with recent KMail 4.14.x and Akonadi 1.13.x branch compiled from source.

Knut-Olav, can you confirm that just a KMail restart "fixed" that issue for you? If so, would you be willing to compile latest KDEPIM 4.14 and Akonadi 1.13 from source, to see whether it makes a difference for you?

Also if it happens, are KMail and Akonadi basically idling around appearing to do nothing?
Comment 14 Martin Steigerwald 2015-04-12 11:49:13 UTC
Setting to waiting for information after I received bugzilla rights to do that.
Comment 15 Knut-Olav 2015-04-13 09:42:20 UTC
~/.kde/share/config $ find -name "*maildir*"
./akonadi_mixedmaildir_resource_0rc
./akonadi_maildir_resource_2rc
./akonadi_maildir_resource_0rc
./akonadi_maildir_resource_1rc


Restarting KMail did not actually fix the problem of crashing... it just fixed the hanging-issue.
But not always, if I remember correctly... Some restarting and killing (kill -9) of akonadi and kmail and kontact were sometimes also needed.

I worked around the problem somehow... I think I created a new maildir resource and moved everything over, folder by folder, skipping those problematic emails that failed for unknown reason. I believe I lost some emails, but hopefully I dont need them...

At this time, I'm not able to reproduce the problem, since I removed the old broken resource.
Comment 16 Martin Steigerwald 2015-09-08 19:41:12 UTC
Knut-Olav, thank you. As you cannot reproduce the issue anymore, and no one else shared any information, I close this report. Feel free to reopen if it happens again.
Comment 17 Hank Ivy 2015-11-28 02:34:11 UTC
It happens a lot to me.  What can I do to collect information that would help?
Comment 18 Martin Steigerwald 2015-11-28 09:46:55 UTC
Hello Hank, as I am not sure whether your issue has exactly the same cause and for clarity I suggest you open a new bug about it. Very long bug reports with ton of comments are time consuming to understand and handle.

Include any relevant output from ~/.xsession-errors. You can also let Akonadi and KMail run from a Konsole window with unlimited text buffering and cut and paste from there, then you only have kmail and akonadi output. Also make sure that relevant debug output is enabled in kdebugdialog.

Also describe your setup exactly.