Bug 293208

Summary: Kalarm fails to create default calendars for freshly created user
Product: [Applications] kalarm Reporter: Vit Pelcak <vit>
Component: AkonadiAssignee: David Jarvie <djarvie>
Status: CLOSED FIXED    
Severity: normal CC: mattdawolf
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.1

Description Vit Pelcak 2012-02-03 14:16:32 UTC
Version:           unspecified
OS:                Linux

I have created new user. Kalarm doesn't crash for him.

But it displays several error messages on start.

Failed to create default calendar “Alarm templates”

Location: /home/test/.kde4/share/apps/kalarm/template.ics
(Agent instance creation timeout.)

Failed to create default calendar “Archived alarms” 
Location: /home/test/.kde4/share/apps/kalarm/expired.ics
(Agent instance creation timeout.)

Failed to create default calendar “Active alarms” 
Location: /home/test/.kde4/share/apps/kalarm/calendar.ics
(Could not get owner of name
'org.freedesktop.Akonadi.Resource.akonadi_kalarm_resource_0': no such name)

I'm just translating those messages from Czech, but in general, it should be
OK.

Please note, I'm not using KDE as I moved to E17.

Reproducible: Always

Steps to Reproduce:
Create new user, login (perhaps into non-KDE DE) and start Kalarm.

Actual Results:  
Error messages are displayed.

Expected Results:  
No error messages are expected.
Comment 1 Vit Pelcak 2012-02-03 14:17:06 UTC
I forgot to add, that distribution is openSUSE.
Comment 2 David Jarvie 2012-02-03 14:32:34 UTC
A possible cause for this is that Akonadi had not completed its startup when KAlarm tried to create the Akonadi resources for its default calendars. This is a known problem.

To verify this, can you try quitting KAlarm. Then run akonadiconsole, and in it delete all KAlarm resources which are listed in its first tab. Then restart KAlarm and see whether the default calendars are created successfully.
Comment 3 Vit Pelcak 2012-02-03 14:44:16 UTC
I can confirm that your suggestion helped.

I guess I can use akonadiconsole to delete that extra calendar in my other bug as well.
Comment 4 David Jarvie 2012-02-03 15:04:13 UTC
This seems to confirm that the problem is that KAlarm is not waiting until Akonadi startup is complete before trying to create the resources. I've changed the bug description accordingly.

Currently, I don't know of any way for an application to detect when Akonadi is ready. This needs to be resolved.
Comment 5 David Jarvie 2012-02-11 11:29:31 UTC
Git commit ce1caef4ca48171855bdb16f9263622fd1660119 by David Jarvie.
Committed on 11/02/2012 at 12:25.
Pushed by djarvie into branch 'master'.

Bug 293208: fix errors creating default resources on initialisation

Wait for Akonadi server to be fully running before creating default
KAlarm resources. This also requires kdepimlibs commit
d612b6055f725c01664e3ed07294d2f29052d204 by Volker Krause which fixes
the server manager reporting prematurely that it is running.

M  +21   -5    kalarm/akonadimodel.cpp
M  +3    -0    kalarm/akonadimodel.h

http://commits.kde.org/kdepim/ce1caef4ca48171855bdb16f9263622fd1660119
Comment 6 David Jarvie 2012-02-11 11:35:07 UTC
Git commit 8b8890cecd3d066f7454b17b113c748cbef53c96 by David Jarvie.
Committed on 11/02/2012 at 12:35.
Pushed by djarvie into branch 'KDE/4.8'.

Bug 293208: fix errors creating default resources on initialisation

Wait for Akonadi server to be fully running before creating default
KAlarm resources. This also requires kdepimlibs commit
d612b6055f725c01664e3ed07294d2f29052d204 by Volker Krause which fixes
the server manager reporting prematurely that it is running.

Backport of ce1caef4ca48171855bdb16f9263622fd1660119 (master)
FIXED-IN:4.8.1

M  +2    -1    kalarm/Changelog
M  +21   -5    kalarm/akonadimodel.cpp
M  +3    -0    kalarm/akonadimodel.h

http://commits.kde.org/kdepim/8b8890cecd3d066f7454b17b113c748cbef53c96
Comment 7 Matt Stevens 2012-03-07 06:57:00 UTC
When will this hit the ubuntu repo?
Comment 8 David Jarvie 2012-03-07 17:09:13 UTC
You need to ask on an Ubuntu mailing list - KDE has no control over when distros package KDE software.