Bug 324403

Summary: Fatal "Could not create collection outbox" following upgrade to 4.11.0, duplicate special folders, locale issue?
Product: [Applications] kontact Reporter: Paul Gideon Dann <pdgiddie+kde>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: dilfridge, mail, pcn
Priority: NOR Keywords: drkonqi
Version: 4.11   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=325658
Latest Commit: Version Fixed In:

Description Paul Gideon Dann 2013-09-02 14:46:31 UTC
Application: kontact (4.11)
KDE Platform Version: 4.11.00
Qt Version: 4.8.5
Operating System: Linux 3.10.10-1-ARCH x86_64
Distribution (Platform): Archlinux Packages

-- Information about the crash:
- What I was doing when the application crashed:

I upgraded to version 4.11.0 in Archlinux, and KMail is now unable to start, saying "Could not create collection outbox resourceId: 14".  Sadly this leaves me with few clues as to how to solve the issue.

The crash can be reproduced every time.

-- Backtrace:
Application: Kontact (kontact), signal: Aborted
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fada71b67c0 (LWP 15889))]

Thread 6 (Thread 0x7fad8a84a700 (LWP 15890)):
#0  0x00007fad9e7c803f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fada1f96f1d in ?? () from /usr/lib/libQtWebKit.so.4
#2  0x00007fada1f96f59 in ?? () from /usr/lib/libQtWebKit.so.4
#3  0x00007fad9e7c40a2 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007fada472da2d in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7fad49f47700 (LWP 15891)):
#0  0x00007fad9e7c803f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fada1cd89cd in ?? () from /usr/lib/libQtWebKit.so.4
#2  0x00007fada1fc66b6 in ?? () from /usr/lib/libQtWebKit.so.4
#3  0x00007fad9e7c40a2 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007fada472da2d in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7fad39cf1700 (LWP 15907)):
#0  0x00007fada4720ffd in read () from /usr/lib/libc.so.6
#1  0x00007fad9e2413f0 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007fad9e202bac in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#3  0x00007fad9e20301b in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007fad9e20318c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#5  0x00007fada4e9eb46 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007fada4e70b1f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007fada4e70e15 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#8  0x00007fada4d6f6ef in QThread::exec() () from /usr/lib/libQtCore.so.4
#9  0x00007fada4d71d8f in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007fad9e7c40a2 in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007fada472da2d in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7fad2bfff700 (LWP 17141)):
#0  0x00007fad9e7c83e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fada4d72244 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007fada4d65945 in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007fada4d71d8f in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007fad9e7c40a2 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007fada472da2d in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7fad3a4f2700 (LWP 17143)):
#0  0x00007fad9e7c83e8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fada4d72244 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007fada4d65945 in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007fada4d71d8f in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007fad9e7c40a2 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007fada472da2d in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7fada71b67c0 (LWP 15889)):
[KCrash Handler]
#5  0x00007fada467e3d9 in raise () from /usr/lib/libc.so.6
#6  0x00007fada467f7d8 in abort () from /usr/lib/libc.so.6
#7  0x00007fada4d6790f in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#8  0x00007fada4d67a99 in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007fada4d682a4 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#10 0x00007fad41c39927 in MailCommon::Kernel::self() () from /usr/lib/libmailcommon.so.4
#11 0x00007fad41c2a4a0 in MailCommon::FolderCollection::writeConfig() const () from /usr/lib/libmailcommon.so.4
#12 0x00007fad41c2ad12 in MailCommon::FolderCollection::~FolderCollection() () from /usr/lib/libmailcommon.so.4
#13 0x00007fad41c2ad89 in MailCommon::FolderCollection::~FolderCollection() () from /usr/lib/libmailcommon.so.4
#14 0x00007fad41c295a4 in ?? () from /usr/lib/libmailcommon.so.4
#15 0x00007fada4680ea9 in __run_exit_handlers () from /usr/lib/libc.so.6
#16 0x00007fada4680ef5 in exit () from /usr/lib/libc.so.6
#17 0x00007fad41c39ff9 in MailCommon::Kernel::emergencyExit(QString const&) () from /usr/lib/libmailcommon.so.4
#18 0x00007fad41c3a597 in MailCommon::Kernel::createDefaultCollectionDone(KJob*) () from /usr/lib/libmailcommon.so.4
#19 0x00007fada4e85b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#20 0x00007fada5307342 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#21 0x00007fada5307380 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#22 0x00007fada37c144a in Akonadi::TransactionSequence::slotResult(KJob*) () from /usr/lib/libakonadi-kde.so.4
#23 0x00007fada379d75e in Akonadi::SpecialCollectionsRequestJob::slotResult(KJob*) () from /usr/lib/libakonadi-kde.so.4
#24 0x00007fada37c0ce0 in ?? () from /usr/lib/libakonadi-kde.so.4
#25 0x00007fada4e85b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#26 0x00007fada5307342 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#27 0x00007fada5307380 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#28 0x00007fada374f961 in ?? () from /usr/lib/libakonadi-kde.so.4
#29 0x00007fada374f864 in ?? () from /usr/lib/libakonadi-kde.so.4
#30 0x00007fada378b019 in ?? () from /usr/lib/libakonadi-kde.so.4
#31 0x00007fada4e85b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#32 0x00007fada4e85b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#33 0x00007fad9f75126d in ?? () from /usr/lib/libQtNetwork.so.4
#34 0x00007fad9f75a2bd in ?? () from /usr/lib/libQtNetwork.so.4
#35 0x00007fada587212c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#36 0x00007fada58786f0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#37 0x00007fada659172a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#38 0x00007fada4e71ebd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#39 0x00007fada4e9f780 in ?? () from /usr/lib/libQtCore.so.4
#40 0x00007fad9e202d96 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#41 0x00007fad9e2030e8 in ?? () from /usr/lib/libglib-2.0.so.0
#42 0x00007fad9e20318c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#43 0x00007fada4e9eb46 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#44 0x00007fada590f266 in ?? () from /usr/lib/libQtGui.so.4
#45 0x00007fada4e70b1f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#46 0x00007fada4e70e15 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#47 0x00007fada4e75f4b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#48 0x00000000004036d0 in ?? ()
#49 0x00007fada466abc5 in __libc_start_main () from /usr/lib/libc.so.6
#50 0x0000000000403b99 in _start ()

