[Kde-pim] Collections without remoteId abort imap sync
David Faure
david.faure at kdab.com
Sun Feb 19 10:08:17 GMT 2012
My IMAP sync has been broken for a long time, due to errors like this one:
Error during executing query "INSERT INTO CollectionTable (remoteId,
remoteRevision, name, parentId, resourceId, cachePolicyInherit) VALUES (:0,
:1, :2, :3, :4, :5)" : "Duplicate entry '960-trainings-old' for key
'CollectionTable_parentAndNameIndex' QMYSQL3: Unable to execute statement"
Volker told me to look for a collection without a remoteId, in the
CollectionTable, and he was right, that's exactly the issue.
id 2551, remoteId empty, remoteRevision empty, name trainings-old, parentId
960 (which is correct), resourceId 22.
Shouldn't akonadiserver detect that and use "UPDATE" when a collection with
this name already exists?
The code in server/src/storage/datastore.cpp thinks otherwise:
247│
248│ /* --- Collection --------------------------------------------------- */
249│ bool DataStore::appendCollection( Collection &collection )
250│ {
251│ // no need to check for already existing collection with the same name,
252│ // a unique index on parent + name prevents that in the database
253├> if ( !collection.insert() )
254│ return false;
255│
256│ mNotificationCollector->collectionAdded( collection );
257│ return true;
258│ }
(This is the insert that fails)
Of course I could just clean up my SQL table from such ghost collections, but
I suppose a proper recovery code path would be more useful for other users in
the same situation who don't have the opportunity of spending a weekend in
Osnabrueck to get such answers about their problems :-)
Any idea how this could happen in the first place, too?
--
David Faure | david.faure at kdab.com | KDE/Qt Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list