Kmail (or Kontact) crashes on 1st run on a fresh system: Failed SpecialCollectionsRequestJob::slotResult "Invalid parent"

Bug #1821868 reported by Rik Mills
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Kmail
Invalid
High
kmail (Debian)
Confirmed
Unknown
kmail (Ubuntu)
Confirmed
High
Unassigned
Disco
Won't Fix
High
Unassigned

Bug Description

On 1st start on a clean install (or suitably wiped akonadi configs), Kmail (or Kontact with Kmail integrated) crashes on 1st run with:

org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Invalid parent"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nInvalid parent"

Kmail will launch and run on subsequent starts.

TO REPRODUCE:

Requires a pristine install with NO config files or db created yet (live iso is fine)

OR

stop akonadi with 'akonadictrl stop' and do:

rm -fr ~/.local/share/akonadi* ~/.cache/akonadi* ~/.config/akonadi* ~/.config/specialmailcollectionsrc

then launch kmail.

removing ~/.config/specialmailcollectionsrc (which would not exist in pristine install) seems crucial, as leaving that in place results in no crash.

Tags: iso-testing
Revision history for this message
In , Gerdfleischer (gerdfleischer) wrote :

Created attachment 105703
screenshot or error dialog window

KMail crashes on first start

xsession errors:
org.kde.pim.maildirresource: the resource is not properly configured: there is no config file for the resource. We create a new one.
org.kde.akonadi.ETM: GEN true false false
org.kde.akonadi.ETM: collection: QVector()
org.kde.akonadi.ETM:
QObject::killTimer: Timers cannot be stopped from another thread
org.kde.akonadi.ETM: Subtree: 5 QSet(5)
org.kde.akonadi.ETM: Fetch job took 37 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 1
org.kde.akonadi.ETM: first fetched collection: "Local Folders"
org.kde.akonadi.ETM: collection: QVector()
org.kde.akonadi.ETM: Fetch job took 39 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 4
org.kde.akonadi.ETM: first fetched collection: "Search"
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Invalid parent"
org.kde.akonadi.ETM: Fetch job took 1 msec
org.kde.akonadi.ETM: was collection fetch job: collections: 0
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nInvalid parent"
"No file selected."
org.kde.pim.akonadicore: not referenced 4
org.kde.pim.maildirresource: the resource is not properly configured: there is no config file for the resource. We create a new one.
QObject::killTimer: Timers cannot be stopped from another thread
org.kde.pim.akonadicore: not referenced 12

Revision history for this message
In , Gerdfleischer (gerdfleischer) wrote :

with debug packages

org.kde.akonadi.ETM: was collection fetch job: collections: 0
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Invalid parent"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nInvalid parent"
org.kde.pim.akonadiserver: DATABASE ERROR:
org.kde.pim.akonadiserver: Error code: 1062
org.kde.pim.akonadiserver: DB error: "Duplicate entry '4-outbox' for key 'CollectionTable_parentAndNameIndex'"
org.kde.pim.akonadiserver: Error text: "Duplicate entry '4-outbox' for key 'CollectionTable_parentAndNameIndex' QMYSQL3: Unable to execute statement"
org.kde.pim.akonadiserver: Query: "INSERT INTO CollectionTable (remoteId, remoteRevision, name, parentId, resourceId, enabled, syncPref, displayPref, indexPref, cachePolicyInherit, cachePolicyCheckInterval, cachePolicyCacheTimeout, cachePolicySyncOnDemand, cachePolicyLocalParts, isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14)"
org.kde.pim.akonadiserver: Error during insertion into table "CollectionTable" "Duplicate entry '4-outbox' for key 'CollectionTable_parentAndNameIndex' QMYSQL3: Unable to execute statement"
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Could not create collection outbox, resourceId: 3"
org.kde.pim.maildispatcher: Failed to get outbox folder. Retrying in: 5000
org.kde.pim.akonadicore: Failed CollectionCreateJob. "Could not create collection outbox, resourceId: 3"
"No file selected."
org.kde.pim.akonadicore: not referenced 3
org.kde.pim.maildirresource: the resource is not properly configured: there is no config file for the resource. We create a new one.
QObject::killTimer: Timers cannot be stopped from another thread
org.kde.pim.akonadicore: not referenced 14

