[Help] Is it DAVdroid or is it me? All contacts not syncing

I selfhost Nextcloud 13.0.2 on a linux box. I synchronise to a MacBook running 10.11.6 and attempt to synchronise to 2 Android devices (running 7.1 and 8.0 respectively)

As others have experienced, DAVdroid had always hit the 504 wall when trying to sync more than a few contacts (in my case, I have 197). This is in spite of having increased my timeouts and enabling apc. As a result, I had given up on trying to my contacts synchronised over all of my devices; I simply kept ā€œlocalā€ copies on each device.

Tried to give it another shot today. Different results but still no joy.

A few hours ago I exported all of my individual vcf cards from the server to a safe directory on my laptop before deleting all contacts on the Nextcloud instance as well as on the 2 android devices and on the MacBook.

I had then imported batches of 10-15 vcards from the safe directory back into the Nextcloud server contact app. Immediately after each import, I ran DAVdroid on the first Android device. Each new batch of contacts synced successfully to the Droid. The same contacts also synced successfully to my Contacts app on the MacBook. At one point I hadnā€™t ran Davdroid after a particular batch import. I only remembered to do so after a subsequent import. Thatā€™s the point at which the troubles began again. The sync to the Android device simply wouldnā€™t complete. I was only able to cumulatively load 107 contacts onto the Droid. On the other hand, all 197 contacts had synced to the MacBook without a problem. Furthermore, when I tried to sync the second Android device after loading all of the contacts onto the Contact app on the server, it timed-out at only 30 contacts.

This is what Iā€™ve found in my log. My limited experience doesnā€™t enable me to see what the problem may be. Hopefully, somebody here might be so kind as to provide me with a clueā€¦

Sabre\DAV\Exception\NotAuthenticated: No public access to this resource., No ā€˜Authorization: Basicā€™ header found. Either the client didnā€™t send one, or the server is misconfigured, No ā€˜Authorization: Bearerā€™ header found. Either the client didnā€™t send one, or the server is mis-configured, No ā€˜Authorization: Basicā€™ header found. Either the client didnā€™t send one, or the server is misconfigured

  1. [internal function] Sabre\DAV\Auth\Plugin->beforeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
  2. /var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
  3. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 466: Sabre\Event\EventEmitter->emit(ā€˜beforeMethodā€™, Array)
  4. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
  5. /var/www/html/nextcloud/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
  6. /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
  7. /var/www/html/nextcloud/remote.php - line 164: require_once(ā€˜/var/www/html/nā€¦ā€™)
  8. {main}

Davdroid is working fine on our setups.
If you still have issues, make sure that:

  • youā€™re not using your password but an app-password for your davdroid setup
  • davdroid logs doesnā€™t display anything wrong

The devs need to emphasise that vCard version discrepancies or vCard corruption can lead to this problem.

I canā€™t remember how I had eventually solved the problem but, it had something to do with exporting all contacts from one source, deleting all others on the other devices and then, importing the first exported set into all devices (or, just running a sync - canā€™t remember). I did this a few times until I found a ā€œmasterā€ set which worked on all subsequent devices.