This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kmail and the "retrieving folder contents please wait" error

Tags: None
(comma "," separated)
therealsteelskin
Registered Member
Posts
10
Karma
0
OS
Thought I would post this information as it may be useful to somebody.

This concerns kmail and the "retrieving folder contents please wait" placeholder message you get when clicking on an email, what appears to have triggered the error and ultimately how I recovered from the error. I'm also posting this information because I had a lot of trouble finding anything detailed about how to fix the problem.

First a little background info, I'm running KDE Neon 5.8LTS, plasma version 5.8.7, KDE frameworks 5.38.0, QT 5.7.1, kernel 4.10.0-33-generic with the NVIDIA 375.82 driver.

So last night I saw that discover was reporting that there were 300+ updates I needed to install. So I installed them and rebooted, all well and good, or so I thought. About two hours later I went into kmail to do some work and clicked on an email to find I got the infamous "retrieving folder contents please wait" placeholder message instead of my email. I tried all the usual, ie akonadi stop, akonadi start, reboot, nothing got rid of the problem.

Checking the /var/log/apt/history.log | grep mysql I found that akonadi-backend-mysql:amd64 (4:17.08.0-0neon+16.04+xenial+build19, 4:17.08.1-0neon+16.04+xenial+build20) had been updated, infact all of the akonadi software had been updated. Anyway, it may have been coincidence but this update may have triggered my kmail problem.

Looking in ~/.local/share/akonadi/db_data/mysql.err I found the following errors.
170915 0:46:58 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
170915 0:46:58 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
170915 0:46:58 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_host_by_event_name' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
..
.. cut to make it more readable
..
170915 0:46:58 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure
170915 0:46:58 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure
170915 0:46:58 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
170915 0:46:58 [Note] Reading of all Master_info entries succeded
170915 0:46:58 [Note] Added new Master_info '' to hash table
170915 0:46:58 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.31-MariaDB-0ubuntu0.16.04.2' socket: '/tmp/akonadi-nick.R5c8TJ/mysql.socket' port: 0 Ubuntu 16.04
2017-09-15 00:46:58 7fe2fc6de700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
170915 0:52:39 [Warning] Aborted connection 5 to db: 'akonadi' user: 'nick' host: '' (Got an error reading communication packets)
170915 8:30:23 [Note] /usr/sbin/mysqld: Normal shutdown


Looking back at mysql.err.old and mysql.err.old.01 these 'native table 'performance_schema' go back at least three months which is probably when I installed KDE Neon. So as they went back that far they probably weren't causing the current problem. Further investigation on the mysql website indicated that possibly mysql_upgrade needed to be run to fix that error .. however I didn't go down that route.

Fixing the "retrieving folder contents please wait" placeholder message
Instead I did the following, exited kmail, stopped akonadi and then backed up ~/.local/share/akonadi/ (about 1.7GB in my case)
Code: Select all
[Exit kmail]
 akonadi stop
 mv ~/.local/share/akonadi/ ~/.local/share/akonadi.backup
 akonadi start


Over the next couple of hours (I've got close to 100,000 emails on my laptop going back decades) akonadi recreated ~/.local/share/akonadi/ and repopulated it's database with my emails stored in a local folder. This fixed the "retrieving folder contents please wait" placeholder message. Any folders you have created in kmail are retained however ..

Fixing the Destination Folders in Kmails Filters, Accounts Receiving and Sending
However I now found that new emails were not appearing in my inbox folder and sent emails were not appearing in my sent folder. In addition I had 2 filters setup and these were moving emails into the wrong folders. This is an easy fix ..

You will need to correct the destination folders in any filters you created in kmail as they are now probably pointing to the wrong folders. In kmail [Settings]>[Configure Filters] and if the filter uses a 'move into folder' action, check it's moving to the correct folder.

This also applies to any account destination folders, ie my gmail pop3 account was saving into a zoneminder folder I'd created. In kmail, [Settings]>[Configure Kmail]>[Accounts]>[Receiving Tab] click on your account, click [modify], then click on the [Adbvanced] tab, check destination folder field. Mine should have been Local Folders/inbox

And also each identity in kmail [Settings]>[Configure Kmail]>[Identities]>select the identity then click [Modify] click on your account, then click modify, then click on the [advanced] tab, check destination folder for sent mail folder, drafts folder and templates folder. In my case they should be Local Folders/sent-mail, Local Folders/drafts and Local Folders/templates

This fixes the problem for me or at least until something else upsets akonadi sometime in the future, so although I have no idea what the route cause was other than it suspiciously happened directly after an update of KDE it has fixed the problem for me. I hope this info is useful to somebody and if any devs are reading this I this have the akonadi directory containing that database and it's subdirectories and files if you want me to test anything further.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft