[Kde-pim] Collections without remoteId abort imap sync
Volker Krause
vkrause at kde.org
Sat Mar 10 16:26:09 GMT 2012
should be fixed in current master for resources using hierarchical remote ids
(e.g. IMAP, maildir).
regards,
Volker
On Sunday 19 February 2012 11:08:17 David Faure wrote:
> 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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120310/f772c9d0/attachment.sig>
-------------- next part --------------
_______________________________________________
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