Kmail crashes on start

Then, Akonadi ain’t running.

  • Akonadi auto-starts at login if, and only if, no Akonadi-enabled applications are launched at login.
  • For example, the Digital Clock Plasmoid will start Akonadi if, the display of Calendar (Kalender) events is enabled.

<https://userbase.kde.org/Akonadi&gt;

Check the current status of Akonadi with “akonadictl status” and “akonadictl instances” – CLI help with (simply) “akonadictl”.

ooops, I hope I wasn’t to fast here. I just started akonadi with

akonadictl start 

and then did a


delete from pimitemtable where remoteid is NULL;

in Mysql console, wich deleted about 8000 entries. Kmail still crashes on start.

Further info you requested:


user@linux-5ywc:/home/user> akonadictl status
Akonadi Control: running
Akonadi Server: running
Akonadi Server Search Support: available (Remote Search, Akonadi Search Plugin)
Available Agent Types: akonadi_akonotes_resource, akonadi_archivemail_agent, akonadi_birthdays_resource, akonadi_contacts_resource, akonadi_davgroupware_resource, akonadi_ews_resource, akonadi_ewsmta_resource, akonadi_facebook_resource, akonadi_followupreminder_agent, akonadi_googlecalendar_resource, akonadi_googlecontacts_resource, akonadi_ical_resource, akonadi_icaldir_resource, akonadi_imap_resource, akonadi_indexing_agent, akonadi_invitations_agent, akonadi_kalarm_dir_resource, akonadi_kalarm_resource, akonadi_knut_resource, akonadi_kolab_resource, akonadi_maildir_resource, akonadi_maildispatcher_agent, akonadi_mailfilter_agent, akonadi_mbox_resource, akonadi_migration_agent, akonadi_mixedmaildir_resource, akonadi_newmailnotifier_agent, akonadi_notes_resource, akonadi_openxchange_resource, akonadi_pop3_resource, akonadi_sendlater_agent, akonadi_tomboynotes_resource, akonadi_unifiedmailbox_agent, akonadi_vcard_resource, akonadi_vcarddir_resource

and


user@linux-5ywc:/home/user> akonadictl instances
(default) (running)

@seb234:

After cleaning the MySQL database, you must run “akonadictl fsck” and then, “akonadictl vacuum” and then, “akonadictl fsck” (again).

okay, did so. result of last command here:


user@linux-5ywc:/run/user/1000> akonadictl fsck  
Looking for resources in the DB not matching a configured resource...
Looking for collections not belonging to a valid resource...
Checking collection tree consistency...
Looking for items not belonging to a valid collection...
Looking for item parts not belonging to a valid item...
Looking for item flags not belonging to a valid item...
Looking for overlapping external parts...
Verifying external parts...
Found 3 external files.
Found 3 external parts.
Found no unreferenced external files.
Checking size treshold changes...
Found 0 parts to be moved to external files
Found 0 parts to be moved to database
Looking for dirty objects...
Collection "Search" (id: 1) has no RID.
Collection "outbox" (id: 10) has no RID.
Collection "sent-mail" (id: 11) has no RID.
Collection "OpenInvitations" (id: 18) has no RID.
Collection "DeclinedInvitations" (id: 19) has no RID.
Found 5 collections without RID.
Found 0 items without RID.
Found 0 dirty items.
Looking for rid-duplicates not matching the content mime-type of the parent collection
Checking Lokale Ordner
Checking Persönliches Adressbuch
Checking Search
Checking akonadi_ical_resource_0
Checking DeclinedInvitations
Checking OpenInvitations
Checking drafts
Checking inbox
Checking outbox
Checking sent-mail
Checking templates
Checking trash
Checking inbox
Migrating parts to new cache hierarchy...
Checking search index consistency...
Skipping virtual Collection 1
Checking Collection 9 search index...
Checking Collection 10 search index...
Checking Collection 11 search index...
Checking Collection 12 search index...
Checking Collection 13 search index...
Checking Collection 14 search index...
Checking Collection 15 search index...
Checking Collection 16 search index...
Skipping virtual Collection 18
Skipping virtual Collection 19
Checking Collection 20 search index...
Checking Collection 21 search index...
Flushing collection statistics memory cache...
Consistency check done.



restarted akonadi on command line. Kmail still crashes on start.

maybe just reinstall and import old backup and then import archived mails? But thats quiet a hassle because old folder structure ist a mess. I rearranged recently and didn’t do a complete backup, only archived mails.

Or any other suggestions?

Yes, you have one other option here, but it will need checking f.e. the location of Sent mail, Drafts etc per account. The crashes come from database corruption AFAICS. Your POP mail should all be in ~/.local/share/local-mail, the IMAP mail should still be on the server, so rebuilding the database would be your best shot. To do that:


