Bug 343186 - Timeout trying to get lock on start of kmail
Summary: Timeout trying to get lock on start of kmail
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.14.2
Platform: Debian unstable Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-23 09:38 UTC by Martin Steigerwald
Modified: 2022-11-27 10:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Steigerwald 2015-01-23 09:38:53 UTC
Before I only had it something on high load, but now after redoing Akonadi from scratch due to what seems to me a loss of the MySQL database, I get it everytime I start KMail. Even after Akonadi indexed the local maildir.


Reproducible: Always

Steps to Reproduce:
I have no idea.

Maybe have a large one million mail local maildir, wipe all of Akonadi and let it reindex it and then try?

Actual Results:  
After only a few seconds, after starting KMail, and while I am able to see the folder list and mail lists just fine, I get the following dialog from KMail:



The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock.


I can only press "Ok" and then kmail finished.




martin@merkaba:~> LANG=C kmail
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
kmail2(3146) KDirWatch::removeDir: doesn't know "/home/martin/.kde/share/apps/messageviewer/themes/" 
kmail2(3146) KDirWatch::removeDir: doesn't know "/usr/share/kde4/apps/messageviewer/themes/" 
martin@merkaba:~> kmail2(3146)/libakonadi Akonadi::GetLockJob::Private::timeout: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer. 
kmail2(3146)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::lockResult: Failed to get lock: "Timeout trying to get lock." 
kmail2(3146) MailCommon::Kernel::emergencyExit: "The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock." 
kmail2(3146)/libakonadi Akonadi::GetLockJob::Private::timeout: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer. 
kmail2(3146)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::lockResult: Failed to get lock: "Timeout trying to get lock." 
kmail2(3146) MailCommon::Kernel::emergencyExit: "The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock." 
kmail2(3146)/libakonadi Akonadi::GetLockJob::Private::timeout: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer. 
kmail2(3146)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::lockResult: Failed to get lock: "Timeout trying to get lock." 
kmail2(3146) MailCommon::Kernel::emergencyExit: "The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock." 
kmail2(3146)/libakonadi Akonadi::GetLockJob::Private::timeout: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer. 
kmail2(3146)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::lockResult: Failed to get lock: "Timeout trying to get lock." 
kmail2(3146) MailCommon::Kernel::emergencyExit: "The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock." 
kmail2(3146)/libakonadi Akonadi::GetLockJob::Private::timeout: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer. 
kmail2(3146)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::lockResult: Failed to get lock: "Timeout trying to get lock." 
kmail2(3146) MailCommon::Kernel::emergencyExit: "The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock." 
kmail2(3146)/libakonadi Akonadi::GetLockJob::Private::timeout: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer. 
kmail2(3146)/libakonadi Akonadi::SpecialCollectionsRequestJobPrivate::lockResult: Failed to get lock: "Timeout trying to get lock." 
kmail2(3146) MailCommon::Kernel::emergencyExit: "The Email program encountered a fatal error and will terminate now.
The error was:
Timeout trying to get lock." 

Expected Results:  
KMail just works.

I think I will try these steps next:

1) Log out, make sure no user processes anymore, wipe out /tmp and /var/tmp KDE stuff, login, retry

2) Wipe KMail 2 configuration as well after I have wiped out and redone all of Akonadi due to the major breakage yesterday I reported in kde-pim-ml just a moment ago.

I am using database optimized Akonagi 1.13 git master branch. This has not caused me any issues so far and reduced the MySQL load quite considerably.

Okay, now mysql is running wild on I/O again, so maybe Akonadi is still doing something without Akonadiconsole reporting it, but still, I want to be able to start KMail. Maybe the timeout is too low for my setup? Or it is an issue in Akonadi?
Comment 1 Martin Steigerwald 2015-01-23 09:51:17 UTC
Okay

1) Log out, make sure no user processes anymore, wipe out /tmp and /var/tmp KDE stuff, login, retry

has helped.

