Akonadi items with duplicate remote ID

David Faure faure at kde.org
Mon Nov 20 09:28:40 GMT 2017


My kolab resource fails to sync a calendar due to a duplicate RID:

Akonadi::Server::AkAppend::parseStream:   ID: 531863 , RID: "1133" , GID: "" , Collection: "Calendar" ( 37 ) 
Akonadi::Server::AkAppend::parseStream:   ID: 586695 , RID: "1133" , GID: "0088faac-2872-4e34-862b-889bd269f678" , Collection: "Calendar" ( 37 ) 

which leads to "Multiple merge candidates, aborting".

I can confirm the duplication with the SQL query
   select * from pimitemtable where remoteId=1133 and collectionId=37;
which indeed shows both.

Now I had the idea of running akonadictl fsck, which said
   Akonadi::Server::StorageJanitor::inform: "Found duplicates 1133"

But that didn't fix anything. Looking at the janitor code, I found this:

           QueryBuilder items(PimItem::tableName(), QueryBuilder::Delete);
            items.addValueCondition(PimItem::remoteIdColumn(), Query::Equals, rid);
            items.addValueCondition(PimItem::mimeTypeIdColumn(), Query::NotIn, contentMimeTypesVariantList);
            if (!items.exec()) {
                inform(QStringLiteral("Error while deleting duplicates ") + items.query().lastError().text());
            }

which only deletes items with a wrong mimetype. In my case, both items have the same mimetype,
application/x-vnd.akonadi.calendar.event, so this query doesn't delete anything.

It seems very weird to me to detect duplication and then only clean it up in one special
case where a mimetype is wrong. Surely fsck should also clean up the case of duplication
with correct mimetypes? No idea how it should pick the item to keep though.

Well, in my case, one has a GID, the other doesn't, I suppose it should delete the one without a GID?
See attached screenshot to see all fields from pimitemtable.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: akonadiconsole.png
Type: image/png
Size: 49457 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20171120/2aad5549/attachment.png>


More information about the kde-pim mailing list