Calendar gets synchronized, but Contacts don't (OC 7)

  • Hello!

    After updating to the latest version of DAVdroid, I’ve been having problems with my address book. While calendar synchronization works flawless, contacts just aren’t synchronized. Reinstalling DAVdroid did not resolve the issue. The server is running the latest version of ownCloud 7.

    I’d appreciate any suggestions. 🙂

    Let me post the log I got:

    Synchronization phase: 7
    Account name: [name]
    REPORT https://[server]/remote.php/carddav/addressbooks/[name]/contacts/
    Content-Length: 184
    Content-Type: application/xml; charset=utf-8
    Depth: 1
    <?xml version='1.0' encoding='UTF-8' ?><CARD:addressbook-query xmlns="DAV:" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><getetag /></prop><CARD:filter /></CARD:addressbook-query>
    http/1.1 500 Internal Server Error
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Connection: close
    Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *
    Content-Type: text/html; charset=utf-8
    Date: Thu, 22 Oct 2015 08:46:23 GMT
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    OkHttp-Received-Millis: 1445503583748
    OkHttp-Selected-Protocol: http/1.1
    OkHttp-Sent-Millis: 1445503581823
    Pragma: no-cache
    Server: Apache/2.2.22 (Ubuntu)
    Set-Cookie: oca1b99cf975=d3baigk87kbe3vbd1jmg43k1c3; path=/; HttpOnly
    Set-Cookie: oca1b99cf975=emffe91vhpj00655odh0aj1eg1; path=/; secure; HttpOnly
    Strict-Transport-Security: max-age=63072000; includeSubDomains
    Strict-Transport-Security: max-age=31536000
    Vary: Accept-Encoding
    X-Content-Type-Options: nosniff
    X-Frame-Options: Sameorigin
    X-Powered-By: PHP/5.3.10-1ubuntu3.20
    X-Robots-Tag: none
    X-XSS-Protection: 1; mode=block
    at.bitfire.dav4android.exception.HttpException: 500 Internal Server Error
    at.bitfire.dav4android.exception.HttpException: 500 Internal Server Error
    	at at.bitfire.dav4android.DavResource.checkStatus(
    	at at.bitfire.dav4android.DavResource.checkStatus(
    	at at.bitfire.dav4android.DavAddressBook.addressbookQuery(
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.listRemote(
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(
    	at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(
    	at android.content.AbstractThreadedSyncAdapter$
    DAVdroid version: (81) Thu Oct 22 10:25:24 MESZ 2015
    Installed from: Google Play Store
    JB Workaround installed: no
    System-wide synchronization: automatically
    Android version: 5.1.1 (klte-userdebug 5.1.1 LMY48W f3b4ed107c test-keys)
    Device: samsung / Samsung Galaxy S5 (klte)

    [edited by admin: added ``` prefix/postfix so that logs are monospace]

    Thanks in advance,

  • I’ve got the same error.

    Same DAVDroid Version, from Playstore.

    Not shure about the OC version, but definitely 7 or even older.

  • Same for me : Calendar ok but Contact no sync…

  • developer

    Your OwnCloud is defect. Please update to a recent version.

  • Oups sorry I didn’t see it was about OwnCloud…
    I don’t use it but I have the same problem since the last update, so I will open my own topid…

  • It can’t be that defect, as it worked very well for more a year. Or could you give us a hint about what’s wrong with our OC version?

  • I, too, would rather downgrade to an earlier DAVdroid version (which worked great) than upgrade ownCloud which I haven’t done yet for a couple of reasons…

    Would you happen to have any other suggestions?

  • developer

    Or could you give us a hint about what’s wrong with our OC version?

    As you can see from the debug logs, your server responds with 500 Internal Server Error to a REPORT addressbook-query request.

    I, too, would rather downgrade to an earlier DAVdroid version (which worked great) than upgrade ownCloud which I haven’t done yet for a couple of reasons…

    You’re of course free to use any DAVdroid version you want 🙂

    Would you happen to have any other suggestions?

    DAVdroid has an ugly fallback-hack that falls back to PROPFIND when a server responds with some defined HTTP error codes (like 400 Bad Request and 403 Forbidden) to REPORT addressbook-query. This ugly fallback-hack will now be activated for the following status codes (on REPORT addressbook-query😞

    • 400 Bad Request – this is what a server sends when it thinks the REPORT is invalid
    • 403 Forbidden – some servers refuse the empty <filter/> and say that it’s not a supported filter type, so the correct response code for that is 403
    • 500 Internal Server Error – some servers (like yours) just don’t know what to do and return an “all-catch” error
    • 501 Not Implemented – that would be the right error code for a server that knows it MUST support REPORT addressbook-query, but it’s not implemented nevertheless.

    So, with this ugly fallback-hack in the next DAVdroid release, you will (hopefully) be able to sync again with your OwnCloud 7 installations – but that doesn’t change anything about the fact that they’re defect.

  • @rfc2822 thank you very much for this detailed explanation and for the bugfix.

  • developer

    Should have been worked around by DAVdroid, can you please confirm?

  • It works! 👍

    Thank you very much for the quick fix! 🙂

  • Doesn’t work for me yet…

    [info ] Preparing synchronization
    [info ] Querying capabilities
    [debug] Received <response> for http://...../owncloud/remote.php/carddav/addressbooks/deep/default/, status: null, properties: [getctag( GetCTag(cTag=1540),
    supported-address-data(urn:ietf:params:xml:ns:carddav): null]
    [info ] Server advertises VCard/4 support: false
    [info ] Processing locally deleted entries
    [info ] Locally preparing dirty entries
    [info ] Uploading dirty entries
    [info ] Checking sync state
    [info ] Manual sync, ignoring CTag
    [info ] Listing local entries
    [info ] Listing remote entries
    [info ] Comparing local/remote entries
    [info ] Downloading remote entries
    [info ] Downloading 0 contacts (10 at once)
    [info ] Saving sync state
    [info ] Saving CTag=1540

    Edit: added ``` to make logs monospace…

  • developer

    @studerap It seems that your server tells DAVdroid there are 0 contacts. Please take verbose logs and post them as a snippet or something similar.

Similar topics