<div dir="ltr"><div><br></div><div>Not a murder-related TV series? Oh... how disappointing...<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 20 Aug 2018 at 22:40, David Faure <<a href="mailto:faure@kde.org">faure@kde.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No, this isn't about a murder-related TV series ;)<br>
<br>
I just had a bug in akonadi where some old emails are not readable when being offline, despite the "Download messages for offline use" option being checked in the IMAP settings.<br>
<br>
Investigation showed this in the logs:<br>
ItemRetrievalJob::start: processing retrieval request for item (1447066) parts: ("HEAD", "RFC822") of resource: "akonadi_imap_resource_2"<br>
ItemRetrievalManager::retrievalJobFinished: ItemRetrievalJob finished for request 0x7f13a41b0550 , error: "Unable to retrieve item from resource: Cannot fetch item in offline mode."<br>
<br>
which leads to this SQL query:<br>
<br>
MariaDB [akonadi]> select pimItemId,partTypeId,datasize,version,storage from parttable where pimItemId=1447066;<br>
+-----------+------------+----------+---------+---------+<br>
| pimItemId | partTypeId | datasize | version | storage |<br>
+-----------+------------+----------+---------+---------+<br>
| 1447066 | 5 | 0 | 1 | 0 | (RFC822) --- why 0??<br>
| 1447066 | 7 | 0 | 1 | 0 | HEAD<br>
| 1447066 | 8 | 765 | 2 | 0 | ENVELOPE<br>
| 1447066 | 11 | 1 | 0 | 0 | MDNStateAttribute<br>
+-----------+------------+----------+---------+---------+<br>
4 rows in set (0.00 sec)<br>
<br>
Comments in last column are mine, obviously. Empty RFC822, that shouldn't happen, should it?<br>
<br>
MariaDB [akonadi]> select pimItemId,partTypeId,datasize,version,storage from parttable where partTypeId=5 AND datasize=0;<br>
shows 3124 rows!!<br>
<br>
What is it that might lead to bodies (RFC822) not being stored in the DB?<br>
<br>
Could this happen when failing to save to ~/.local/share/akonadi/file_db_data/* ?<br>
I had a few "partition full" scenarios lately. Although, hmm, that was the root filesystem, not the home one.<br>
<br>
In any case, apart from the root case, I wonder if we could <br>
1) propagate the error to the user when saving fails, and <br>
2) download all missing bodies next time we're online to ensure that those emails will indeed be readable from an air plane...<br>
<br>
-- <br>
David Faure, <a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>, <a href="http://www.davidfaure.fr" rel="noreferrer" target="_blank">http://www.davidfaure.fr</a><br>
Working on KDE Frameworks 5<br>
<br>
<br>
<br>
</blockquote></div>