CardDAV with SOGo, no contacts synced to phone - 0 contacts


  • I’ve (finally) upgraded my phone from Lineage 14.1 to 18.1.

    In Android 11, CardDAV-Sync and CalDAV-Sync as used before don’t really work anymore, so I was very happy to find DAVx5.

    It detects my calendar and address books on my SOGo server perfectly, I can check them and after pressing the sync button, the sync bar shows progress for a little while.

    Calendar events seem to sync correctly, syncing them also takes an appropriate amount of time, corresponding to their number.

    Syncing contacts appears successful, it is very quick though and looking at both the created contacts account “(account@address bg)” and at DAVx5’s log, it is convinced that the contacts collection contains 0 entries.

    I’ve been syncing the “old version” of the same phone flawlessly using CardDAV-Sync, and am syncing against Thunderbird desktop clients and the likes, using the same DAV URLs as shown in DAVx5’s log.

    Neither the log nor adb logcatshow obvious hints what could be going wrong.

    How can I figure this out and have working contact sync back?


  • @jmbreuer I’m following this up and having a look at the logs in SOGo:

    2021-06-17 07:13:58.442 sogod[19121] -[WEClientCapabilities initWithRequest:]: Unknown WebClient: user-agent='DAVx5/3.3.11-ose (2021/06/02; dav4jvm; okhttp/4.9.1) Android/11'
    127.0.0.1 - - [17/Jun/2021:07:13:58 GMT] "PROPFIND /SOGo/dav/jmbreuer/Contacts/personal/ HTTP/1.1" 207 416/296 0.007 1052 60% 0
    2021-06-17 07:13:58.587 sogod[19121] -[WEClientCapabilities initWithRequest:]: Unknown WebClient: user-agent='DAVx5/3.3.11-ose (2021/06/02; dav4jvm; okhttp/4.9.1) Android/11'
    127.0.0.1 - - [17/Jun/2021:07:13:58 GMT] "REPORT /SOGo/dav/jmbreuer/Contacts/personal/ HTTP/1.1" 207 12742/151 0.046 136475 90% 1M
    

    These are the only requests that make it to the server when I sync a freshly-created account in DAVx5, right after I check only the contacts collection’s sync box.

    It doesn’t appear much, considering that the first sync should transfer the complete address book (464 contacts according to Thunderbird).

    … digging into this further, looking at full transfer traces - next, I’ll have to figure out how to deal with the gzip HTTP continuations; or temporarily disable gzip somehow so I can see what’s going on.


  • @jmbreuer Looking at the traces, I see DAVx5 getting a reply to REPORT on https://server/SOGo/dav/user/Contacts/personal/ that looks about like this (formatted, anonymized, only first few entries shown):

    <?xml version="1.0" encoding="utf-8"?>
    <D:multistatus xmlns:D="DAV:">
      <D:sync-response>
        <D:href>/SOGo/dav/user/Contacts/personal/A5xxxxxx-FAE0-0001-38FC-2D1016211DCC.vcf</D:href>
        <D:status>HTTP/1.1 201 Created</D:status>
        <D:propstat>
          <D:prop>
            <D:getetag>"gcs00000000"</D:getetag>
          </D:prop>
          <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
      </D:sync-response>
      <D:sync-response>
        <D:href>/SOGo/dav/user/Contacts/personal/A5xxxxxx-FB00-0001-14B9-17B01B8013D0.vcf</D:href>
        <D:status>HTTP/1.1 201 Created</D:status>
        <D:propstat>
          <D:prop>
            <D:getetag>"gcs00000000"</D:getetag>
          </D:prop>
          <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
      </D:sync-response>
      <D:sync-response>
        <D:href>/SOGo/dav/user/Contacts/personal/A5xxxxxx-FB10-0001-415F-1521170012A5.vcf</D:href>
        <D:status>HTTP/1.1 201 Created</D:status>
        <D:propstat>
          <D:prop>
            <D:getetag>"gcs00000000"</D:getetag>
          </D:prop>
          <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
      </D:sync-response>
    </D:multistatus>
      ...
    

    This goes on for a plausible number of entries.

    But DAVx5 never requests those entries, after this REPORT / its response, there is no further request / communication from DAVx5.

    How is sync in DAVx5 supposed to work? How does it traverse from the collection to the entries? What could be causing this?


  • @jmbreuer finally managed to get logs from DAVx5 - when I tried before, the “Logs” box underneath “Debug info” was not showing up.

    This is a log starting with a completely empty DAVx5, adding my account (via URL), checking only the CardDAV address book and tapping the sync button on the bottom of the screen:

    https://docs.google.com/document/d/1HSWWr3gLf5cPf6yx9JUT0OCloghkZmocPo14mNX2O9s/edit?usp=sharing

    The thing that stands out to me is the “[syncadapter.SyncAdapterService] Sync thread cancelled! Interrupting sync” when I’m just letting the thing run it’s first round - race condition? It looks a bit like after the interrupted sync, DAVx5 assumes that first interrupted sync worked and only takes diffs from then.?

Similar topics