Possible duplicates by query: bug 322594, bug 321981, bug 321414, bug 321168, bug 317216.

Reported using DrKonqi
Comment 1 Paul Gideon Dann 2013-09-02 15:01:06 UTC
It turns out this was caused by a duplicate resource: I already had a resource for my local maildir (~/local/share/local-mail), and during the upgrade KMail presumably added another instance of this resource.  I had previously configured my local mail folder manually, so I assume some logic decided the default local mail resource didn't exist and added it.  I'm guessing the first resource to lock the mailbox caused the second to fail.

This should crash, though, so I won't set to "resolved" just yet.  I'll leave it here in case someone has time to do some testing to reproduce the bug and report the actual issue.
Comment 2 Paul Gideon Dann 2013-09-02 15:01:48 UTC
This *shouldn't* crash.  (Typo.)
Comment 3 Andreas K. Huettel 2013-09-02 16:34:47 UTC
Also seen by me on Gentoo upon upgrade to 4.11. (The trick to get kmail2 running again is to remove the duplicate special local folders with akonadiconsole. That's just a workaround though.)
Comment 4 Andreas K. Huettel 2013-09-02 17:08:28 UTC
Additional datapoints:

* I saw the problem on upgrade from 4.11rc2 to 4.11.0 (packager prerelease). kontact starts up, shows a dialog box "serious problem, program terminated: "Could not create collection Entwürfe resourceId: 9" and terminates on OK. Entwürfe is german for Drafts.

* From memory and maybe related, some of the special folders (like "Recycle Bin") were duplicated with different translations ("Papierkorb" and "Mülleimer").
Comment 5 Peder Chr. Nørgaard 2014-01-15 12:02:47 UTC
I observed the same bug or at least one very similar when upgrading Kubuntu from 13.04 to 13.10 - pushing Kmail from 4:4.10.5-0ubuntu0.1 to 4:4.11.3-0ubuntu0.1.  In my case it is the "sent-mail" folder, resourceId: 2 that "could not create collection".

I am at loss as to what to do - I know too little about KDE configuration to figure out how to detect duplicated folders, much less to remove them.  Could someone point to some helpful information, please?
Comment 6 Peder Chr. Nørgaard 2014-01-15 13:52:23 UTC
Oh, I forgot to mention, in my case the KMail program did not crash.  It puts out a nice alert box with the error message, and an OK to click on, before the program terminates nicely.

Still, it is a singularly useless error message.  It talks about "collection" and "resourceId", things that have no meaning in my universe as a KMail user.  The message tells me that something is not done, therefore the program terminates.  But it does not at all help me in identfying, much less solving the problem.
Comment 7 Peder Chr. Nørgaard 2014-01-24 15:39:02 UTC
I succeeded in working around the problem - not that the problem in any way is solved.  What I did was to kill me entire KDE configuration (the ~/.kde directory) and kill the akonadi (~/.local/share/akonadi and ~/.config/akonadi) - all done from a console login, so KDE itself was not active during the process.  Then login again via KDE and laboriously configure all of KDE from the beginning (fortunately, I had most of it documented).  My actual mail archive (in ~/.local/share/local-mail) survived (I did take a backup first!), and was accessible from my reconfigured KMail.

This info above is just information that may help others that are hit by the same problem.  Now some info about the problem itself:  I tried to do some debugging while the problem was still manifest.  I did not figure out much, the entire KMail setup is too complex for me to figure out in my spare time.   I did discover the source of the report  -  it is thrown in kdepimlibs, in the method Akonadi::SpecialCollectionsRequestJob::slotResult.  But then that is because of an error situation established earlier in some callback processing of a DBus communication - at that point  I ran out of time :-)

