Kmail - fatal error!

Hi all,

kmail has developed a fatal error and is terminating.

“Could not create collection drafts, resourceID 14”

Does anyone know how to fix this?

Kind regards
Pedro

@PedroSMS:

Operating System?
KDE Plasma Version?
KDE Plasma KMail version?

  • If Linux == OS then, distribution name.

Thanks for your reply.

The OS is Tumbleweed - (up to date)

~> uname -a
Linux localhost.localdomain 6.9.7-1-default #1 SMP PREEMPT_DYNAMIC Fri Jun 28 05:50:47 UTC 2024 (a5efffa) x86_64 x86_64 x86_64 GNU/Linux

~> kmail --version
kmail2 6.1.1 (24.05.1)

The GUI is Wayland.

This error has just appeared. It is not associated with an update.

Running kmail from a terminal

~> kmail
Path override failed for key base::DIR_APP_DICTIONARIES and path ‘/usr/bin/qtwebengine_dictionaries’
Path override failed for key base::DIR_APP_DICTIONARIES and path ‘/usr/libexec/qt6/qtwebengine_dictionaries’
Path override failed for key base::DIR_APP_DICTIONARIES and path ‘/usr/libexec/qt6/qtwebengine_dictionaries’
failed to open /usr/lib64/dri/hybrid_drv_video.so
Not using hybrid_drv_video.so
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult “Could not create collection drafts, resourceId 14”
org.kde.pim.mailcommon: “The Email program encountered a fatal error and will terminate now.\nThe error was:\nCould not create collection draft
s, resourceId 14”

I get a brief look at the kmail main form. I have a new mailbox “unified mailboxes”. This was not there before this error.

Does this help?

Kind regards
Pedro

@PedroSMS:

Then it’s something related to KDE Plasma 6 – Qt 6 – and, possibly, Wayland.

  • Please check the status of the Akonadi database with the following command –

> akonadictl fsck 2>&1 | grep -iE 'found|no RID'

It’s normal that a few items do not have a RID –

Collection "Search" (id: 1) has no RID.
Collection "OpenInvitations" (id: 96) has no RID.
Collection "DeclinedInvitations" (id: 97) has no RID.
Collection "Letzte Suche" (id: 832) has no RID.
Found 4 collections without RID.

Then, please confirm if, the behaviour observed still occurs or, is different, with an X11 session in place of the Wayland session.

Thank for the reply. However, I’m way past that now…

I searched the internet for answers and discovered that either the workings of kmail is the biggest secret, or nobody knows…

I deleted all my email accounts, uninstalling kmail, re-installing it, and my email accounts…

It’s working again. Everything else I tried was a waist of time.

Kind regards
Pedro

Hi,

I thought this problem was behind me. This morning it started crashing again, this time “Could not create collection outbox, resourceId 3”.

I ran > akonadictl fsck 2>&1 | grep -iE 'found|no RID'

akonadictl fsck 2>&1 | grep -iE ‘found|no RID’
Found 77 external files.
Found 77 external parts.
Found no unreferenced external files.
Found -1 parts to be moved to external files
Found -1 parts to be moved to database
Collection “Search” (id: 1) has no RID.
Found 1 collections without RID.
Found 0 items without RID.
Found 0 dirty items.

When I initially ran the above command it gave me a long list of undefined references (sorry I didn’t capture that).

It doesn’t make any difference if I am running Wayland or X11.

Kind regards
Pedro

I have run

~>akonadictl restart


org.kde.pim.akonadiserver: DATABASE ERROR:
org.kde.pim.akonadiserver: Error code: “2067”
org.kde.pim.akonadiserver: DB error: “UNIQUE constraint failed: CollectionTable.parentId, CollectionTable.name”
org.kde.pim.akonadiserver: Error text: “UNIQUE constraint failed: CollectionTable.parentId, CollectionTable.name Unable to fetch row”
org.kde.pim.akonadiserver: Values: QList(QVariant(QString, “”), QVariant(QString, “”), QVariant(QString, “outbox”), QVariant(qlonglong, 2), QVariant(qlonglong, 3), QVariant(bool, true), QVariant(int, 2), QVariant(int, 2), QVariant(int, 2), QVariant(bool, true), QVariant(int, -1), QVariant(int, -1), QVariant(bool, false), QVariant(QString, “”), QVariant(bool, false))
org.kde.pim.akonadiserver: Query: “INSERT INTO CollectionTable (remoteId, remoteRevision, name, parentId, resourceId, enabled, syncPref, displayPref, indexPref, cachePolicyInherit, cachePolicyCheckInterval, cachePolicyCacheTimeout, cachePolicySyncOnDemand, cachePolicyLocalParts, isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14)”
org.kde.pim.akonadiserver: Error during insertion into table “CollectionTable” “UNIQUE constraint failed: CollectionTable.parentId, CollectionTable.name Unable to fetch row”
org.kde.pim.akonadiserver: Failed to append Collection “outbox” in resource “akonadi_maildir_resource_0”
org.kde.pim.akonadiserver: Error while handling command CreateCollection on connection akonadi_maildispatcher_agent (0x561c7c529f60)
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult “Could not create collection outbox, resourceId 3”
org.kde.pim.maildispatcher: Failed to get outbox folder. Giving up.
org.kde.pim.akonadicore: Failed CollectionCreateJob. “Could not create collection outbox, resourceId 3”

