I experienced several times an error about a key in the database already existing upon deletion and creation of the same collection. Browsing the database in akonadi console, it turns out that (at least sometimes) when a collection (i.e. an entry in collectiontable) is deleted, its corresponding entries in collectionmimetyperelation are not. Deleting those entries solves the issue. I have experienced this for a DAV resource. Note that I'm unsure if this behavior is systematic or not. Reproducible: Sometimes Steps to Reproduce: 1. Delete a collection 2. Recreate the collection
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present? If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.