Unable to sync contacts



  • Hi,

    I try syncing my ownCloud contacts with the latest davdroid. Using logcat I found that the connection to the server actually works, as I can see that three contacts actually get transferred. However, there is a total of 55 contacts and even the 3 I see in logcat never show up in the contacts app. I will attach a slightly edited log (tag:davdroid with just all the personal data replaced with xxxx, yyyy and zzzz for the 3 subjects).



  • 11-12 22:22:13.406 I/davdroid.DavSyncAdapter(23377): Performing sync for authority com.android.calendar
    11-12 22:22:13.422 I/davdroid.DavSyncAdapter(23377): Performing sync for authority com.android.contacts
    11-12 22:22:13.453 I/davdroid.WebDavResource(23377): Using preemptive Basic Authentication
    11-12 22:22:13.469 I/davdroid.SyncManager(23377): Remotely removing 0 deleted resource(s) (if not changed)
    11-12 22:22:13.484 I/davdroid.SyncManager(23377): Uploading 0 new resource(s) (if not existing)
    11-12 22:22:13.555 I/davdroid.SyncManager(23377): Uploading 0 modified resource(s) (if not changed)
    11-12 22:22:13.555 I/davdroid.SyncManager(23377): Synchronization forced
    11-12 22:22:13.555 I/davdroid.SyncManager(23377): Fetching remote resource list
    11-12 22:22:13.633 D/davdroid.HttpPropfind(23377): Prepared PROPFIND request: <propfind xmlns="DAV:">
    11-12 22:22:13.633 D/davdroid.HttpPropfind(23377):    <prop>
    11-12 22:22:13.633 D/davdroid.HttpPropfind(23377):       <CS:getctag xmlns:CS="http://calendarserver.org/ns/"/>
    11-12 22:22:13.633 D/davdroid.HttpPropfind(23377):       <getetag/>
    11-12 22:22:13.633 D/davdroid.HttpPropfind(23377):    </prop>
    11-12 22:22:13.633 D/davdroid.HttpPropfind(23377): </propfind>
    11-12 22:22:14.320 D/davdroid.WebDavResource(23377): Received multistatus response: <?xml version="1.0" encoding="utf-8"?>
    11-12 22:22:14.320 D/davdroid.WebDavResource(23377): <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav"><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/</d:href><d:propstat><d:prop><x3:getctag xmlns:x3="http://calendarserver.org/ns/">1384291187</x3:getctag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><d:getetag/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/20131110T182444.1384107884%2540myserver.com.vcf</d:href><d:propstat><d:prop><d:getetag>"5215026763599326b6fe5bb42d2b65e2"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><x3:getctag xmlns:x3="http://calendarserver.org/ns/"/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/20131110T182445.1384107885%2540myserver.com.vcf</d:href><d:propstat><d:prop><d:getetag>"6312038d1a2727a5c0e142f969a113dd"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><x3:getctag xmlns:x3="http://calendarserver.org/ns/"/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/20131110T182446.1384107886%2540myserver.com.vcf</d:href><d:propstat><d:prop><d:getetag>"d722132719d3d03a41706326de555ce7"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><x3:getctag xmlns:x3="http://calendarserver.org/ns/"/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus>
    11-12 22:22:14.375 I/davdroid.SyncManager(23377): Adding 3 remote resource(s)
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): Received multistatus response: <?xml version="1.0" encoding="utf-8"?>
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav"><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/20131110T182446.1384107886%40myserver.com.vcf</d:href><d:propstat><d:prop><card:address-data>BEGIN:VCARD&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): VERSION:3.0&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): FN:yyyy&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): N:;yyyy;;;&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): TEL;TYPE=CELL:+yyyy&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): UID:20131110T182446.1384107886@myserver.com&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): REV:2013-11-12T21:19:46+00:00&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): PRODID:-//ownCloud//NONSGML Contacts 0.2.81//EN&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): CATEGORIES:Casual&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): END:VCARD&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): </card:address-data><d:getetag>"8356d8ca02c79ac5275c73ea37415f66"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/20131110T182444.1384107884%40myserver.com.vcf</d:href><d:propstat><d:prop><card:address-data>BEGIN:VCARD&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): VERSION:3.0&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): FN:xxxx xxxx&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): N:xxxx;xxxx;;;&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): EMAIL;TYPE=HOME:xxxx@web.de&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): TEL;TYPE=CELL:+xxxx&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): TEL;TYPE=HOME:+xxxx&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): BDAY:xxxx&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): UID:20131110T182444.1384107884@myserver.com&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): REV:2013-11-12T21:19:45+00:00&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): PRODID:-//ownCloud//NONSGML Contacts 0.2.81//EN&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): CATEGORIES:avb&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): EMAIL;TYPE=WORK:xxxx@xxxx.de&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): END:VCARD&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): </card:address-data><d:getetag>"b50913bc056c8217012ea0be32351d21"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/addressbooks/mimox/contacts/20131110T182445.1384107885%40myserver.com.vcf</d:href><d:propstat><d:prop><card:address-data>BEGIN:VCARD&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): VERSION:3.0&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): FN:zzzz&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): N:zzzz;zzzz;;;&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): TEL;TYPE=CELL:+zzzz&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): UID:20131110T182445.1384107885@myserver.com&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): REV:2013-11-12T21:19:46+00:00&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): PRODID:-//ownCloud//NONSGML Contacts 0.2.81//EN&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): CATEGORIES:Family&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): END:VCARD&#13;
    11-12 22:22:15.133 D/davdroid.WebDavResource(23377): </card:address-data><d:getetag>"4312d39fe68c717db8cc374936e6105f"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
    11-12 22:22:15.141 W/davdroid.URIUtils(23377): Tried to repair invalid URL/URL path: /remote.php/carddav/addressbooks/mimox/contacts/20131110T182446.1384107886@myserver.com.vcf -> /remote.php/carddav/addressbooks/mimox/contacts/20131110T182446.1384107886%40myserver.com.vcf
    11-12 22:22:15.148 W/davdroid.URIUtils(23377): Tried to repair invalid URL/URL path: /remote.php/carddav/addressbooks/mimox/contacts/20131110T182444.1384107884@myserver.com.vcf -> /remote.php/carddav/addressbooks/mimox/contacts/20131110T182444.1384107884%40myserver.com.vcf
    11-12 22:22:15.148 W/davdroid.URIUtils(23377): Tried to repair invalid URL/URL path: /remote.php/carddav/addressbooks/mimox/contacts/20131110T182445.1384107885@myserver.com.vcf -> /remote.php/carddav/addressbooks/mimox/contacts/20131110T182445.1384107885%40myserver.com.vcf
    11-12 22:22:15.477 I/davdroid.SyncManager(23377): Adding 20131110T182446.1384107886@myserver.com.vcf
    11-12 22:22:15.484 I/davdroid.SyncManager(23377): Adding 20131110T182444.1384107884@myserver.com.vcf
    11-12 22:22:15.484 I/davdroid.SyncManager(23377): Adding 20131110T182445.1384107885@myserver.com.vcf
    11-12 22:22:15.492 I/davdroid.LocalCollection(23377): Committing 13 operations
    11-12 22:22:15.867 I/davdroid.SyncManager(23377): Updating 0 remote resource(s)
    11-12 22:22:15.867 I/davdroid.SyncManager(23377): Removing resources that are missing remotely
    11-12 22:22:15.867 I/davdroid.LocalCollection(23377): Committing 1 operations
    

    edited formatting


  • developer

    Are you sure that this collection contains 55 records? The serverreturns only 3 vcfs for PROPFIND, as you can see in the logs. And they should be added into the address book because there is no error message. Did you set "Show addresses from DAVdroid" in your contact manager?



  • Yes, there should be 55 contacts.

    I cleared the address bock before trying to sync and it was set to show all contacts.


  • developer

    Does it work with other DAV clients?



  • I do not have another client at hand ATM but I googled a bit and found that accessing /remote.php/carddav/addressbooks/mimox/contacts should show me all my contacts. Guess what, I only get three here, too...

    But still I cannot get even those three to show up in the android contacts app.


  • developer

    Do you use Cyanogen with Privacy Guard?



  • I tested this on a Nexus 5 with stock 4.4 ROM, so no PG


  • developer

    "@" in URLs are invalid. 0.4.1 will have further improvements to repair such invalid URLs. Can you please try with 0.4.1 as soon as its out?



  • The "@" are encoded as %40 in the URLs...


  • developer

    Yes, the problem was in DAVdroid code – sometimes I have still used URI.getPath() that returns the "@" instead of getRawPath().

    Should be solved in 0.4.1



  • I cleared my address book and set up a new sync using 0.4.1 and indeed it displays some contacts now. Namely the same 5 contacts that I get on /remote.php/carddav/addressbooks/mimox/contacts. This means there have been two bugs, one on the client and one on the server side. The client side is fixed. Thanks a lot!


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.