Problem with contact sync with owncloud



  • Hi,

    At first, sorry if my English is bad because I'm french and my english isn't very good ...
    I use Davdroid on my Nexus 6 because this application allows contacts and calendar sync.
    Recently, I have a problem lonely with contacts sync but I don't know if cause of davdroid update (to 0.8.4) or owncloud update ( 8.1.1).
    When I try to sync contacts with my owncloud account, nothing happening ... however calendar sync works fine (with the same account).
    My girl friend use another account on the same owncloud server but with old davdroid version (0.8.3) and all works fine (calendars and contacts). I haven't dared to update davdroid on her phone in case the new davdroid version is the problem. (on her phone, I can see in davdroid settings "Vcard 4.0 support" isn't check whereas on my phone the same setting is check and I can't unckeck this)

    When I try syncing contact on my nexus 6, davdroid load and no date to last synchronisation is display and I have this log on adb logcat :

    V/davdroid.URIUtils(28186): Normalized URI /owncloud/remote.php/carddav/addressbooks/MyNickName/contacts/ -> /remote.php/carddav/addressbooks/MyNickName/contacts/ assuming that it was an URI or path name
    D/davdroid.WebDavResource(28186): Processing multi-status element: https://MyDomainNameServer/remote.php/carddav/addressbooks/MyNickname/contacts/
    V/davdroid.URIUtils(28186): Normalized URI /remote.php/carddav/addressbooks/MyNickName/contacts/6aef88f2-f777-4c96-b664-a728e7e45c2e.vcf -> /remote.php/carddav/addressbooks/MyNickName/contacts/6aef88f2-f777-4c96-b664-a728e7e45c2e.vcf assuming that it was an URI or path name
    D/davdroid.WebDavResource(28186): Processing multi-status element: https://MyDomainNameServer/remote.php/carddav/addressbooks/MyNickName/contacts/6aef88f2-f777-4c96-b664-a728e7e45c2e.vcf
    V/davdroid.URIUtils(28186): Normalized URI /remote.php/carddav/addressbooks/MyNickName/contacts/f292bc19-d7ea-4a95-bbcb-4c92e98bb97d.vcf -> /remote.php/carddav/addressbooks/MyNickName/contacts/f292bc19-d7ea-4a95-bbcb-4c92e98bb97d.vcf assuming that it was an URI or path name
    D/davdroid.WebDavResource(28186): Processing multi-status element: https://MyDomainNameServer/remote.php/carddav/addressbooks/MyNickName/contacts/f292bc19-d7ea-4a95-bbcb-4c92e98bb97d.vcf
    .
    .
    .
    I/davdroid.SyncManager(28186): Fetching 73 new remote resource(s)
    I/davdroid.resource(28186): Multi-getting 35 remote resource(s)
    I/HttpClient(28186): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to HttpRoute[{s}->https://MyDomainNameServer:443]: The target server failed to respond
    I/HttpClient(28186): Retrying request to HttpRoute[{s}->https://MyDomainNameServer:443]
    I/HttpClient(28186): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to HttpRoute[{s}->https://MyDomainNameServer:443]: The target server failed to respond
    I/HttpClient(28186): Retrying request to HttpRoute[{s}->https://MyDomainNameServer:443]
    I/HttpClient(28186): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to HttpRoute[{s}->https://MyDomainNameServer:443]: The target server failed to respond
    I/HttpClient(28186): Retrying request to HttpRoute[{s}->https://MyDomainNameServer:443]
    E/davdroid.DavSyncAdapter(28186): I/O error (Android will try again later)
    E/davdroid.DavSyncAdapter(28186): org.apache.http.NoHttpResponseException: MyDomainNameServer:443 failed to respond
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.io.AbstractMessageParserHC4.parse(AbstractMessageParserHC4.java:260)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:161)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:153)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:284)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:126)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:260)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:178)
    E/davdroid.DavSyncAdapter(28186): 	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    E/davdroid.DavSyncAdapter(28186): 	at at.bitfire.davdroid.webdav.WebDavResource.multiGet(WebDavResource.java:237)
    E/davdroid.DavSyncAdapter(28186): 	at at.bitfire.davdroid.resource.WebDavCollection.multiGet(WebDavCollection.java:112)
    E/davdroid.DavSyncAdapter(28186): 	at at.bitfire.davdroid.syncadapter.SyncManager.pullNew(SyncManager.java:195)
    E/davdroid.DavSyncAdapter(28186): 	at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:95)
    E/davdroid.DavSyncAdapter(28186): 	at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:138)
    E/davdroid.DavSyncAdapter(28186): 	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    I/davdroid.DavSyncAdapter(28186): Sync complete for com.android.contacts
    D/davdroid.DavSyncAdapter(28186): Closing httpClient
    

    And on my owncloud server, I have this Log :

    {"reqId":"mkif0jq7QPftajppgxOL","remoteAddr":"ConfidentialIpAddress","app":"core","mess
    age":"Adding default user backend PWAUTH.","level":0,"time":"2015-09-13T11:11:1
    9+00:00","method":"PROPFIND","url":"\/remote.php\/carddav\/addressboo
    ks\/MyNickName\/contacts\/"}
    {"reqId":"bTUxcVO6v4pk5ugTW6cE","remoteAddr":"ConfidentialIpAddress","app":"core","mess
    age":"Adding default user backend PWAUTH.","level":0,"time":"2015-09-13T11:11:2
    0+00:00","method":"PROPFIND","url":"\/remote.php\/carddav\/addressboo
    ks\/MyNickName\/contacts\/"}
    {"reqId":"LYGculWqnRbTwqnI5i\/s","remoteAddr":"ConfidentialIpAddress","app":"core","mes
    sage":"Adding default user backend PWAUTH.","level":0,"time":"2015-09-13T11:11:
    22+00:00","method":"REPORT","url":"\/remote.php\/carddav\/addressbook
    s\/MyNickName\/contacts\/"}
    {"reqId":"wfAs4mGaiTDgFRzGXAnr","remoteAddr":"ConfidentialIpAddress","app":"core","mess
    age":"Adding default user backend PWAUTH.","level":0,"time":"2015-09-13T11:11:2
    3+00:00","method":"REPORT","url":"\/remote.php\/carddav\/addressbooks
    \/MyNickName\/contacts\/"}
    {"reqId":"G\/ZFE3R6zmql6q7BlURm","remoteAddr":"ConfidentialIpAddress","app":"core","mes
    sage":"Adding default user backend PWAUTH.","level":0,"time":"2015-09-13T11:11:
    23+00:00","method":"REPORT","url":"/remote.php\/carddav\/addressbook
    s\/MyNickName\/contacts\/"}
    {"reqId":"Y\/8Ce1OGXEEGldqDkBHP","remoteAddr":"ConfidentialIpAddress","app":"core","mes
    sage":"Adding default user backend PWAUTH.","level":0,"time":"2015-09-13T11:11:
    24+00:00","method":"REPORT","url":"/remote.php\/carddav\/addressbook
    s\/MyNickName\/contacts\/"}
    
    

    I have try with another contacts sync application like "carddav sync free" on playstore and it's work fine ... it's very weird ....
    For days now, I'm looking for a solution but I can't find it ... Anyone can help me ?

    Thanks


  • admin

    Are you maybe affected from an Owncloud bug mentioned here?

    https://forums.bitfire.at/topic/689/owncloud-losing-contacts-after-sync-since-davdroid-0-8-1/45

    Please try to change in OC: apps/contacts/lib/carddav/backend.php
    replace **'uri' => urlencode($contact['uri']), **
    by 'uri' => $contact['uri'],

    A patch for this has been submitted already to OC but it's not released yet.



  • Sorry for my late answer ...
    I just tried but contacts sync doesn't work again.
    Moreover, I have this problem just with some users. Don't you think if my owncloud installation is affected by a bug, all users would have the same problem ?


  • admin

    did you change the urlencode?

    maybe there are some contacts that are stored with some weird/illegal characters in the vcf file or so...



  • Yes, I have changed urlencode but no effect.
    I have no contacts which sync ...
    Sooner, before upgrade davdroid and owncloud I had no problem.
    It's very weird ...



  • Hi,
    I have a new informations about my problem.
    I saw vcard 4.0 support is adding to davdroid in 0.7.5 version.
    I tried to download an old version without vcard 4.0 (0.7.4) and i tried to sync my contacts on my owncloud ... It's a success !
    Thus my problem is vcard 4.0 support but i can't disable it on the last version of davdroid or on owncloud ...
    Anyone know how disables vcard 4.0 on davdroid or on owncloud please ?


  • admin

    @tigermick owncloud doesn't have an option to disable vcard4 nor does davdroid have such an option :-/ in order to get both to work you'd need to fix the owncloud bug that generates vcards with invalid characters. Can you look in the owncloud forum how this can be repaired... It doesn't have something to do with DAVdroid I think.


Log in to reply
 

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