Now I recreate the filter rules from export of them and I configure POP3 account again. Reducing severity as it doesn't happen on each start anymore. KMail is now working again.
Comment 2 David Faure 2016-02-25 07:45:08 UTC
https://git.reviewboard.kde.org/r/127175/ might help
Comment 3 Martin Steigerwald 2016-04-14 09:52:10 UTC
Thanks, David. Together with my MySQL database config optimizations 30 seconds are indeed enough to cold start KMail + Akonadi. Without the optimization Akonadi startup takes longer than 30 seconds and I still get the notification.

My optimization mainly is:

innodb_buffer_pool_size=1024M

(As I noted in another bug report  the default value is ridiculously low for larger mail setups.)

So or so the original issue is not solved by that patch, its merely a workaround.
Comment 4 m.eik michalke 2017-02-25 11:19:17 UTC
now, this bites me, again (KF5 16.04.3 packages from kubuntu backports, plasma 5.8.5): when i log in to my account, after a while i get the infamous "fatal error: timeout trying to get lock", informing me that kmail will be terminated, while i can actually see it in the background soon after, loading folders and fetching mails.

ever since the upgrade to KF5, it literally takes like ages until the session has finally started. i didn't really change anything, except of course replacing the plasma widgets. but compared to KDE4, KF5 now needs at least twice the time to even show a background image and the control bar, which seems like it's slow enough for kmail to crash on me. it happens almost every day.
Comment 5 Justin Zobel 2022-10-31 04:31:51 UTC
Thank you for reporting this bug 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 issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 6 m.eik michalke 2022-11-01 11:40:23 UTC
i no longer face this issue.
Comment 7 Bug Janitor Service 2022-11-16 05:15:50 UTC
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!
Comment 8 Nick 2022-11-27 10:19:19 UTC
I just had this error occur after I started kmail which then exited after acknowledging the message. Restarted kmail and seems to be working ok. Strange, I've never seem that error before and I use kmail on a daily basis.
Comment 9 Nick 2022-11-27 10:22:54 UTC
I'm running 5.21.2 on KDE Neon (ubuntu 22.04). Hopefully it's just a very obscure minor issue. Just odd I've never seen it before.
Comment 10 Nick 2022-11-27 10:34:26 UTC
This was in the syslog about the time the error occured, may not be relevant but thought I'd document it.

>Nov 27 10:22:55 pnp akonadiserver[49834]: org.kde.pim.akonadiserver.search: Executing search "searchUpdate-1669544575"
>Nov 27 10:22:55 pnp akonadiserver[49834]: org.kde.pim.akonadiserver: DATABASE ERROR:
>Nov 27 10:22:55 pnp akonadiserver[49834]: org.kde.pim.akonadiserver:   Error code: "2014"
>Nov 27 10:22:55 pnp akonadiserver[49834]: org.kde.pim.akonadiserver:   DB error:  "Commands out of sync; you can't run this command now"
>Nov 27 10:22:55 pnp akonadiserver[49834]: org.kde.pim.akonadiserver:   Error text: "Commands out of sync; you can't run this command now QMYSQL3: Unable to store statement results"
Comment 11 Nick 2022-11-27 10:39:56 UTC
Forget my previous comment, the text below is relevant to the error:
>Nov 27 10:14:39 pnp akonadiserver[49834]: org.kde.pim.akonadiserver.search: Search  "kmail2-1974024246-SearchSession" done (without remote search)
>Nov 27 10:14:40 pnp akonadiserver[49834]: org.kde.pim.akonadiserver: Error while handling command FetchCollections on connection akonadi_maildir_resource_1 (0x55bdd1c68fc0)
>Nov 27 10:14:44 pnp kmail[49783]: org.kde.pim.akonadicore: Timeout trying to get lock. Check who has acquired the name "org.kde.pim.SpecialCollections" on DBus, using qdbus or qdbusviewer.
>Nov 27 10:14:44 pnp kmail[49783]: org.kde.pim.akonadicore: Failed to get lock: "Timeout trying to get lock."
>Nov 27 10:14:44 pnp kmail[49783]: org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nTimeout trying to get lock."