Bug 265096

Summary: Groupdav resource fails to show data after restart
Product: [Frameworks and Libraries] Akonadi Reporter: joost
Component: DAV ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: cordlandwehr, e.kunig, greg, lacsilva, privat, RalfBecker, silver.salonen
Priority: NOR    
Version: 4.6   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description joost 2011-02-01 16:11:05 UTC
Version:           4.6 (using KDE 4.6.0) 
OS:                Linux

When creating a groupdav resource (against eGroupware 1.6.003), the data (Contacts, Calendar, Todos) for this resource are shown.
However, after restarting the computer, the groupdav resource no longer contains any data.
To "fix" this, I need to remove the resource from akonadi and recreate it. It will then work till the next time I reboot.

Also, I am unable to select any addresses from the Groupdav-resource when composing a new email in kmail.

Reproducible: Always

Steps to Reproduce:
1) Create groupdav resource
2) test in korganizer and kaddressbook (items are listed and can be saved to server)
3) restart machine (or simply close all applications)
4) start akonadi
5) start korganizer or kaddressbook (items no longer listed)

Actual Results:  
See reproduction steps

Expected Results:  
Data from groupdav resource to be still available after a restart without having to recreate the groupdav resource in akonadi

stdout/stderr show following (for testing, am starting all kde-applications inside single console):

***
Database "/home/<username>/.local/share/akonadi/akonadi.db" opened using driver "QSQLITE3" 
posting retrieval request for item 630711  there are  1  queues and  0  items in mine 
request for item 630711 still pending - waiting 
processing retrieval request for item 630711  parts: ("RFC822")  of resource: "akonadi_davgroupware_resource_5" 
continuing 
request for item 630711 "http://<server>/groupdav.php/infolog/" failed: "Resource was unable to deliver item" 
ItemRetrieverException :  Resource was unable to deliver item
posting retrieval request for item 630717  there are  1  queues and  0  items in mine 
request for item 630717 still pending - waiting 
processing retrieval request for item 630717  parts: ("RFC822")  of resource: "akonadi_davgroupware_resource_5" 
continuing 
request for item 630717 "http://<server>/groupdav.php/calendar/" failed: "Resource was unable to deliver item" 
ItemRetrieverException :  Resource was unable to deliver item
Known subscriber "kontact" subscribes again 
Known subscriber "kontact" subscribes again 
Known subscriber "kontact" subscribes again 
Known subscriber "kontact" subscribes again 
kontact(9960)/kdeui (kdelibs): No such XML file "/home/<username>/.kde4/share/apps/kontact/default-.rc" 
Database "/home/<username>/.local/share/akonadi/akonadi.db" opened using driver "QSQLITE3" 
Database "/home/<username>/.local/share/akonadi/akonadi.db" opened using driver "QSQLITE3" 
***

In the above test, I have removed my username and the server-name. The URL listed is correct. Eg. egroupware is installed in the document-root of the webserver. (It is a virtual host)
Comment 1 Grégory Oestreicher 2011-02-01 19:23:55 UTC
Hi,

Thanks for reporting this issue. After some investigation the bug seems to lie in eGroupware: one of the XML elements of the response does not have the namespace set, and this causes it to be mis-detected. I've contacted the eGw devs with this info.

In the meantime you can set the '$cnrnd' variable to 'true' in the file 'egw-pear/HTTP/WebDAV/Server.php'.

I'll let this bug open to track the eGw devs answer and keep you informed.

Cheers,
Grégory
Comment 2 joost 2011-02-01 19:35:20 UTC
Hi Grégory,

Thank you for your reply.
I did the change as mentioned in my eGroupware installation and it is now working correctly.

Many thanks,

Joost
Comment 3 Wolfram 2011-02-15 20:54:33 UTC
Hi Grégory,

in the moment I'm testing webdav under opensuse 11.3 the very new PIM 4.6 repo. Did the change under EGW 1.8 as you mentioned (...set the '$cnrnd' variable to 'true'....). Seems it woks fine now.

Thank You!!!

Wolf
Comment 4 Luis Silva 2011-05-21 18:08:39 UTC
This is also hapenning with google. Is this the same problem?
Comment 5 Grégory Oestreicher 2011-05-23 09:11:11 UTC
Hi Luis,

The issue with Google calendars is tracked here: https://bugs.kde.org/show_bug.cgi?id=272319 (it's now fixed).

Cheers,
Grégory
Comment 6 Ralf Becker 2011-06-13 11:15:09 UTC
Hi Grégory,

this should be fixed with r35280-2 in all EGroupware branches in SVN, with the following fix:

