Problems with KMAIL

I recently (last week) upgraded my system from SUSE 13.1 to Tumbleweed. I had major trouble with getting this version of OpenSuse working at all, so I’ve re-installed / upgraded the Tumbleweed packages several times already. Right now my base system appears to be stable; I’ve re-booted it three times in the past 24 hours and it came up OK every time (previously big problems appeared the first or second time I tried to boot from my hard disk). I have been using OpenSuse and KMAIL since 2002 (release 9.0). My current installation is KMAIL 5.6.1, with libraries KDE Frameworks 5.38.0, Qt 5.9.1, and the xcb windowing system (from Help >> About KMAIL).

I have several problems with this version of KMAIL. I’ll introduce all of them here; let me know if you think I should open additional threads, to address one or more of these separately.

  1. KMAIL fails to launch from the Application Launcher. This is an intermittent problem. Usually KMAIL will start the first time I launch it after a re-boot. If I close it down, then want to restart it, I have to issue a “kmail” command from a Konsole session. This problem was present the first time I installed Tumbleweed, and it’s persistent.

  2. When it does launch from the Application Launcher, it starts with a “compose new message” window, not the main KMAIL window. I can get the main window open by hitting “Settings” then “Configure KMail” in the “compose new message” window. This problem did not show up the very first time I installed Tumbleweed, but I’m not certain I had any trouble with the App Launcher that day.

  3. Most of my saved messages cannot be viewed in KMAIL. I’ve been using this program for 15 years, so I have a lot of old messages. The messages are still there (I can find them with DOLPHIN and KATE, and the message counts display when I hover over them in the KMail Folders tree on the left). But if I select a folder, nothing displays in the Message List window at the top. The only folder that appears to work is Inbox (I can see those messages). This is a more recent problem – it just showed up yesterday.

  4. Most of the “Messages” functions won’t work. For instance, if I open a message in my Inbox and try to move it somewhere else, nothing happens. Yesterday I got a couple of error messages “Resource KMAIL is broken” when I tried to do this, Today I don’t get the error message; KMAIL says “message moved to trash”, but the message remains in the Inbox folder. Again, this is a newer problem that I first noticed yesterday.

  5. There’s a bug in the Suse Help Center Table of Contents. Under “Internet” there are four instances of “Kmail”. Only one of them is active. (This is probably a bug in the distro for the Help Center. The very next item, “KNetAttach”, appears twice, but both of those have contents.)

I suspect my problems originate in “AKONADI”, the database manager for KMAIL. Is there some way to shut AKONADI down and/or restart it without invoking KMAIL?

Well, sorry to present such a long list of problems. I think I’ll archive all my current folders, etc. using PIM Setting Exporter before I try any more experiments with KMAIL.

Any help or advice is welcome. Thanks!

akonadictl [stop|start|restart|status|fsck|vacuum]

How exactly did you upgrade?
Can you show us your repos

zypper lr -d

I’ve done the full install of Tumbleweed about four or five times. I cut the 4.7 GiB DVD and ran the hash sum total on it. It checked out OK that way, but when I boot from that disk I get a lot of error messages, and the whole thing eventually locks up as tight as a drum. So I’ve been using the Network installer every time.

There were three times when my system died and I just used the Upgrade function on the network installer DVD to recover … those mini-installs typically picked up about 50 - 100 changes, plus a new copy of the kernel and a re-intallation of GRUB2. I haven’t had a stable system running long enough to actually do any sort of controlled upgrade; I did a full re-install yesterday, and the software update module in systray says my system is up to date (last checked 5 hours ago).

Here’s the output you asked for.


zypper lr -d
Repository priorities are without effect. All enabled repositories share the same priority.

# | Alias                            | Name                       | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                      | Service
--+----------------------------------+----------------------------+---------+-----------+---------+----------+--------+----------------------------------------------------------+--------
1 | download.opensuse.org-non-oss    | Main Repository (NON-OSS)  | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/non-oss/    |        
2 | download.opensuse.org-oss        | Main Repository (OSS)      | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/oss/        |        
3 | download.opensuse.org-tumbleweed | Main Update Repository     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/tumbleweed/          |        
4 | openSUSE-20171001-0              | openSUSE-20171001-0        | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/oss/        |        
5 | repo-debug                       | openSUSE-Tumbleweed-Debug  | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/  |        
6 | repo-source                      | openSUSE-Tumbleweed-Source | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/ |

Thanks for the tip on akonadictl. I’ll post some output from that command when I obtain it.

Ok. I tried running “fsck”, so far without luck. But I figured some information is better than none. Here’s what akonadictl says when it starts.


