Bug 314206 - Korganizer and KAddressbook forgets that resources are enabled
Summary: Korganizer and KAddressbook forgets that resources are enabled
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: DAV Resource (show other bugs)
Version: 4.10
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-31 19:58 UTC by Anders Lund
Modified: 2013-12-02 16:34 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Lund 2013-01-31 19:58:20 UTC
Grrrrrrrrr.

Reproducible: Sometimes

Steps to Reproduce:
1. add a DAV resource with an owncloud service in the other end
2. add your calendars and addressbooks from the owncloud service
3. start kaddressbook or korganizer
4. First hit of misbehavior: The resources are not enabled. Enable them (after figuring it out).
5. exit
6. start again
Actual Results:  
owncloud calendars or addressbooks are NOT enabled - some times

Expected Results:  
of course resources should be enabled, ALWAYS. I eneabled them, didn't I??

Frankly, judging from experience and the amount of nempmuk activity, my guess is that akonadi DROPS resources, and then refinds them and assigns new id's.
This is one of the things making one consider if linux and KDE is really worth the fight! Resources used to work, so we are evolving backwards. ARRRRRRRRGH. Sorry. But I really hoped this was over, but its not :(
Comment 1 Anders Lund 2013-03-12 21:17:18 UTC
I'm now in KDE 4.10.1, and today suddenly the calendars in korganizer had changed colors. My calendars were also suddenly all turned off.  This probably means that akonadi dropped and recreated them.

There must be a way of having a persistant ID please :)
Comment 2 Lukas Schneiderbauer 2013-03-14 17:20:28 UTC
This happens also for me very frequently with the google calendar and google contacts. Specifically it happens after a reboot or a wakeup from suspend (although not really "always" but most of the time). Every time I reactivate them they are colored differently (seems random; I cannot see a pattern). Very annoying indeed.
Comment 3 Grégory Oestreicher 2013-03-16 17:45:40 UTC
Hi,

I've reworked a bit the internals of the resource for 4.10.2. If it's possible could you give it a test before the official release? This means recompiling the branch KDE/4.10 of the kdepim-runtime repo.

I'm unfortunately unable to reproduce this bug :/

Cheers,
Grégory
Comment 4 Anders Lund 2013-03-16 18:27:34 UTC
no testing from me.