If anyone are interested in solving the basic problem - that something may happen during the 4.11 update that can render KMail useless with a useless error message - I still have a copy of my old ~/.kde - if someone are interested, I will provide copies of selected files to this bug report.  But I do not know what exactly to provide, and I will not dump the entire shebang on you ...  I may even be able to re-manifest the bug if I try real hard, but will not give any promises.

This is really a two-tier bug - bug 1, the update creates a problem, bug 2, that problem manifests itself by throwing a far-too-lowlevel error message to the defenseless user.
Comment 8 Paul Gideon Dann 2014-01-24 16:13:25 UTC
Wow; I don't think anything that drastic is required.  You just need to have a look at your Akonadi resources.  In System Settings, go to Personal Information.  Look through all the resources there that are responsible for e-mail.  You should have only one resource responsible for your local mail (the duplicated resources may have different names).  Click "modify" on each one to see the folder that they're pointing at.

For me, besides my public e-mail account, I have a resource named "Local Folders" which points to /home/<username>/.local/share/local-mail.

If there are several resources that point to local folders, that is probably the cause of the problem.  You should remove one of them, especially if they point to the same folder.  When you remove a resource, it won't actually delete the e-mail data stored in the directory it points to.
Comment 9 Andreas K. Huettel 2014-01-24 18:36:53 UTC
There is an easier workaround. Start akonadiconsole and look at your local folders. If you have "Duplicates" there, e.g. two times an "Outbox" or two times a "Waste bin", for example with a different localization (I've seen both "Papierkorb" and "Mülleimer" being present), delete the *empty* one. Afterwards kmail should start fine.
Comment 10 Sven Brauch 2014-06-08 09:58:32 UTC
Just happened to me too, but your workaround fixed it.
Comment 11 Denis Kurz 2016-09-24 19:20:22 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kontact (version 5.0 or later, as part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 12 Denis Kurz 2017-01-07 22:00:28 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.