david@localhost:~> akonadictl start
david@localhost:~> Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
akonadi.collectionattributetable                   OK
akonadi.collectionmimetyperelation                 OK
akonadi.collectionpimitemrelation                  OK
akonadi.collectiontable                            OK
akonadi.flagtable                                  OK
akonadi.mimetypetable                              OK
akonadi.parttable                                  OK
akonadi.parttypetable                              OK
akonadi.pimitemflagrelation                        OK
akonadi.pimitemtable                               OK
akonadi.pimitemtagrelation                         OK
akonadi.relationtable                              OK
akonadi.relationtypetable                          OK
akonadi.resourcetable                              OK
akonadi.schemaversiontable                         OK
akonadi.tagattributetable                          OK
akonadi.tagremoteidresourcerelationtable           OK
akonadi.tagtable                                   OK
akonadi.tagtypetable                               OK
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
QDBusConnection: name 'org.freedesktop.Akonadi.Control' had owner '' but we thought it was ':1.41'
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.maildispatcher: Failed to get outbox folder. Retrying in:  5000
org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
log_mixedmaildir: Akonadi fetch got 0 items
log_mixedmaildir: of which 0 have remoteId
log_mixedmaildir: Maildir  "/home/david/.kde4/share/apps/kmail/mail/outbox" "cur" directory newer than the index: cur modified at QDateTime(2017-04-08 07:28:31.000 CDT Qt::TimeSpec(LocalTime)) , index modified at QDateTime(2014-06-14 20:14:50.000 CDT Qt::TimeSpec(LocalTime))
log_mixedmaildirresource: storeList->error= 0
log_mixedmaildir: Store fetch got 0 items of which 0 are new and 0 are changed and 0 need to be removed
log_mixedmaildir: 0 items marked as Deleted
org.kde.akonadi.ETM: GEN true false false
org.kde.akonadi.ETM: collection: QVector()
org.kde.akonadi.ETM: 
org.kde.akonadi.ETM: Subtree:  1 QSet(1, 43)
org.kde.akonadi.ETM: Subtree:  10 QSet(18, 21, 49, 20, 48, 23, 22, 50, 25, 24, 27, 26, 29, 28, 31, 30, 33, 32, 35, 34, 11, 10, 13, 41, 12, 15, 14, 42, 45, 44, 47, 46, 17, 16, 19)
org.kde.akonadi.ETM: Fetch job took  255 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 37
org.kde.akonadi.ETM: first fetched collection: "Search"
org.kde.akonadi.ETM: Fetch job took  279 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 6
org.kde.akonadi.ETM: first fetched collection: "Search"
org.kde.akonadi.ETM: GEN true false false
org.kde.akonadi.ETM: collection: QVector()
org.kde.akonadi.ETM: 
org.kde.akonadi.ETM: Subtree:  1 QSet(1, 43)
org.kde.akonadi.ETM: Subtree:  10 QSet(34, 45, 44, 47, 46, 41, 13, 12, 42, 15, 14, 11, 10, 49, 21, 48, 20, 23, 50, 22, 17, 16, 19, 18, 29, 28, 31, 30, 25, 24, 27, 33, 26, 32, 35)
org.kde.akonadi.ETM: Fetch job took  186 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 37
org.kde.akonadi.ETM: first fetched collection: "Search"
org.kde.akonadi.ETM: Fetch job took  263 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 6
org.kde.akonadi.ETM: first fetched collection: "Search"
org.kde.pim.akonadicore: Failed to open external payload: "/home/david/.local/share/akonadi/file_db_data/21/95121_r227334" "No such file or directory"
Tokenizer Warning: unknown time zone: " "Central" "
Tokenizer Warning: unknown time zone: " "CDT" "
Tokenizer Warning: trailing garbage after dot-atom in header allowing only a single dot-atom! 

Tokenizer Warning: trailing garbage after dot-atom in header allowing only a single dot-atom! 

I’ll post something about “fsck” when I get that to work. Oh, yeah. I re-booted the system (to force some printer software to display in the systray) and ran the above command immediately after the system came up. Then I started KMAIL. I didn’t get the new message window, and now I can view e-mail messages in both my Inbox and in my Sent Mail folders … previously “Sent Mail” would not display. None of my other mail folders work correctly. If I click on one of those, I just get the wheel of life (death?) turning and turning … Also, I can download new messages from the POP3 server, but they seem to be glued to the “Inbox” folder – if I gve the order “move to trash” KMAIL says “Move selected messages to Trash” and then “Messages moved to Trash”. But the message remains in Inbox, and the Trash folder remains unaltered.

IMO

At some point you will have to evaluate whether your problems are related to general instability or application specific.

If you think it’s general system instability, then you may need to either restore your original system and upgrade again (You’ll also need to describe your upgrade procedure if you want to ask for help related to this).

Or, make plans for a hybrid “new TW install” but attempting to preserve your personal files and data (New TW install but retain your /home).