Index: inc/class.groupdav.inc.php
===================================================================
--- inc/class.groupdav.inc.php	(Revision 35281)
+++ inc/class.groupdav.inc.php	(Arbeitskopie)
@@ -134,6 +134,7 @@
 		{
 			case 'kde':	// KAddressbook (at least in 3.5 can NOT subscribe / does NOT find addressbook)
 				$this->client_require_href_as_url = true;
+				$this->cnrnd = true; // Akonadi seems to require redundant namespaces, see KDE bug #265096 https://bugs.kde.org/show_bug.cgi?id=265096
 				break;
 			case 'cfnetwork':	// Apple addressbook app
 			case 'dataaccess':	// iPhone addressbook

Fix will be part of tomorrows daily 1.8 snapshot and the next maintenance release.

Ralf
Comment 7 Grégory Oestreicher 2011-06-14 19:50:35 UTC
Hi,

This issue is now fixed in eGroupware (see Ralf's message), and I confirm that I no longer can reproduce the issue.

Cheers,
Grégory
Comment 8 Egbert König 2012-01-12 10:54:42 UTC
(In reply to comment #6)
> Hi Grégory,
> 
> this should be fixed with r35280-2 in all EGroupware branches in SVN, with the
> following fix:
> 
> Index: inc/class.groupdav.inc.php
> ===================================================================
> --- inc/class.groupdav.inc.php    (Revision 35281)
> +++ inc/class.groupdav.inc.php    (Arbeitskopie)
> @@ -134,6 +134,7 @@
>          {
>              case 'kde':    // KAddressbook (at least in 3.5 can NOT subscribe
> / does NOT find addressbook)
>                  $this->client_require_href_as_url = true;
> +                $this->cnrnd = true; // Akonadi seems to require redundant
> namespaces, see KDE bug #265096 https://bugs.kde.org/show_bug.cgi?id=265096
>                  break;
>              case 'cfnetwork':    // Apple addressbook app
>              case 'dataaccess':    // iPhone addressbook
> 
> Fix will be part of tomorrows daily 1.8 snapshot and the next maintenance
> release.
> 
> Ralf

Although the above fix is installed in my system, I needed to do the change suggeseted in comment #1 before kadressbook could use the eGroupware address source. Might get_handler() return something else than "kde", e.g. "kde4"? System is openSuSE 12.1 x86_64, eGroupware-1.8.002-20111111 from openSuSE Build Service.

Egbert
Comment 9 Silver Salonen 2012-02-22 08:29:26 UTC
I can't get it working. I have eGroupware 1.8.002 and I confirmed I have the line from the patch above. I also tried setting $cnrnd to true in egw-pear/HTTP/WebDAV/Server.php. I still get Akonadi's error "Unable to fetch item from backend".

From akonadiconsole debugging:

KAddressBook::GlobalContactSession (0xa25a40) * 265 264 (NAME "Addressbook silver" MIMETYPE (text/directory) REMOTEID "https://myegroupware/groupdav.php/addressbook/" REMOTEREVISION "" RESOURCE "akonadi_davgroupware_resource_0" MESSAGES 13 UNSEEN 13 SIZE 2073 CACHEPOLICY (INHERIT true INTERVAL 10 CACHETIMEOUT -1 SYNCONDEMAND false LOCALPARTS ()) ANCESTORS ((264 "akonadi_davgroupware_resource_0") (0 "")) ENTITYDISPLAY "(\"\" \"view-pim-contacts\" \"\" ())" AccessRights "a" davprotocol "1") 
KAddressBook::GlobalContactSession (0xa25a40) * 264 0 (NAME "akonadi_davgroupware_resource_0" MIMETYPE (inode/directory) REMOTEID "akonadi_davgroupware_resource_0" REMOTEREVISION "" RESOURCE "akonadi_davgroupware_resource_0" MESSAGES 0 UNSEEN 0 SIZE 0 CACHEPOLICY (INHERIT false INTERVAL 10 CACHETIMEOUT -1 SYNCONDEMAND false LOCALPARTS ()) ANCESTORS ((0 "")) ENTITYDISPLAY "(\"eGroupware\" \"folder-remote\" \"\" ())") 
KAddressBook::GlobalContactSession (0xa25a40) 4 OK List completed 
KAddressBook::GlobalContactSession (0xa25a40) 5 SELECT SILENT 1 
KAddressBook::GlobalContactSession (0xa25a40) 5 OK Completed 
KAddressBook::GlobalContactSession (0xa25a40) 6 FETCH 1:* FULLPAYLOAD ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME ATR:ENTITYDISPLAY) 
KAddressBook::GlobalContactSession (0xa25a40) 6 OK FETCH completed 
KAddressBook::GlobalContactSession (0xa25a40) 7 SELECT SILENT 268 
KAddressBook::GlobalContactSession (0xa25a40) 7 OK Completed 
KAddressBook::GlobalContactSession (0xa25a40) 8 FETCH 1:* FULLPAYLOAD ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME ATR:ENTITYDISPLAY) 
KAddressBook::GlobalContactSession (0xa25a40) 8 OK FETCH completed 
KAddressBook::GlobalContactSession (0xa25a40) 9 SELECT SILENT 264 
KAddressBook::GlobalContactSession (0xa25a40) 9 OK Completed 
KAddressBook::GlobalContactSession (0xa25a40) 10 FETCH 1:* FULLPAYLOAD ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME ATR:ENTITYDISPLAY) 
KAddressBook::GlobalContactSession (0xa25a40) 10 OK FETCH completed 
KAddressBook::GlobalContactSession (0xa25a40) 11 SELECT SILENT 265 
KAddressBook::GlobalContactSession (0xa25a40) 11 OK Completed 
KAddressBook::GlobalContactSession (0xa25a40) 12 FETCH 1:* FULLPAYLOAD ANCESTORS INF EXTERNALPAYLOAD (UID REMOTEID REMOTEREVISION COLLECTIONID FLAGS SIZE DATETIME ATR:ENTITYDISPLAY) 
KAddressBook::GlobalContactSession (0xa25a40) 12 NO Unable to fetch item from backend
Comment 10 Silver Salonen 2012-04-20 11:28:18 UTC
It seems to be working in KDE 4.8.2. I haven't touched egw meanwhile though.