akonadictl stop
mkdir ~/akonadi.saved
mv ~/.local/share/akonadi* ~/akonadi.saved
akonadictl start

Now be patient, and wait for akonadi to rebuild the database. Once it’s finished check the things mentioned above. This depends on your previous preferences. I know some people use Local Folders - Sent for their outgoing mails, I prefer them in the IMAP account’s Sent box. Since in a new database these folders get new ID’s in the database, your current settings won’t match no longer and Kmail will use it’s defaults, i.e. Local Folders … Same goes for the filters,if any.

EDIT: You can start Kmail btw. It should not crash anymore.

Something is weird. You got 2 inbox folders. Does akonadiconsole work?

How do I check them?

Again, how do I?

I did rebuild the database as you suggested. I hope I did it right. Started kmail after akonadi job seemd finished. The kmail window opened an did not crash right away. I saw all folders were empty. When I clicked the inbox folder, magically it started to fill with mail. Then all of a sudden kmail crashed again. What was wrong?

I had a redundant folder structure. Maybe therer were two inboxes, one in “Local Folders”, one in “Lokale Ordner” or so. Cant remember.
What is akonadiconsole?


user@linux-5ywc:~/.local/share> akonadiconsole
Wenn 'akonadiconsole' kein Tippfehler ist, können Sie command-not-found benutzen, um das Paket zu finden, das den Befehl enthält, z. B.:
    cnf akonadiconsole

Without output I can’t even guess. At least we know now that the selected folder was syncing. Does Kmail crash if you start it again?

It could very well be that akonadi only actually starts syncing the accounts after Kmail starts. Try this

  • Open Kmail
  • Go Settings - Configure Kmail - Accounts - Click an account - Click restart, repeat this for every account.

In the same area you can find the other account settings I mentioned. Check the Identities - Receive - Send configurations.

You can also sync the accounts through akonadiconsole - Browser. Right click the top level folder, syncronize recursively. When they’re all done, try Kmail again.

Yes it crashes again.

When I start it, now the window stays open. When I clicked on the folder “trash” it filles with mails. When I clicked on the “Inbox” Folder it crashed.

Here’s the output:


user@linux-5ywc:~/.local/share> kmail
org.kde.pim.akonadiserver: Subscriber "" disconnected
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc1401c7680) )
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc1401c7680) )
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc140011d20) )
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc140027400) )
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc1401cfff0) )
No text-to-speech plug-ins were found.
org.kde.pim.akonadiserver: Subscriber "" disconnected
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc1401cfff0) )
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc140158cb0) )
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc140011d20) identified as "SpecialCollectionsMonitor - 94203361417648"
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc1401c7680) identified as "KMail Kernel ETM - 94203361521312"
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc140027400) identified as "MessageListTagMonitor - 94203363510224"
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc1401cfff0) identified as "MessageViewerMonitor - 94203361646016"
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc1401cfff0) identified as "MessageViewerMonitor - 94203361646016"
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc140158cb0) identified as "TagActionManagerMonitor - 94203365976592"
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc0d83dbe70) )
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc0d83dbe70) identified as "FilterManagerTagMonitor - 94203364127472"
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fc1401d32b0) )
org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fc1401d32b0) identified as "MessageListTagCacheMonitor - 140060896811248"
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0c401f560 finished
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0b807a8f0 finished
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0b80dbba0 finished
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0b8093c50 finished
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0b8072bd0 finished
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0b8086400 finished
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'f0f0f0'
QTextHtmlParser::applyAttributes: Unknown color name 'f0f0f0'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name '#FEDED0;
                                                                                                                                        '
QFont::setPixelSize: Pixel size <= 0 (0)
QFont::setPixelSize: Pixel size <= 0 (0)
QTextHtmlParser::applyAttributes: Unknown color name '#FEDED0;
                                                                                                                                        '
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'f0f0f0'
QTextHtmlParser::applyAttributes: Unknown color name 'f0f0f0'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name 'e6ebf1'
QTextHtmlParser::applyAttributes: Unknown color name '#FEDED0;
                                                                                                                                        '
QFont::setPixelSize: Pixel size <= 0 (0)
QFont::setPixelSize: Pixel size <= 0 (0)
QTextHtmlParser::applyAttributes: Unknown color name '#FEDED0;
                                                                                                                                        '