If you think your’re experiencing application specific problems, then those need to be looked at on an application by application basis. So, for instance I wouldn’t know for sure that your Kmail will upgrade smoothly on its own. You may need to export your mail and contacts, then re-import into new Kmail app. The same would likely be necessary for any other apps that use a database of any type.

IMO,
TSU

Well, I think I understand that. I only mentioned the other problems I have had because upgrading to Tumbleweed has been such a struggle. It’s now been two whole days, and I’ve re-booted the system six or seven times with no trouble. (I’m accustomed to re-booting Linux once every couple of weeks. But when I’m installing a new version I have a lot of little tweaks to make, and some of those require a reboot.)

All of my upgrades have been performed using an .iso network install disk (E-Tumbleweed-NET-i586-Snapshot20172709-Media.iso) I downloaded from the OpenSuse site. I was moving up from OpenSuse 13.1; I’ve been performing upgrades since 2002 (release 9.0 was the first one I installed). And yes, my /home and /swap files are in separate partitions, so the installation doesn’t touch that data (or at least, not until say KDE has changed – I see that OpenSuse has moved from kde3 to kde4. So the new install did alter some data on my /home partition – I think it renamed /home/.kde3/… to /home/.kde4/…, and made some other little tweaks in there.)

FWIW, KMAIL was working fine when I first upgraded to Tumbleweed (8 days ago, on September 27). And it continued to work OK until the day before yesterday, when something broke in akonadi, I think. I’ll post more more about that in a little bit. Oh yeah – I’ve already tried to export my data. No luck. The PIMExporter (which is new to me – it did not exist in 13.1) relies on akonadi to identify all the data. I let it run for an hour, then closed it. The resulting “settings” archive looks OK, but the “messages” archive is 70 bytes long. I’ve got a few hundred MB of old e-mails – data compression algorithms are good, but they’re not that good. <g>

Thanks for the input, Flux Capacitor. :shame:

OK, I have some o/p from the fsck function. There’s quite a bit of it.


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 7181 external files.
Cleaning up missing external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r137862 for item: 22658 on part: 95121
Found 7178 external parts.
Found unreferenced external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r137825
Found unreferenced external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r137826
Found unreferenced external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r265089
Moved 3 unreferenced files to lost+found.
Checking size treshold changes...
Found 51 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.
Found 1 collections without RID.
Item "8965" has no RID.
Item "9573" has no RID.
Item "9903" has no RID.
Item "10964" has no RID.
Item "13156" has no RID.
Item "14125" has no RID.
Item "15178" has no RID.
Item "16199" has no RID.
Item "17333" has no RID.
Item "18232" has no RID.
Item "18965" has no RID.
Item "19306" has no RID.
Item "19399" has no RID.
Item "19912" has no RID.
Item "20687" has no RID.
Item "21143" has no RID.
Item "21963" has no RID.
Item "26814" has no RID.
Item "27876" has no RID.
Item "28151" has no RID.
Item "28896" has no RID.
Item "30260" has no RID.
Item "30734" has no RID.
Item "31961" has no RID.
Item "32122" has no RID.
Item "32237" has no RID.
Item "34224" has no RID.
Item "34244" has no RID.
Item "34349" has no RID.
Item "34448" has no RID.
Item "34618" has no RID.
Item "34643" has no RID.
Item "34649" has no RID.
Item "34655" has no RID.
Item "34711" has no RID.
Item "34943" has no RID.
Item "35092" has no RID.
Item "35099" has no RID.
Item "35191" has no RID.
Item "35197" has no RID.
Item "35198" has no RID.
Found 41 items without RID.
Found 0 dirty items.
Looking for rid-duplicates not matching the content mime-type of the parent collection
Checking Birthdays & Anniversaries
Checking KMail Folders
Checking Notes
Checking Personal
Checking Search
Checking akonadi_ical_resource_0
Checking Last Search
Checking New Saved Messages
Checking drafts
Checking inbox
Checking outbox
Checking sent-mail
Checking templates
Checking trash
Checking Kathryn Backup
Checking Toni
Checking spam
Checking Amazon
Checking Ameritrade
Checking Austrian
Checking Billspaid
Checking Breakfast
Checking Caltech
Checking Climate
Checking David
Checking Eden Ranch
Checking GERIS
Checking HomeDepot
Checking Insurance
Checking Vendors
Checking WSJ
Checking WellsFargo
Checking TPML
Checking IPad
Checking old-sent
Checking spam
Checking Friends
Checking TaxAide
Checking TaxYear2014
Checking TaxYear2015
Checking TaxYear2016
Migrating parts to new cache hierarchy...
Checking search index consistency...
Skipping virtual Collection 1
Checking Collection 8 search index...
Checking Collection 10 search index...
Checking Collection 11 search index...
Checking Collection 12 search index...
Collection 12 search index contains 1 orphan items. Scheduling reindexing
Checking Collection 13 search index...
Checking Collection 14 search index...
Checking Collection 15 search index...
Checking Collection 16 search index...
Checking Collection 17 search index...
Checking Collection 18 search index...
Checking Collection 19 search index...
Checking Collection 20 search index...
Checking Collection 21 search index...
Checking Collection 22 search index...
Checking Collection 23 search index...
Checking Collection 24 search index...
Checking Collection 25 search index...
Checking Collection 26 search index...
Checking Collection 27 search index...
Checking Collection 28 search index...
Checking Collection 29 search index...
Checking Collection 30 search index...
Checking Collection 31 search index...
Checking Collection 32 search index...
Checking Collection 33 search index...
Checking Collection 34 search index...
Checking Collection 35 search index...
Checking Collection 37 search index...
Checking Collection 38 search index...
Checking Collection 41 search index...
Checking Collection 42 search index...
Skipping virtual Collection 43
Checking Collection 44 search index...
Checking Collection 45 search index...
Checking Collection 46 search index...
Checking Collection 47 search index...
Checking Collection 48 search index...
Checking Collection 49 search index...
Checking Collection 50 search index...
Checking Collection 51 search index...
Flushing collection statistics memory cache...
Consistency check done.

