Kontact 4.7.2 crashes at startup - lost all email accounts too

Hello all,

it’s been a week or so since Kontact stopped working. When I start it up is show the “Account Assistant” to setup an email account and at the same time in the background I get an Error dialog saying “KMail encountered a fatal error and will terminate now.The error was: Failed to fetch the resource collection.

I had 6 email accounts here. Looks like I lost them all.

I have no idea where to start looking to fix this problem. I would like to get all my email back.

This is what I get when I start kontact from terminal:

agron@hp-dv8000:~/.local/share/akonadi/db_data/akonadi> kontact 
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
Object::connect: No such slot KMMainWidget::slotItemNotMovedByFilters( Akonadi::Item )
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
kontact(8702)/kdeui (kdelibs): No such XML file "/home/agron/.kde4/share/apps/kontact/default-.rc" 
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
agron@hp-dv8000:~/.local/share/akonadi/db_data/akonadi> "/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "QLocalSocket::connectToServer: Invalid name"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "org.freedesktop.DBus.Error.ServiceUnknown - The name org.kde.nepomuk.services.nepomukstorage was not provided by any .service files"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/kontact(8702)" Soprano: "Invalid iterator."
Plugin paths:  ("/usr/lib/qt4/plugins", "/home/agron/.kde4/lib/", "/usr/lib/") 
Trying to load Attica plugin:  "/usr/lib/qt4/plugins/attica_kde.so" 
Trying to load Attica plugin:  "/home/agron/.kde4/lib//attica_kde.so" 
Trying to load Attica plugin:  "/usr/lib//attica_kde.so" 
Using Attica with KDE support 
Adding provider "https://api.opendesktop.org/v1/" 
OCS Request:  QUrl( "https://agron:shendi2003@api.opendesktop.org/v1/content/categories" )  
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702) MailCommon::Kernel::emergencyExit: "KMail encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection." 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702) MailCommon::Kernel::emergencyExit: "KMail encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection." 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::resourceScanResult: Failed to request resource "akonadi_maildir_resource_0" : "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702) MailCommon::Kernel::emergencyExit: "KMail encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection." 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::resourceScanResult: Failed to request resource "akonadi_maildir_resource_0" : "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702) MailCommon::Kernel::emergencyExit: "KMail encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection." 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::resourceScanResult: Failed to request resource "akonadi_maildir_resource_0" : "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702) MailCommon::Kernel::emergencyExit: "KMail encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection." 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::resourceScanResult: Failed to request resource "akonadi_maildir_resource_0" : "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unknown error. (Failed to fetch the resource collection.)" 
kontact(8702) MailCommon::Kernel::emergencyExit: "KMail encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection." 
kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::resourceScanResult: Failed to request resource "akonadi_maildir_resource_0" : "Unknown error. (Failed to fetch the resource collection.)" 


Go ahead and open a terminal and input the following command.

akonadiserver

Please copy and paste the output from this command. This will give more details to work off of.

Here’s what I am getting from akonadiserver:

agron@hp-dv8000:~> akonadiserver 
search paths:  ("/home/agron/bin", "/usr/local/bin", "/usr/bin", "/bin", "/usr/bin/X11", "/usr/X11R6/bin", "/usr/games", "/usr/lib/jvm/jre/bin", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "/usr/bin/mysql_install_db" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
akonadi.collectionattributetable                   OK
akonadi.collectionmimetyperelation                 OK
akonadi.collectionpimitemrelation                  OK
akonadi.collectiontable                            OK
akonadi.flagtable                                  OK
akonadi.mimetypetable                              OK
akonadi.parttable                                  OK
akonadi.pimitemflagrelation                        OK
akonadi.pimitemtable                               OK
akonadi.resourcetable                              OK
akonadi.schemaversiontable                         OK
Database "akonadi" opened using driver "QMYSQL" 
DbInitializer::run() 
checking table  "SchemaVersionTable" 
checking table  "ResourceTable" 
checking table  "CollectionTable" 
checking table  "MimeTypeTable" 
checking table  "PimItemTable" 
checking table  "FlagTable" 
checking table  "PartTable" 
checking table  "CollectionAttributeTable" 
checking relation  "PimItemFlagRelation" 
checking relation  "CollectionMimeTypeRelation" 
checking relation  "CollectionPimItemRelation" 
DbInitializer::run() done 
skipping update 2 
skipping update 3 
skipping update 4 
skipping update 8 
skipping update 10 
skipping update 12 
skipping update 13 
skipping update 14 
skipping update 15 
skipping update 16 
skipping update 17 
skipping update 18 
skipping update 19 
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
Database "akonadi" opened using driver "QMYSQL" 
Database "akonadi" opened using driver "QMYSQL" 
Nepomuk Query Server not available 
DataStore::unhideAllPimItems() 
Unable to connect to dbus service:  ""
"
0: akonadiserver(_Z11akBacktracev+0x35) [0x808be45]
1: akonadiserver() [0x808c210]
2: [0xffffe400]
3: /lib/libc.so.6(gsignal+0x45) [0xb6e7d8c5]
4: /lib/libc.so.6(abort+0x175) [0xb6e7f1d5]
5: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x8a) [0xb74f459a]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xd8) [0x808d7c8]
7: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xc9) [0xb758e4a9]
8: /usr/lib/libQtCore.so.4(+0x1012a7) [0xb75982a7]
9: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3e) [0xb75a1d9e]
10: akonadiserver(_ZN6QDebugD1Ev+0x45) [0x8087305]
11: akonadiserver(main+0x28b) [0x8086a6b]
12: /lib/libc.so.6(__libc_start_main+0xf3) [0xb6e69003]
13: akonadiserver() [0x80871a1]
]
"