Does this info help?

Kind regards
Pedro

@PedroSMS:

When you setup a new, clean, KMail instance –

  • Do you first make sure that, KWallet has been initialised with a default Blowfish wallet named “kdewallet” and, with a password identical to the user’s login password and, is that wallet open when you begin to setup KMail?

  • Are you using the KMail setup wizard to initialise the first e-Mail account?
    Handbook is here – <Chapter 2. Getting Started>

  • Is the user’s home directory encrypted?

Thanks for the reply. However, kmail is still broken.

I deleted a bunch of files & folders and managed to stop it from crashing.

Using the Settings > Configure KMail, I deleted all, but one, of the accounts, send and receive profiles…

Now I have dead folders in the folder pane of KMail. KMail allowed me to delete some of them, but 4 folders have the “Delete” function greyed out. How do I delete these folders?

I tried to create new accounts hoping it would relink these folders, but KMail created new folders with the same name, tagged with (offline)… These accounts are NOT working.

Where does KMail keep its config files?

Or, how can I purge KMail?

Regards
Pedro

Update : “Could not create collection outbox, resourceId 3” bug has started again, and crashing KMail.

Does anyone know how kill this bug?

Kind regards
Pedro

Update, update: This bug is harder to kill than a Zombie Dracula…!!!

I have given grep a good workout, looking for EVERY file with ANY reference to my emails accounts and settings - and DELETED them ALL.

Then akonadictl restart. Reinstalled half my accounts. If this is fixed now, I will reinstall the other half…

What is fixed? Run for 3 days?

Kind regards
Pedro

‘~/.config/’

You’ll need to search for filenames containing “akonadi” and “mail” and, other Kontact components.

Is not the only place. There are lots of files in ~/.local/ too…

Kind regards
Pedro

Pedro,

My KMail died after an update recently (I run it on a KDE Neon box that I do nothing else with, in order to avoid the infinite problems I used to have with keeping it running), and I was able to fix it by supplying akonadi output and the contents of various config files to chatGPT and following its advice. Maybe it could solve your issues as well?

Good luck,
Dan

Yes, but, they’re mostly not configuration files –

  • They’re local copies of PIM content and various application cache contents such as “recently used” …
  • Plus, things like personal Plasma look-and-feel definitions and, KDE Plasma Konsole user profiles …

Thanks for your reply.

I found a few akonadi database files in ~/.local/ referencing my emails, and given akonadi was complaining about SQLs… I deleted those files too. I think that was the main fix.

It’s been going okay for 5 days now.

akonadi and KMail should have a purge command option. This seemed to be a silly little bug, that was SOOOOO frustrating to get rid of…

Kind regards
Pedro

It covered by this CLI command –

> akonadictl vacuum

Thanks for your reply.

I tried all of the akonadictl commands, vacuum, restart… nothing helped.

I think the vacuum needs a lot more suction…

Kind regards
Peter

PS: Okay now for 5 days

I had same issue, but with collection “trash” and other resourceID (5), but I solved it without to delete a lot of files. I followed these steps (assisted by DuckDuckGo’s AI chat; GPT4o-mini):

  • Open akonadiconsole (it will probably be necessary to install it)
  • In the “DB Explorer” tab (the fifth tab…I don’t know its name/label in English because I have my GUI in Spanish), select the table resourcetable and check for the resource with id reported in the error dialog (in my case, the resourceId “5”; in the case of @PedroSMS , it should be “14”). I did this to figure out what resource had the issue; it were akonadi_maildir_resource_0, that is my “Local folders” resource.
  • Then, select the table collectiontable and look up for records with resourceId = 5, just to verify that resource had a related collection named “trash”
  • Finally, in the tab Explorer or Collections (the second tab) look up for “trash” collection/folder of the affected resource (in my case “Local folders”) and delete it
  • It’s done: try again to open Kmail. The deleted collection will be re-created

Deleting the collection:
image

1 Like

Was afflicted by the same error msg in Debian Trixie. Luckily, a reboot appears to have resolved the issue this time around