I’ve subsequently re-executed the fsck, and I notice that one error recurs.

From 10/04 (yesterday)


Cleaning up missing external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r265086 for item: 22658 on part: 95121

From 10/05 (today)


Cleaning up missing external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r137862 for item: 22658 on part: 95121

I remembered something else, from the “akonadictl start” output:


org.kde.pim.akonadicore: Failed to open external payload: "/home/david/.local/share/akonadi/file_db_data/21/95121_r227334" "No such file or directory"

So I went poking around in directory /home/david/.local/share/akonadi/file_db_data/21/ with Dolphin and I noticed something pretty strange.

  1. All the other files in the directory have names like nnnnn_r0.
  2. There were three files named “95121_rxxx” – “95121_r137902” and two others whose names kept changing from like “95121_r175777” to “95121_r175778”. All three of these are the same size: 4.5 KB. And when I stopped akonadi with a command, two files remained. They’re exactly the same (an e-mail message from about a year ago that I had saved in my “Caltech” folder).

So it looks to me as if there’s some sort of glitch relating to this part 95121. Akonadi is trying to fix it by creating and deleting thousands of copies of this one file. Any ideas about how to stop that from happening? I’m tempted to track down the offending message and delete it. But I also notice that there’s an index file of some sort (not a text file) associated with my “Caltech” folder. Will I mess that up somehow if I delete one e-mail? It’s worth a try, I suppose.

Thanks for helping me pinpoint this problem, guys. More suggestions will be appreciated. Oh – I bet the continuous rewriting of this particular file is slowing my system down quite a lot. Akonadi ought not be doing I/O all the time, methinks.

Thanks again for the help! KMAIL is back up and seems to be running fine. I went ahead and deleted the offending e-mail message (after making a backup copy, of course). I did get an odd error message about the deleted file when I restarted akonadi, so I ran the fsck again. I got this error message:


Found 7180 external files.
Found 7179 external parts.
Found unreferenced external file: /home/david/.local/share/akonadi/file_db_data/21/95121_r137902
Moved 1 unreferenced files to lost+found.

The rest of it looked clean, so I started KMAIL, and it seems to be working fine again. Thanks ever so much!

I guess I crowed too soon. KMAIL seems to be working much better now – I can find all my old e-mail messages. And I was able to use PIMSetting Exporter to create a .zip archive that contains all my old e-mails. However, I still can’t delete a message (“move to trash” says it did the job, but it didn’t). Interestingly, I can empty the trash folder – that function works. But if I try to move from one folder to another, no soap. KMAIL claims it did what I asked, but the folders remain unaltered.

I also noticed that my address book is on the fritz. Same underlying problem in"akonadi", I suppose.

Any other ideas? Recommendations for a different e-mail client? Thanks!

I use Thunderbird pretty painless for me.

General rule of thumb when recovering any kind of database…

As soon as you can read the data, do not hesitate to export the data,
Then remove the original database,
Create a brand new, empty database,
Import the data.

Once a database is broken, it will forever be unreliable so you need to create the new database.

The orphaned file fragments you describe are also worrisome, that means you probably have broken files… And depending on what those files might be determines what will be broken (always hope nothing too major).

Install smartmon tools and verify your disk health.

IMO,
TSU

I have used Thunderbird a little bit, in the past. And I re-installed it a few days ago, because KMAIL was giving me so much trouble.

The main thing that bugged me about Thunderbird was its reliance on the “mbox” format for mail folders. I see that now they also support “maildir”, which I like better – in case I want to handle one e-mail message as a text file (which I do, once in a while), maildir saves me a lot of time as compared to mbox. Have you tried maildir in Thunderbird? Does it work OK?