Kmail 2: Fix ‘Failed to fetch the resource collection’ error and get on with life

Kmail failed to fetch resource collection

Not everyone uses the web to check their mail- though it certainly makes sense to do so.  If you are using KMail 2 in Kubuntu 11.10, you may have seen this error.

KMail encountered a fatal error and will terminate now.

The error was:

Failed to fetch the resource collection.

This error happened even when started the Kontact suite.  So, how are we gonna get this guy back to life?  We could run away from home into gentle and inviting arms of Thunderbird, or we could stick it out and raise the dead.  I found the answer in this thread for OpenSuSE users.  I’ll go ahead and give you two ways however, since navigating hidden files & folders in Dolphin might not be your cup of tea.

If you just need a hint, it’s all Akonadi related.  :)

Method 1

Open Dolphin and head to your home directory.  Find the configuration button on the top right, and enable ‘Show Hidden Files’.

Fix Kmail

Enable hidden files in Dolphin.

Now, let’s go hunt down those pesky Akonadi files that are causing all of this trouble.

Got to:

~/.config/akonadi/

…and delete everything in there.

Delete the Akonadi config files.

Now, navigate to:

~/.local/share/akonadi/

Delete the files here that start with ‘akonadi’.

Delete the akonadi_control and akonadiserver files.

Next, go to:

~/.kde/share/config/

Can you guess what you need to do here?  That’s right, get rid of ‘akonadi-firstrunrc’ and ‘akonadi_akonotes_*’.

Lastly, head over to:

~/.kde/share/apps/

Find Kmail2, and delete the folder.

Start Kontact or Kmail, and you are done!

Method 2

It’s always easier this way…

Open up a terminal.  You probably use Konsole.

Issue the following commands:

rm ~/.config/akonadi/*

rm ~/.local/share/akonadi/ak*

rm ~/.kde/share/config/ak*

rm -r ~/.kde/share/apps/kmail2/

And that’s it!  If you did everything right then you should be able to fire up Kmail and get back to work!

Navigating through the .kde folder (.kde4 on some distros) is a great way to familiarize yourself with the way KDE organizes it’s user settings in a home directory.

‘Til next time!

 

 


Dean Howell

Dean Howell has over a decade of experience with Linux and nearly 2 decades of experience with computers in general. Currently, Dean is Editor-in-chief of The Powerbase and also works for one of the world's largest providers of Linux-based NVRs.

Related posts

  • Geofarce Databend

    OK, I did that and the error message has gone and KMail opens up – completely blank. All the mail folders and settings are gone.
    How do I get them back?

    • http://profiles.google.com/deanhowell2 Dean Howell

      I’ve never seen that happen before… Try:

      sudo dpkg-reconfigure kontact*

      and cross your fingers?? Good luck…

      • kde-user

        Well, If you delete config files you should expect something could happen to your… config. Maybe you should modify your post and tell people to MOVE instead of deleting files. Great post anyway. It’s really sad that a major kde app like kmail/kontact still has such usability issues… not cool.

  • rafaila42

    Thanks a lot mate. Appreciate it. Live long.

  • Blueman

    Thanks a lot it really helped me out! I just can’t understand why I can’t see any folder structure in KMail itself after setting an account up!

  • Iskren Hadzhinedev

    Thanks for this! It pointed me to the right direction. I suddenly encountered this issue today and since I have 10 email accounts, reconfiguring all of them is going to be a pain so I didn’t take the risk of deleting config files. What worked for me is the following command from a terminal (as a regular user) “akonadictl restart” which restarts the Akonadi server and recovers the corrupted data. On next KMail launch everything was fine.

Top