KMail and Akonadi throwing thousands of errors

Ingo Klöcker kloecker at kde.org
Wed Sep 8 08:12:46 BST 2021


On Dienstag, 7. September 2021 23:35:26 CEST Bill Gee wrote:
> Thanks for the tips!  I did have to install akonadiconsole, but that
> took only a minute.  Running the two queries ...
> 
>  From the first query I got id=5.  I ran the second query like this:
> 
> 	SELECT * FROM pimitemtable WHERE collectionId=5;
> 
> And got no results.  No rows were returned.

Okay. Then I'm wondering why maildispatcher thinks it needs to retrieve some 
messages. I need to check where else it gets information about emails to send 
from.

> Thunderbird does not use Akonadi, but it does interact with the IMAP
> email account.  I wonder if Thunderbird cleaned up enough stuff so that
> Akonadi was able to get to a sane state.

I don't think that Thunderbird accesses KMail's Local Folders. Thunderbird has 
its own set of local folders.

> In akonadiconsole, I looked in the Browser tab.  The IMAP account shows
> up there with a size of zero.  When I expand it, the various email
> folders appear.  Their size is not zero.  I spot-checked a couple of
> them, and the size they show does not match what Thunderbird shows.
> "Local Folders/Sent Mail", for example, shows 3 items, but Thunderbird
> shows none.  I suspect Akonadi is out of sync.

All folders in Local Folders are stored on your local computer. They are 
independent of the IMAP account. Also, Thunderbird's local folders have 
nothing in common with KMail's local folders.

If the number of messages (Total column in akonadiconsole resp. folder tooltip 
in KMail) in one of your IMAP folders does not match the number of messages 
shown by Thunderbird, then KMail/Akonadi may be out of sync with your IMAP 
account. You can try to re-sync the folder as follows:

Quit KMail (via File->Quit or Ctrl+Q).
Start akonadiconsole and select the Browser tab.
Select the folder you want to re-sync. 
Right-click on the folder and choose Clear Akonadi Cache.
Quit Akonadi Console.
Stop Akonadi by running "akonadictl stop" in a terminal (e.g. Konsole).
Wait a few seconds.
Restart Akonadi with "akonadictl start".
Start KMail and select the folder to trigger a synchronization.

Regards,
Ingo

> On 9/7/21 4:08 PM, Ingo Klöcker wrote:
> > On Dienstag, 7. September 2021 21:50:39 CEST Bill Gee wrote:
> >> There are no messages in the outbox.  Both KMail and Thunderbird show
> >> that.
> > 
> > Okay. I suspected that it wouldn't be that easy.
> > 
> >> The outbox is in "Local Folders", which I think means that it is an MBOX
> >> store.
> > 
> > Actually, it's a maildir-like store, i.e. one file per email.
> > 
> >> When I do a directory on it, I get this:
> >> 
> >> [bgee at main2 ~]$ ll -Ra .local/share/local-mail/outbox/
> >> .local/share/local-mail/outbox/:
> >> total 20
> >> drwxr-xr-x  5 bgee bgee 4096 May 22 13:17 .
> >> drwxr-xr-x 12 bgee bgee 4096 May 23 14:00 ..
> >> drwxr-xr-x  2 bgee bgee 4096 Sep  2 13:47 cur
> >> drwxr-xr-x  2 bgee bgee 4096 Sep  3 05:54 new
> >> drwxr-xr-x  2 bgee bgee 4096 Sep  3 05:54 tmp
> >> 
> >> .local/share/local-mail/outbox/cur:
> >> total 8
> >> drwxr-xr-x 2 bgee bgee 4096 Sep  2 13:47 .
> >> drwxr-xr-x 5 bgee bgee 4096 May 22 13:17 ..
> >> 
> >> .local/share/local-mail/outbox/new:
> >> total 8
> >> drwxr-xr-x 2 bgee bgee 4096 Sep  3 05:54 .
> >> drwxr-xr-x 5 bgee bgee 4096 May 22 13:17 ..
> >> 
> >> .local/share/local-mail/outbox/tmp:
> >> total 8
> >> drwxr-xr-x 2 bgee bgee 4096 Sep  3 05:54 .
> >> drwxr-xr-x 5 bgee bgee 4096 May 22 13:17 ..
> > 
> > Okay. On filesystem-level the outbox folder is also empty. Then the ghost
> > messages probably only exist in KMail's/Akonadi's database. Let's check.
> > 
> > Start akonadiconsole. You may have to install it first.
> > 
> > Select the DB Console tab. In the lower part enter
> > select * from collectiontable where name="outbox";
> > and then execute this query by clicking the button on the right.
> > 
> > In the upper part a table with a single row should be shown. Take note of
> > the number in the first column named "id". That's the ID of the
> > "collection" representing the outbox folder.
> > 
> > Now enter the following query in the lower part (removing the other query)
> > SELECT * FROM pimitemtable WHERE collectionId=<ID>;
> > where you replace <ID> with the ID from the result of the first query.
> > Execute the query.
> > 
> > Does the query yield a result? If yes, do the IDs (in the first column) of
> > the items in the result match the IDs in the error messages, i.e. 10411,
> > 10412, 10413, 10415, 10416, 10417, 10418, 10420, 10421, 10422, 10423?
> > 
> > If yes, then let's try to get rid of those entries in the database. Enter
> > the following query in the lower part
> > DELETE FROM pimitemtable WHERE id=10411;
> > Double check that you have entered the correct ID. Then execute the query.
> > Did this work? If yes, continue with the other IDs from the error
> > messages.
> > 
> > Regards,
> > Ingo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdepim-users/attachments/20210908/c71955b9/attachment.sig>


More information about the kdepim-users mailing list