Bug 405313

Summary: kalarm freezes in gnome
Product: [Applications] kalarm Reporter: stepnjump
Component: AkonadiAssignee: David Jarvie <djarvie>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: 2.11.16   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: many many instances of kalarm
Errors

Description stepnjump 2019-03-10 15:03:04 UTC
Created attachment 118686 [details]
many many instances of kalarm

SUMMARY
kAlarm is freezing under LinuxMint 19.1
Used to work fine, then I tried to back up the /home/pierre/.local/share/kalarm to protect my personnal alarms and then everything went south from there!

STEPS TO REPRODUCE
0. Killed all the kalarm PIDs
1. Deinstalled kalarm using apt-get autoremove
2. Deinstalled all akonadi modules using mintinstall
3. emptied everything that was in the /home/pierre/.local/share/kalarm directory
4. Reinstalled kalarm via mintinstall
5. It was complaining that the PIM was not installed so I installed it.
6. Installed akonadi-backend-mysql


OBSERVED RESULT
1. All my (probably garbled) data was pulled back. I don't know where it found it!
2. kAlarm froze 
3. CPU running high and hot
4. I also noticed that in the same directory as above, some files were written over and over, many times per second. Is that normal?

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: Linux Mint 19.1, Cinnamon (Gnome) 64 bits Kernel 4.18.0-14 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 stepnjump 2019-03-10 17:43:51 UTC
Ok.. even though I successfully installed (had to manually renter all my tasks but it's a minor inconvenience), I was wondering if this is normal.

Look at the PIDs (processes) and was noticing that there is a lot of activity with the akonadi processes EVEN when I X out and close the TSR in the task bar.

Then I did a pkill -f akonadi. Restarted the application and now, no more chatter!!!
I don't get it. 

I will be updating this ticket in the next few days. Thank you.
Comment 2 David Jarvie 2019-03-11 22:02:48 UTC
This looks similar to bug 392357. The culprit is likely to be Akonadi. There is a goal to replace the use of Akonadi for KAlarm, but this will take some time yet.
Comment 3 stepnjump 2019-03-24 16:37:17 UTC
Oh ok David. Thank you for getting back to me so quickly! God bless.
Comment 4 stepnjump 2019-03-24 16:56:26 UTC
David, I hope this might help....

Today, all my tasks for the day poped up as normal.
(Might have installed mint updates since last time I worked with kalarm main window)
When I opened kalarm main window, at my surprise, there was nothing in there.. the window was totally empty (no task displayed). 
Well, obviously, the tasks are somewhere because they are displayed!
Then I randomly tried to click here and there in Affichage menu.
When I clicked on 'alarmes actives' (which was left unchecked before), everything froze.... kalarm Main window and all the popups are now totally irresponsive.
Now it came up again... 
Might be just that I am running out of RAM. I swap in an USB stick.
Let me reboot and see if this solves the problem.

Pierre
Comment 5 stepnjump 2019-03-24 17:00:34 UTC
(In reply to stepnjump from comment #4)
> David, I hope this might help....
> 
> Today, all my tasks for the day poped up as normal.
> (Might have installed mint updates since last time I worked with kalarm main
> window)
> When I opened kalarm main window, at my surprise, there was nothing in
> there.. the window was totally empty (no task displayed). 
> Well, obviously, the tasks are somewhere because they are displayed!
> Then I randomly tried to click here and there in Affichage menu.
> When I clicked on 'alarmes actives' (which was left unchecked before),
> everything froze.... kalarm Main window and all the popups are now totally
> irresponsive.
> Now it came up again!


It looks like the app is running SUPER slow... Eventually things happen but it takes minutes to dismiss a pop up.
Comment 6 stepnjump 2019-03-24 17:02:06 UTC
Created attachment 119002 [details]
Errors
Comment 7 stepnjump 2019-03-24 17:08:29 UTC
(In reply to stepnjump from comment #5)
> (In reply to stepnjump from comment #4)
> > David, I hope this might help....
> > 
> > Today, all my tasks for the day poped up as normal.
> > (Might have installed mint updates since last time I worked with kalarm main
> > window)
> > When I opened kalarm main window, at my surprise, there was nothing in
> > there.. the window was totally empty (no task displayed). 
> > Well, obviously, the tasks are somewhere because they are displayed!
> > Then I randomly tried to click here and there in Affichage menu.
> > When I clicked on 'alarmes actives' (which was left unchecked before),
> > everything froze.... kalarm Main window and all the popups are now totally
> > irresponsive.
> > Now it came up again!
Yep!" It runs super slow!!! I guess...
Please see the new picture I added. It seems kalarm doesn't remove the duplicates anymore in the main window.

If there is anything I could do to help for you to diagnose this problem, I would be happy to do it. Just let me know what to do.

The new Kernel was recently upgraded to: Linux version 4.18.0-14-generic (buildd@lcy01-amd64-026) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #15~18.04.1-Ubuntu SMP Mon Jan 14 11:09:26

Should I downgrade?
> 
> 
> It looks like the app is running SUPER slow... Eventually things happen but
> it takes minutes to dismiss a pop up.
Comment 8 stepnjump 2019-03-24 17:36:45 UTC
(In reply to stepnjump from comment #7)
> (In reply to stepnjump from comment #5)
> > (In reply to stepnjump from comment #4)
> > > David, I hope this might help....
> > > 
> > > Today, all my tasks for the day poped up as normal.
> > > (Might have installed mint updates since last time I worked with kalarm main
> > > window)
> > > When I opened kalarm main window, at my surprise, there was nothing in
> > > there.. the window was totally empty (no task displayed). 
> > > Well, obviously, the tasks are somewhere because they are displayed!
> > > Then I randomly tried to click here and there in Affichage menu.
> > > When I clicked on 'alarmes actives' (which was left unchecked before),
> > > everything froze.... kalarm Main window and all the popups are now totally
> > > irresponsive.
> > > Now it came up again!
> Yep!" It runs super slow!!! I guess...
> Please see the new picture I added. It seems kalarm doesn't remove the
> duplicates anymore in the main window.
> 
> If there is anything I could do to help for you to diagnose this problem, I
> would be happy to do it. Just let me know what to do.
> 
> The new Kernel was recently upgraded to: Linux version 4.18.0-14-generic
> (buildd@lcy01-amd64-026) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3))
> #15~18.04.1-Ubuntu SMP Mon Jan 14 11:09:26
> 
> Should I downgrade?
> > 
> > 
> > It looks like the app is running SUPER slow... Eventually things happen but
> > it takes minutes to dismiss a pop up.

Here is the list of the dependencies and others through mintupdate lately. Please let me know if one of those might be the culprit and I will try the older version.

https://pastebin.com/0PrqhsVw

Thank you David
Comment 9 stepnjump 2019-03-24 17:47:15 UTC
I just removed the checkmark in : 
Agendas | alarmes actives | alarmes actives

Now the listing went blank but now the navigating speed is now back to normal (no delay).
Comment 10 stepnjump 2019-03-24 17:53:22 UTC
(In reply to stepnjump from comment #9)
> I just removed the checkmark in : 
> Agendas | alarmes actives | alarmes actives
> 
> Now the listing went blank but now the navigating speed is now back to
> normal (no delay).

Same thing happens when putting checkmark in :
kalarm

I don't remember which one my profile was stored in...
Comment 11 stepnjump 2019-03-24 18:32:50 UTC
(In reply to stepnjump from comment #10)
> (In reply to stepnjump from comment #9)
> > I just removed the checkmark in : 
> > Agendas | alarmes actives | alarmes actives
> > 
> > Now the listing went blank but now the navigating speed is now back to
> > normal (no delay).
> 
> Same thing happens when putting checkmark in :
> kalarm
> 
> I don't remember which one my profile was stored in...


Yes you were right about the location: 
for kalarm label, they are in /home/pierre/.local/share/kalarm
for Alarmes actives label, I found out it's pointing to the calendar.ics
/home/pierre/.local/share/kalarm/calendar.ics

Is that normal?

Alarmes archivées (in alarmes archivées pulldown menu)
are pointing to /home/pierre/.local/share/kalarm/expired.ics

and Alarmes actives (in alarmes archivées pulldown menu)
are pointing to /home/pierre/.local/share/kalarm/calendar.ics
Comment 12 David Jarvie 2019-04-01 18:06:05 UTC
Sorry for the delay in replying, but I've been away.

I don't think that the fault is likely to be due to your system update.

A possible reason for the problem could be that there are multiple Akonadi resources running, all using your alarm calendar. (This should not happen, of course.) To check this, please open a terminal window and in it, type the following command:
   ps -ef | grep akonadi_kalarm

Please attach the output from the command in your reply.
Comment 13 stepnjump 2019-04-11 15:17:32 UTC
Hi David,

No worries at all.. as you can tell, I'm really busy also! Fortunately the new Linuxmint 19.1 is such an improvement over the 17.2. Feels like a new speedy computer so I'm definitively more productive... Wish kalarm would run like it used to. Was running beautifully before! :(

Feel free to respond me when you have time. It's ok. You are awesome as always!!! I'm so glad your application is still currently active. I think it's so amazing.
Like I said, if there is anything I could do to help you to improve it (I'm not a programmer but I could help you with suggestions, translations, etc), please let me know. I don't have much time either but could help out here and there because I believe in kalarm!

I gave you a donation the other day. Might be under a different email address though. As a little bit more money will flow in, I will give you more. Right now, we are a little bit tight.

So here is the information you requested David:

pierre    3558  3486  0 avr08 ?        00:00:08 /usr/bin/akonadi_kalarm_dir_resource --identifier akonadi_kalarm_dir_resource_1
pierre    3560  3486  0 avr08 ?        00:00:08 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_0
pierre    3561  3486  0 avr08 ?        00:00:08 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_1
pierre    3563  3486  0 avr08 ?        00:00:08 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_2
pierre    3565  3486  0 avr08 ?        00:00:08 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_3
pierre    3566  3486  0 avr08 ?        00:00:08 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_4
pierre   26540 26530  0 11:11 pts/6    00:00:00 grep --color=auto akonadi_kalarm


God bless
Comment 14 stepnjump 2019-04-11 15:22:24 UTC
Killed all processes manually (kill -9 <PID>)
then performed a ps -ef ... and got:

pierre   28512  3486  1 11:20 ?        00:00:00 /usr/bin/akonadi_kalarm_dir_resource --identifier akonadi_kalarm_dir_resource_1
pierre   28513  3486  1 11:20 ?        00:00:00 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_1
pierre   28514  3486  0 11:20 ?        00:00:00 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_2
pierre   28520  3486  1 11:20 ?        00:00:00 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_3
pierre   28521  3486  1 11:20 ?        00:00:00 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_4
pierre   28522  3486  0 11:20 ?        00:00:00 /usr/bin/akonadi_kalarm_resource --identifier akonadi_kalarm_resource_0
pierre   28582 26530  0 11:20 pts/6    00:00:00 grep --color=auto akonadi_kalarm


If that can help you at all...
Thanks my friend.
Comment 15 stepnjump 2019-04-19 20:16:55 UTC
Additional information that 'might' help David..

Found some files in /tmp/akonadi-pierre.ChXM9m

srwxrwxr-x  1 pierre pierre    0 avr 17 16:27 akonadiserver-cmd.socket
srwxrwxr-x  1 pierre pierre    0 avr 17 16:27 akonadiserver-ntf.socket
-rw-r-----  1 pierre pierre    5 avr 17 16:27 mysql.pid
srwxrwxrwx  1 pierre pierre    0 avr 17 16:27 mysql.socket
-rw-------  1 pierre pierre    5 avr 17 16:27 mysql.socket.lock
Comment 16 stepnjump 2019-04-20 20:18:45 UTC
Found something interesting today:

pierre@CENNAT-7:~/.local/share$ ls -dal akona*
drwxrwxr-x 6 pierre pierre    4096 avr 17 16:27 akonadi
drwxrwxr-x 2 pierre pierre 5636096 mar 24 06:09 akonadi_kalarm_resource_0
drwxrwxr-x 2 pierre pierre    4096 mar  2 13:07 akonadi_kalarm_resource_1
drwxrwxr-x 2 pierre pierre    4096 mar  2 13:07 akonadi_kalarm_resource_2
drwxrwxr-x 2 pierre pierre 5525504 mar 24 06:09 akonadi_kalarm_resource_3
drwxrwxr-x 2 pierre pierre 3973120 mar 24 06:09 akonadi_kalarm_resource_4
drwxrwxr-x 3 pierre pierre    4096 fév  7 05:05 akonadi_migration_agent
Comment 17 stepnjump 2019-04-20 21:02:26 UTC
David, no rush... I am running it on my laptop for the time being so everything is good (kubuntu). I will keep trying different things here in the meanwhile. Thanks.
Comment 18 David Jarvie 2019-04-21 22:37:16 UTC
It looks as if more Akonadi resources are running than there should be. To fix this:

1. In KAlarm, use the View -> Show Calendars menu option to display the alarm calendars in use.

2. Right click on each calendar shown and choose Show Details. Note the calendar type, contents and file shown there. In the drop-down selector, choose each of Active Alarms, Archived Alarms and Alarm Templates, and repeat for each.

3. You will now have a list of all the calendar files currently in use, which you can use to restore them in case of any resources disappear in the subsequent steps.

4. Run "akonadiconsole" and look in the displayed list for all resources identified by the KAlarm icon.

5. For each KAlarm resource, double click on it to display its configuration, and note the file name shown for it.

6. If two resources show the same file name, remove one of those resources (using the Remove button or menu option). It shouldn't matter which of the two resources you remove. Keep repeating this operation until each file name only shows up for one resource.

7. There should now be one resource in the list for each calendar file found in step 2. If any calendars are now missing from the list shown in KAlarm, you can restore them by going to the Calendars pane in KAlarm and clicking Add to reinstate them.
Comment 19 Christoph Feck 2019-05-14 23:42:36 UTC
Does comment #18 help to resolve the issue?
Comment 20 stepnjump 2019-05-27 18:10:41 UTC
Hi David and Christopher. I appologize for not responding earlier. I just found out about the troubleshooting steps. I am really busy right now but I will give it a try in the next few days/weeks and will get back to you ASAP. Thank you very much David for the troubleshooting steps and for your great assistance as usual.
BTW, I installed kalarm on my new kubuntu installation on my laptop. It works really well....! Does the job for the time being.

StepNjump
Comment 21 stepnjump 2019-07-01 15:22:34 UTC
OK David,

Sorry for the delay. Today I have a day off so I tried to go through the steps you gave me. I am stuck at step no. 1

1. In KAlarm, use the View -> Show Calendars menu option to display the alarm calendars in use.

... because when I invoke kalarm, everything is frozen. All my missed alarms pops up and freeze right there on the desktop. 

I have no access to the kalarm software. Can't click on anything! 

:((((
Comment 22 David Jarvie 2019-07-04 21:50:57 UTC
If you kill kalarm first, does it freeze again after restarting it and trying to do step 1?

One thing which might possibly help to stop KAlarm freezing would be to delete its Akonadi data (which is separate from the alarm calendar data, so you won't lose any KAlarm data). The easy way to do this is to delete ALL Akonadi data - but beware that this will also delete some KMail, KOrganizer and possibly other KDE PIM applications' data, so it is not a good idea if you use any of them as well. If you really want to delete all Akonadi data, use the command 'rm -rf ~/.local/share/akonadi'

If you don't want to delete all Akonadi data, proceed as follows:

1. Run "akonadiconsole" and look in the displayed list for all resources identified by the KAlarm icon.

2. For each KAlarm resource, double click on it to display its configuration, and note the File name, Display name and Alarm types shown for it. Close the configuration dialog, and then use the Remove button to remove the resource. Note that this does not delete the calendar file containing your alarms - it just removes KAlarm's reference to it.

3. Once you have removed all KAlarm resources, reinstate them. For each resource you have removed, click the Add button, select "KAlarm Calendar File" in the list of resource types, and in the configuration dialog enter the configuration details which you noted down for that resource in step 2.

4. You can now close akonadiconsole.

5. Test to see if KAlarm will now run without freezing.
Comment 23 David Jarvie 2019-07-31 19:34:42 UTC
I'm marking this as a duplicate of Bug 403124, which has been fixed for the KDE Applications 19.08 release. If after you have updated to version 19.08 the bug persists, please reopen the bug.

In the meantime, before you upgrade to 19.08, you can try to fix the problem by following the steps in Comment #22.

*** This bug has been marked as a duplicate of bug 403124 ***