Also, if akonadiserver is started manually before everything is ok.

Revision history for this message
In , Rik Mills (rikmills) wrote :

Also occurring on Debian Buster with 18.08

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861960

Revision history for this message
In , Rik Mills (rikmills) wrote :

Can also see this on 18.12.3 packages staged for Kubuntu

Revision history for this message
In , Rik Mills (rikmills) wrote :

Reproducible here on debian sid/buster.

Requires a pristine install with NO config files or db created yet

OR

after stopping akonadi and doing

rm -fr ~/.local/share/akonadi* ~/.cache/akonadi* ~/.config/akonadi* ~/.config/specialmailcollectionsrc

then trying.

removing ~/.config/specialmailcollectionsrc (which would not exist in pristine install) seems crucial.

Revision history for this message
In , Rik Mills (rikmills) wrote :

Also confirmed on KDE Neon user edition with PIM 18.12.3

Rik Mills (rikmills)
Changed in kmail (Ubuntu Disco):
status: New → Confirmed
Rik Mills (rikmills)
description: updated
Revision history for this message
In , Rik Mills (rikmills) wrote :
Changed in kmail (Debian):
status: Unknown → Confirmed
Revision history for this message
In , Rik Mills (rikmills) wrote :

Creating the ~/.config/specialmailcollectionsrc file with its default content of:

[SpecialCollections]
DefaultResourceId=akonadi_maildir_resource_0

prior to 1st launch prevents the crash, but I don't know if that would adversely affect the running of Kmail after that.

Revision history for this message
In , Dvratil-7 (dvratil-7) wrote :

I think this is a race condition in the initial setup: the race could be that on first start the Maildir resource (that backs the "Local folders") starts discovering what folders exist in ~/.local/share/mail and starts creating them in Akonadi and at the same time KMail realizes there's no Inbox, Outbox etc. in Local Folders and starts creating them.

At some point they clash as they both attempt to create the same collection - one of them wins and one of them fails with the SQL error - if KMail is the one who loses, it aborts the initial job and triggers the "fatal error" dialog.

Changed in kmail:
importance: Unknown → High
Rik Mills (rikmills)
Changed in kmail (Ubuntu Disco):
importance: Undecided → High
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1821868

tags: added: iso-testing
Revision history for this message
Rik Mills (rikmills) wrote :

Possible workarounds:

1) Let Kmail or Kontact crash; close any remaining email config window without doing anything in it; start Kmail or Kontact again. Application should now start ok.

(This is probably what will happen for most people, on purpose or just as a matter of course)

or;

2) Prior to starting Kmail/Kontact, in a terminal run 'akonadictl start'. This initialisation of the akonadi db seems to avoid the race condition later when mail client is started.

or;

3) Prior to starting Kmail/Kontact, create ~/.config/specialmailcollectionsrc with the content:

[SpecialCollections]
DefaultResourceId=akonadi_maildir_resource_0

Note: While this (3) superficiality appears to work, it is not well tested for longer term impact on your akonadi config/db, so should be a very last option.

Revision history for this message
In , Rik Mills (rikmills) wrote :

Still occurs in 19.08.1 in Neon, and Kubuntu staging builds.

Revision history for this message
emptythevoid (emptythevoid) wrote :

Currently occurring after installing Kmail using apt on Kubuntu 20.04

Revision history for this message
Steve Langasek (vorlon) wrote :

Ubuntu 19.04 reached end of life on January 23, 2020. I am therefore marking this bug 'wontfix' for that release.

Changed in kmail (Ubuntu Disco):
status: Confirmed → Won't Fix
Revision history for this message
In , Justin Zobel (justin-zobel) wrote :

Thank you for reporting this crash in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the crash with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!

Changed in kmail:
status: Unknown → Incomplete
Revision history for this message
emptythevoid (emptythevoid) wrote :

Tested this on Kubuntu 22.10 daily (10-08-22) and it still gives this error.

Revision history for this message
In , Bug-janitor (bug-janitor) wrote :

Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!

Revision history for this message
In , Bug-janitor (bug-janitor) wrote :

This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!

Changed in kmail:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.