KMail tells: "Unable to create persistent search"

Daniel Vrátil dvratil at kde.org
Sun Mar 3 17:37:13 GMT 2019


Hey,

check if you have a Resource with ID 1 in the database, if not, create it:

INSERT INTO ResourceTable (id, name, isVirtual) VALUES (1, 
'akonadi_search_resource', 1);

Then you can create the missing collection:

INSERT INTO CollectionTable (id, name, resourceId, isVirtual) VALUES (1, 
"Search", 1, 1);

That should fix your broken search. Not sure how it went missing...

Dan

On Friday, 1 March 2019 19:42:56 CET Andreas Gungl wrote:
> Hi again,
> 
> just another question to get rid of this problem. After some digging I
> suppose, (":1", QVariant(qlonglong, 1)) means parentId should be 1 when
> inserting the collection with name ((":0", QVariant(QString, "Letzte
>  Suche")).
> 
> Well, in my Akonadi DB there is no record with ID 1. The minimum ID is 6,
> and the lowest ID used as parent ID is 22.
> I don't know how it could happen, if it is to be considered normal or not.
> Anyway, parentId = 1 looks pretty hardcoded, though.
> 
> Given that the contents of my DB might by somehow strange, is there an
> advice about how to start over with a fresh DB but without the need to
> configure any resources (calendars, accounts etc.) completely new? (And of
> course without loosing any data in the resources?)
> 
> Any help is welcome.
> Best regards,
> Andreas
> 
> Am Montag, 28. Januar 2019, 19:02:10 CET schrieb Andreas Gungl:
> > Hi, is there really no idea how to fix the problem?
> > If so, what would I have to do to clean up all existing data (except the
> > mail messages, of course) and start over with a fresh installation in my
> > Linux account?
> > 
> > Best regards,
> > Andreas
> > 
> > Am Montag, 14. Januar 2019, 18:03:47 CET schrieb Andreas Gungl:
> > > Hi Dan,
> > > 
> > > Thanks for offering your help. I'd already asked on kdepim-users and
> > > didn't
> > > get a response for weeks. That's why I wrote to this list.
> > > 
> > > The output from the akonadiconsole, if the search error occurs, ist like
> > > this:
> > > 
> > > org.kde.pim.akonadiserver: DATABASE ERROR:
> > > org.kde.pim.akonadiserver:   Error code: "1452"
> > > org.kde.pim.akonadiserver:   DB error:  "Cannot add or update a child
> > > row:
> > > a foreign key constraint fails (`akonadi`.`collectiontable`, CONSTRAINT
> > > `collectiontable_ibfk_1` FOREIGN KEY (`parentId`) REFERENCES
> > > `collectiontable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
> > > org.kde.pim.akonadiserver:   Error text: "Cannot add or update a child
> > > row:
> > > a foreign key constraint fails (`akonadi`.`collectiontable`, CONSTRAINT
> > > `collectiontable_ibfk_1` FOREIGN KEY (`parentId`) REFERENCES
> > > `collectiontable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) QMYSQL3:
> > > Unable to execute statement"
> > > org.kde.pim.akonadiserver:   Values: QMap((":0", QVariant(QString,
> > > "Letzte
> > > Suche"))(":1", QVariant(qlonglong, 1))(":2", QVariant(qlonglong,
> > > 1))(":3",
> > > QVariant(QString, "{\n    \"limit\": -1,\n    \"negated\": false,\n
> > > \"rel\": 0,\n    \"subTerms\": [\n        {\n            \"negated\":
> > > false,\n \"rel\": 1,\n            \"subTerms\": [\n                {\n
> > > \"cond\": 5,\n                    \"key\": \"from\",\n
> > > \"negated\": false,\n                    \"value\": \"gungl\"\n
> > > }\n            ]\n        }\n    ]\n}\n"))(":4", QVariant(QString,
> > > "RECURSIVE"))(":5", QVariant(QString, "166"))(":6", QVariant(bool,
> > > true)))
> > > org.kde.pim.akonadiserver:   Query: "INSERT INTO CollectionTable (name,
> > > parentId, resourceId, queryString, queryAttributes, queryCollections,
> > > isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6)"
> > > org.kde.pim.akonadiserver: Error during insertion into table
> > > "CollectionTable" "Cannot add or update a child row: a foreign key
> > > constraint fails
> > > (`akonadi`.`collectiontable`, CONSTRAINT `collectiontable_ibfk_1`
> > > FOREIGN
> > > KEY (`parentId`) REFERENCES `collectiontable` (`id`) ON DELETE CASCADE
> > > ON
> > > UPDATE CASCADE) QMYSQL3: Unable to execute statement"
> > > 
> > > It looks like a DB integrity problem KMail can't recover from by itself.
> > > But apart from that I've no clue about how to fix that.
> > > 
> > > Best regards,
> > > Andreas
> > > 
> > > Am Montag, 14. Januar 2019, 10:53:40 CET schrieb Daniel Vrátil:
> > > > Hi Andreas,
> > > > 
> > > > could you please start Akonadi from terminal (open "Konsole" and run
> > > > "akonadictl restart"), then try to create the search in KMail again -
> > > > you
> > > > should see some more detailed errors in the Konsole window that might
> > > > help
> > > > us figure out what's wrong.
> > > > 
> > > > Thanks,
> > > > Daniel
> > > > 
> > > > PS: kdepim-users is a better list for this kind of questions.
> > > > 
> > > > On Saturday, 12 January 2019 16:13:10 CET Andreas Gungl wrote:
> > > > > Hi,
> > > > > 
> > > > > did a search in the web but didn't find a solution for how to solve
> > > > > the
> > > > > problem: When I search for messages, I end up with the error
> > > > > message:
> > > > > "Unable to create persistent search"
> > > > > 
> > > > > I have no search folder around, maybe that's the problem. Should I
> > > > > need
> > > > > to
> > > > > create one manually? Any other hints like restarting akonadi etc.
> > > > > didn't
> > > > > help. How can I make the search working again?
> > > > > 
> > > > > Best regards,
> > > > > Andreas


-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190303/ae9ac9d0/attachment.sig>


More information about the kde-pim mailing list