As long as you associate the configuration with anything else but the URL of 
the resource, this problem will stay. That is, if I have a calendar at a 
certain URL, the configuration of its visibility and associated color should 
be identified by that URL. Nothing else can work.
Comment 5 Lukas Schneiderbauer 2013-03-16 18:41:07 UTC
(In reply to comment #3)
> I've reworked a bit the internals of the resource for 4.10.2. If it's
> possible could you give it a test before the official release? This means
> recompiling the branch KDE/4.10 of the kdepim-runtime repo.
I will do. But for now the compilation fails:
> "./agents/nepomukfeeder/itemqueue.cpp:93:23: error: ‘class Akonadi::ItemFetchScope’ has no member named ‘setIgnoreRetrievalErrors’"
Any idea?
Comment 6 Grégory Oestreicher 2013-03-16 19:54:10 UTC
(In reply to comment #5)
> > "./agents/nepomukfeeder/itemqueue.cpp:93:23: error: ‘class Akonadi::ItemFetchScope’ has no member named ‘setIgnoreRetrievalErrors’"
> Any idea?

Are you using KDE 4.9? If so, try to recompile just the resource; it's in the resources/dav/ directory.
Comment 7 Lukas Schneiderbauer 2013-03-16 20:06:47 UTC
(In reply to comment #6)
> Are you using KDE 4.9? If so, try to recompile just the resource; it's in
> the resources/dav/ directory.
No, I'm using KDE SC 4.10.1.
Comment 8 Lukas Schneiderbauer 2013-03-16 20:19:44 UTC
The API reference [0] says this:
> void ItemFetchScope::setIgnoreRetrievalErrors	(	bool 	enabled	)
> Since 4.11
I understand the usage is therefore forbidden in 4.10.* code.

I tried to compile this:
>   repository:               git://anongit.kde.org/kdepim-runtime
>   at the commit:            38ce56b9c326dbdf766231275a13541a7c8cf261
>  branch:                   KDE/4.10
... so definitely 4.10

git-blame tells me that
450a036a (Christian Mollekopf 2013-03-04 18:21:44)
is the one who introduced the usage of this member.


[0] http://api.kde.org/4.x-api/kdepimlibs-apidocs/akonadi/html/classAkonadi_1_1ItemFetchScope.html#ac3daaa040c18f227c66a4a29488a85d8
Comment 9 Grégory Oestreicher 2013-03-17 10:08:40 UTC
(In reply to comment #8)
> The API reference [0] says this:
> > void ItemFetchScope::setIgnoreRetrievalErrors	(	bool 	enabled	)
> > Since 4.11
> I understand the usage is therefore forbidden in 4.10.* code.

Indeed.

> git-blame tells me that
> 450a036a (Christian Mollekopf 2013-03-04 18:21:44)
> is the one who introduced the usage of this member.

I'll try to catch Christian on IRC today, and if I can't will ask on the kde-pim ml.

Thanks for catching and reporting this, appreciated :)

Cheers,
Grégory
Comment 10 Grégory Oestreicher 2013-03-17 18:44:40 UTC
(In reply to comment #5)
> I will do. But for now the compilation fails:

You can compile the resource without having to compile all of kdepim-runtime. If cmake succeeds, which it seems to do, then just cd to 'resources/dav/' and issue 'make' from here.

Thanks for your help,
Grégory
Comment 11 Lukas Schneiderbauer 2013-03-18 19:57:36 UTC
(In reply to comment #10)
> You can compile the resource without having to compile all of
> kdepim-runtime. If cmake succeeds, which it seems to do, then just cd to
> 'resources/dav/' and issue 'make' from here.

First question is: How do I install it correctly?
I ran make install, but of course it installed it somewhere into nowhere (/usr/local/share/kde4...) and not where the distro installs it into (/usr/share/kde4..)
Second question: How do I remove this stuff in /usr/local/.. again? There is no make uninstall or equivalent.
Comment 12 Grégory Oestreicher 2013-03-18 20:03:20 UTC
(In reply to comment #11)
> First question is: How do I install it correctly?

You can pass '-DCMAKE_INSTALL_PREFIX=/usr' when running cmake.

> Second question: How do I remove this stuff in /usr/local/.. again? There is
> no make uninstall or equivalent.

Here are the files installed by the resource, with paths adapted to /usr/local:
/usr/local/share/akonadi/agents/davgroupwareresource.desktop
/usr/local/share/kde4/servicetypes/davgroupwareprovider.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/owncloud.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/zarafa.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/citadel.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/zimbra.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/egroupware.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/yahoo.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/davical.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/scalix.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/sogo.desktop
/usr/local/share/kde4/services/akonadi/davgroupware-providers/opengroupware.desktop
/usr/local/bin/akonadi_davgroupware_resource

You can safely remove those.
Comment 13 Lukas Schneiderbauer 2013-03-18 20:59:48 UTC
Thank you for your help. :)

I did a relogin and it appears I'm running the newer version new (since the doubled calendar-entries disappeared; see the bug you fixed in the last few days).
I will report if something interesting happens (e.g. a recurrence of this bug's symptons).
Comment 14 Lukas Schneiderbauer 2013-03-22 20:38:23 UTC
Okay, here we are. Today something out of the ordinary happened.
After a few hours of a running kde session with kontact opened the calendar suddenly only showed one of my 5 google calendars. I looked at KOrganizer: no more contacts although the addressbook-checkbox was 'ticked'.
I tried clicking around and stuff but it wouldn't change. So I closed Kontact and did a 'akonadictl restart'.
This line catched my eye:
> Cannot connect to agent instance with identifier 'akonadi_davgroupware_resource_6', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_6': no such name'"
ItemRetrieverException :  Unable to contact resource

and a few hundred lines of these:
> akonadi_davgroupware_resource_6(5133)/libakonadi Akonadi::ResourceBase::itemRetrieved: Item does not provide part "RFC822"

I ran akonadiconsole. Everything looked fine (agents reported a successfull run). Looking at the dav-calendar-resource showed a lot of items. The contact-folder held items as well.

Actually my guess is that this has nothing to do with this bug but is a different one. But you surely see things clearer. Please give advice how to proceed.
Comment 15 Grégory Oestreicher 2013-03-23 08:35:24 UTC
Using akonadiconsole, in the browser tab, can you check the mime type set on the items? This looks like another issue that I thought was fixed.
Comment 16 Lukas Schneiderbauer 2013-03-23 15:51:02 UTC
(In reply to comment #15)
> Using akonadiconsole, in the browser tab, can you check the mime type set on
> the items? This looks like another issue that I thought was fixed.
The working calendar: application/x-vnd.akonadi.calendar.event
the not working stuff (calendar, contacts): message/rfc822
Comment 17 Grégory Oestreicher 2013-03-25 20:52:54 UTC
(In reply to comment #16)
> The working calendar: application/x-vnd.akonadi.calendar.event
> the not working stuff (calendar, contacts): message/rfc822

OK, I think I've managed to reproduce this, and I'm currently testing a fix. It should be ready for 4.10.2 if time allows.
Comment 18 Anders Lund 2013-03-25 20:54:58 UTC
You are a true hero! <3
Comment 19 Grégory Oestreicher 2013-03-26 18:23:58 UTC
Git commit 3eb827f7e6d17161bb5b1558bc066d4bcb134ce3 by Grégory Oestreicher.
Committed on 25/03/2013 at 22:03.
Pushed by goestreicher into branch 'KDE/4.10'.

Prevent duplicates in mCollectionsWithTemporaryError
Related: bug 313670
FIXED-IN: 4.10.2

M  +4    -1    resources/dav/resource/davgroupwareresource.cpp

http://commits.kde.org/kdepim-runtime/3eb827f7e6d17161bb5b1558bc066d4bcb134ce3
Comment 20 Lukas Schneiderbauer 2013-03-26 18:49:44 UTC
Grégory, thank you.
Comment 21 Lukas Schneiderbauer 2013-03-29 08:14:57 UTC
I removed the resource and recompiled with your latest patch. After relogin I added the dav-resource again. Sadly the rfc822 issue appeared again this morning. :(

(I tried to reopen the bug, but I failed. Seems I don't have the permission.)
Comment 22 Grégory Oestreicher 2013-03-29 08:17:19 UTC
You recompiled the latest of the branch KDE/4.10?

Also, do you remember what you've done before the issue appeared again: was your connection to the caldav server ok, did you woke up your machine from a suspend to ram/disk or was it a cold boot?
Comment 23 Lukas Schneiderbauer 2013-03-29 08:25:42 UTC
(In reply to comment #22)
> You recompiled the latest of the branch KDE/4.10?
On March 26th, yes. This was the latest commit: 3eb827f7e6d17161bb5b1558bc066d4bcb134ce3 (which is the one above). I double checked the 'modified'-dates of the installed files. They match.

> Also, do you remember what you've done before the issue appeared again: was
> your connection to the caldav server ok, did you woke up your machine from a
> suspend to ram/disk or was it a cold boot?
Yesterday I did a suspend to ram (while kontact running). This morning my notebook woke up from it.
Comment 24 Lukas Schneiderbauer 2013-03-29 08:29:00 UTC
(In reply to comment #22)
> You recompiled the latest of the branch KDE/4.10?
My answer was not quite correct. I only recompiled the dav-resource (as you explained to me in earlier posts).
Comment 25 Grégory Oestreicher 2013-03-29 10:41:15 UTC
Could you send me (privately) your ~/.xsession-errors? Eventually gzip it, as it can become quite huge.
Comment 26 Stephan Diestelhorst 2013-04-16 13:46:31 UTC
I think I might be bitten by this as well.  On 4.10.2, my CalDav calendar (Google Calendar) events suddently do not display anymore.  In the akonadiconsole Browse / Calendar view, the entries are not properly parsed.  Mime typ is RFC/822 and I get a large number of 

akonadi_davgroupware_resource_3(8267)/libakonadi Akonadi::ResourceBase::itemRetrieved: Item does not provide part "RFC822"

and


akonadi_davgroupware_resource_3(8267)/kdepimlibs (kcalcore): parse error ; string is empty? true 

Several times toggled akonadi (akonadictl restart), also did vacuum and fsck.  Did not help.  Also dropped the cache of the resource (in akonadiconsole, right click folder in resource and then delete cache).
Comment 27 Grégory Oestreicher 2013-04-16 16:32:19 UTC
(In reply to comment #26)
> Several times toggled akonadi (akonadictl restart), also did vacuum and
> fsck.  Did not help.  Also dropped the cache of the resource (in
> akonadiconsole, right click folder in resource and then delete cache).

Lukas could confirm, but this may be fixed in what will become 4.10.3. In your case, if you can't recompile the resource, try restarting it after clearing the cache. It should help.
Comment 28 Lukas Schneiderbauer 2013-04-19 15:00:04 UTC
FYI: I'm running the 4.10 branch of kdepim-runtime since April, 11th (.. cloned at the same day); the rest of kde is 4.10.2. Since then no more errors occured. Taking previous error-occuring-rates* into account the bug is likely to be fixed imho.

[*] if this isn't a real word please replace it with an appropriate one.
Comment 29 Stephan Diestelhorst 2013-04-21 17:00:59 UTC
(In reply to comment #27)
> (In reply to comment #26)
> > Several times toggled akonadi (akonadictl restart), also did vacuum and
> > fsck.  Did not help.  Also dropped the cache of the resource (in
> > akonadiconsole, right click folder in resource and then delete cache).
> 
> Lukas could confirm, but this may be fixed in what will become 4.10.3. In
> your case, if you can't recompile the resource, try restarting it after
> clearing the cache. It should help.

If restarting means restarting Akonadi, the agent and/or Kmail / Korganizer, this doesn't help in my case.  Will check the patch.
Comment 30 Stephan Diestelhorst 2013-04-22 11:23:12 UTC
(In reply to comment #27)
> (In reply to comment #26)
> > Several times toggled akonadi (akonadictl restart), also did vacuum and
> > fsck.  Did not help.  Also dropped the cache of the resource (in
> > akonadiconsole, right click folder in resource and then delete cache).
> 
> Lukas could confirm, but this may be fixed in what will become 4.10.3. In
> your case, if you can't recompile the resource, try restarting it after
> clearing the cache. It should help.

I recompiled kdepim-runtime with git commit 8097d5889c0b31c749dc4ddd59e19d1ca163ef9f (KDE/4.10), and it seems that in each calendar, one entry has had its MimeType changed from message/rfc822 to application/x-vnd.akonadi.calendar.event and is shown in Korganizer and in the Calendar Model of akonadiconsole.  Tried deleting the cache and also restarting the resource.  Did not help beyond that.
Comment 31 Stephan Diestelhorst 2013-04-22 11:25:57 UTC
Sorry for the spam, but cloning the resource (so I didn't have to set up all the sub-calendars) helped here.
Comment 32 Grégory Oestreicher 2013-04-22 19:16:43 UTC
Thanks for the feedback and testing everyone, it's really appreciated. Closing for good this time I hope :)
Comment 33 mail 2013-05-11 13:35:28 UTC
After updating to 4.10.3 my owncloud contacts resource did shrink again to 0 bytes.

Positive things: the mimetype did not change to rfc/822
Comment 34 auxsvr 2013-05-11 18:28:47 UTC
I confirm comment 33. The rfc822 issue is fixed, the addressbook was working fine until some hours ago, when the icon of the resource changed into a brown book and no contacts appear. Upon attempts to access the contacts in the browser in akonadiconsole, the error message

(addressee) Akonadi::SerializerPluginAddressee::deserialize: Empty addressee object! 

appears many times.
Comment 35 MartinG 2013-05-13 08:21:55 UTC
Is this related to Bug 287704? (" The base is to lure
Akonadi into thinking that the changes succeeded while
nothing can guarantee this.")
Comment 36 Grégory Oestreicher 2013-05-19 21:55:26 UTC
Well well well, I found a strange behavior in KIO that explains the issue. I've tried fixing it at the source, suffered a massive brain deflagration when trying to follow the code, and decided to find a workaround. It should be fixed in 4.10.4.
Comment 37 Pavel 2013-05-31 05:20:15 UTC
I also experience the problem (on 4.10.3).
Why did you not reopen the bug? It's confusing when you do search.
Comment 38 Stefan Huber 2013-12-02 16:34:39 UTC
I frequently experience this with korganizer-4.11.3 on Gentoo Linux. This bug does not seem to be fixed or resolved to me.