org.kde.pim.akonadiserver: ItemRetrievalJob for request 0x7fc0f80530c0 finished
Syntax Warning: Unable to set decoder parameters
*** KMail got signal 11 (Exiting)
*** Dead letters dumped.
/tmp/messageviewer_K18555.index.2 was removed .
/tmp/messageviewer_z18555.index.3 was removed .
QSocketNotifier: Invalid socket 9 and type 'Read', disabling...
QSocketNotifier: Invalid socket 13 and type 'Read', disabling...
QSocketNotifier: Invalid socket 23 and type 'Read', disabling...
QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
QSocketNotifier: Invalid socket 16 and type 'Read', disabling...
KCrash: Application 'kmail' crashing...
KCrash: Attempting to start /usr/lib64/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0
org.kde.pim.akonadiserver: Subscriber "KMail Kernel ETM - 94203361521312" disconnected
org.kde.pim.akonadiserver: Subscriber "MessageListTagMonitor - 94203363510224" disconnected
org.kde.pim.akonadiserver: Subscriber "TagActionManagerMonitor - 94203365976592" disconnected
org.kde.pim.akonadiserver: Subscriber "MessageListTagCacheMonitor - 140060896811248" disconnected
org.kde.pim.akonadiserver: Subscriber "SpecialCollectionsMonitor - 94203361417648" disconnected
org.kde.pim.akonadiserver: Subscriber "FilterManagerTagMonitor - 94203364127472" disconnected
org.kde.pim.akonadiserver: Subscriber "MessageViewerMonitor - 94203361646016" disconnected

[1]+  Angehalten              kmail



I did all that. When I clicked on the inbox folder, kmail crashes.

btw: I have an Inbox folder in the Inbox folder. All mails are in the parent Inbox folder. Thats where I direct all mails to in the account settings you mentioned.

installed aknadiconsole. Did all what you mentioned. Didn’t help either. When I clic on the Infolder kmail crashes.

Show your inboxes:

karl@erlangen:~> find -name inbox
./.local/share/local-mail/inbox
karl@erlangen:~> 

For each of your inboxes show the subfolders:

karl@erlangen:~> find ./.local/share/local-mail/inbox -type d
./.local/share/local-mail/inbox
./.local/share/local-mail/inbox/tmp
./.local/share/local-mail/inbox/new
./.local/share/local-mail/inbox/cur
karl@erlangen:~> 

Move or delete one of them.


user@linux-5ywc:~/.local/share/local-mail/inbox> ls -la
insgesamt 236
drwxr-xr-x  5 user users   4096 11. Nov 19:00 .
drwxr-xr-x 12 user users   4096 26. Mär 21:24 ..
drwxr-xr-x  2 user users 135168 25. Mär 19:12 cur
drwxr-xr-x  2 user users  86016 21. Feb 13:23 new
drwxr-xr-x  2 user users   4096 21. Feb 13:23 tmp


user@linux-5ywc:~/.local/share/local-mail/.inbox.directory/inbox> ls -la
insgesamt 936
drwxr-xr-x 5 user users   4096 11. Nov 19:12 .
drwxr-xr-x 3 user users   4096 11. Nov 19:12 ..
drwxr-xr-x 2 user users 491520 12. Nov 10:39 cur
drwxr-xr-x 2 user users 450560 12. Nov 10:39 new
drwxr-xr-x 2 user users   4096 12. Nov 10:30 tmp


user@linux-5ywc:~/.local/share/Trash/files/akonadi_maildir_resource_0_schrott_alt/inbox> ls -la
insgesamt 476
drwxr-xr-x 5 user users   4096 14. Okt 13:33 .
drwxr-xr-x 8 user users   4096 14. Okt 19:48 ..
drwxr-xr-x 2 user users   4096  8. Nov 17:22 cur
drwxr-xr-x 2 user users 466944  8. Nov 17:22 new
drwxr-xr-x 2 user users   4096  8. Nov 16:57 tmp

Is that what you meant?

Wouldn’t it be the best to erase the whole Email system and set it up again, import the entire pim backup from 2019 that I have and then import the latest mails from the archived mails backup from March 2020 that I made bevor kmail crached?

Well okay, I try and delete one inbox, why not! I’ll delete the
~/.local/share/local-mail/inbox

because ist the “smalest”. I’ll keep the
~/.local/share/local-mail/.inbox.directory/inbox

as it seems to contain more emails. What do you think?

Do I have to run any additional operations afterwards like vacuuming or so?

I would keep ~/.local/share/local-mail/inbox and move ~/.local/share/local-mail/.inbox.directory to ~/somewhere/.inbox.directory. Standard folders are:

4       ./drafts/tmp
4       ./drafts/new
4       ./drafts/cur
16      ./drafts
4       ./templates/tmp
4       ./templates/new
4       ./templates/cur
16      ./templates
4       ./inbox/tmp
4       ./inbox/new
16      ./inbox/cur
28      ./inbox
4       ./sent-mail/tmp
4       ./sent-mail/new
4       ./sent-mail/cur
16      ./sent-mail
4       ./outbox/tmp
4       ./outbox/new
4       ./outbox/cur
16      ./outbox
4       ./trash/tmp
4       ./trash/new
4       ./trash/cur
16      ./trash
112     .

Don’t use these standard names twice. Then run ‘akonadi fsck’ and others as above.