OK that looks good. Now what to check is this. From your log that provided above this looks interesting.

[LEFT]kontact(8702)/kdeui (kdelibs): No such XML file "/home/agron/.kde4/share/apps/kontact/default-.rc"

as well this

   kontact(8702)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::resourceScanResult: Failed to request resource "akonadi_maildir_resource_0" : "Unknown error. (Failed to fetch the resource collection.)"

[/LEFT]

IMO it seems that there is some corruption of your config files going on. If you were to look at the /home/agron/.kde4/share/apps/kontact/ folder you will see multiple files that start with default- but thereafter there are different strings attached. If you look above there’s no doubt that default-.rc does not exit and it would generate that error. So, based on this the “**Account Assistant” **does not seem to be assisting you very much at the moment and creating garbage config files. So, here’s what you can try, before creating a new account and importing your email into that account.

open up the console and type

akonadiconsole

Now be careful what you are doing here. Back up your home folder before messing around with it. Now that it is open click on all of the resources, one by one, and notice at the bottom left where it states “Identifier”. What you are looking for is Identifier: akonadi_mbox_resource_0. When you have that one highlighted then go ahead and click, at the bottom right, “Configure” then click “Configure Natively” this will then request you to point to where your mail folders are located. I’m thinking yours are located here ? /home/agron/.local/share/.local-mail.directory/
go ahead select the folders under where it says “File Name” then click OK. Then close akonadiconsole and try opening kmail.

Thanks Msounhein,

I ran akonadiconsole (after backing everything up). On the agents tab there was an item called Local Folders that had an identifier of akonadi_maildir_resource_0. I assumed it’s close enough to mbox right? and selected the folder you mentioned. It said “The selected path contains valid Maidir folders”.

But there was no email there.

In kmail, I noticed I still have all my identities and all my smtp sending settings. I have a different smtp entry for each email account. However there is nothing on the accounts/receiving. This is where I have what email account goes into what inbox folder.

Msounhein, these email accounts have been in kmail for ages. Could there be some recent format change or something?

I ran akonadiconsole (after backing everything up). On the agents tab there was an item called Local Folders that had an identifier of akonadi_maildir_resource_0. I assumed it’s close enough to mbox right? and selected the folder you mentioned. It said “The selected path contains valid Maidir folders”.

Well, these are two different formats; kind of like comparing Macintosh apples to Golden delicious apples. Yeah they are both apples but have distinct flavors. maildir is what Kmail uses by default and unless you have used mbox in the past this is the format you should stick with. maildir stores each email in its own file whereas mbox stores emails in one file such as “Inbox”. So my question to you is are you setting up your email accounts within Kmail such as Kmail handles pulling in POP3 emails or are you using some other process?

But there was no email there.

In kmail, I noticed I still have all my identities and all my smtp sending settings. I have a different smtp entry for each email account. However there is nothing on the accounts/receiving. This is where I have what email account goes into what inbox folder.

Msounhein, these email accounts have been in kmail for ages. Could there be some recent format change or something?

Now, this gets me to thinking especially the last line in the quote above. Since you have been using KMail forever I’m wondering if your emails are still stored in /home/username/.kde/share/apps/kmail or /home/username/.kde3/share/apps/kmail Replace “username” above with your home directory name. I would navigate to both of those using dolphin and look for your emails in there. If there aren’t any emails in those folders I would check /home/username/.local/share/.local-mail.directory/ again, with dolphin, to see if maybe you didn’t miss something. Once you determine where your emails are located you will have to import them back in this time using kmail. This is what a mail directory will look like.

http://dl.dropbox.com/u/62642289/UglyIcons/snapshot21.png

In order to import emails back into kmail go to File > Import Messages

then select “Import KMail Maildirs and Folder Structure” from the drop down box.

This is a quote from the import filter itself.
“Note: Never select your current local KMail maildir (usually ~/Mail or ~/.kde/share/apps/kmail/mail ): in this case, KMailCVT may become stuck in a continuous loop.”

Your email directory that kmail should currently be using is /home/username/.local/share/.local-mail.directory/ which, I believe from what you said your old emails are not currently in there. So it would be safe to import emails as long as they are not contained in the /home/username/.local/share/.local-mail.directory/ directory.
So from there the import mechanism is fairly self explanatory. I would suggest following the directions within the import filter itself. So I would definitely import to Local Folders/“KMail-Import” you can then arrange your folders back to where they were by moving them out of the KMail-Import folder. Then after that you will have to recreate your mail retrieval settings and point them to the imported directories.

also I found a good resource for KMail configuration.

KMail/FAQs Hints and Tips - KDE UserBase Wiki