Contacts sync not working with macOS/iOS (Docker/Nginx/Redis/MariaDB)

Hi folks,

I am experiencing a really frustrating issue with Nextcloud 18 not syncing contacts from my Mac/iPhone to the server.

I installed the profile on my iPhone and Mac to make sure it was configured correctly on the client side. I have no other contacts accounts on either device.

When I swipe down to refresh I set a lot of PROPFIND requests in the logs but no PUT/POST requests.

I tried exporting all my contacts, deleting all saved locally, adding the NC account, and then importing them, but that didn’t work.

I also tried importing them via the web GUI but then they didn’t sync down to the contacts app.

I’m just lost. Any ideas?

Notes:

  • Everything else works great (file sync, CalDAV, etc)
  • I have object storage configured with S3 as primary but I’ve also tested another dockerized instance with this same issue that uses the local disk.

My setup:

Docker-compose:

version: '3.7'

services:
  mariadb:
    image: mariadb
    restart: unless-stopped
    networks:
      - nextcloud_db_net
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_DATABASE: 'nextcloud'
      MYSQL_RANDOM_ROOT_PASSWORD: 'true'
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}

  redis:
    image: redis
    restart: unless-stopped
    networks:
      - cache_net

  nextcloud:
    image: nextcloud:18
    restart: unless-stopped
    depends_on:
      - mariadb
      - redis
    networks:
      - nextcloud_db_net
      - reverse_proxy
      - cache_net
    volumes:
      - ./nextcloud:/var/www/html/
    environment:
      REDIS_HOST: 'redis'
      MYSQL_HOST: 'mariadb:3306'
      MYSQL_DATABASE: 'nextcloud'
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      OVERWRITEPROTOCOL: 'https'

  nginx:
    image: nginx
    depends_on:
      - nextcloud
    restart: unless-stopped
    networks:
      - reverse_proxy
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - ./etc/letsencrypt:/etc/letsencrypt
      - ./nginx:/etc/nginx

networks:
  nextcloud_db_net:
  reverse_proxy:
  cache_net:

Nginx config:

server {  
  listen              80;
  server_name         sub.domain.tld;
  return              301 https://$server_name$request_uri;
}

server {  
    add_header Strict-Transport-Security "max-age=63072000; preload";    
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name         sub.domain.tld;

    ssl_certificate /etc/letsencrypt/live/sub.domain.tld/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/sub.domain.tld/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;


    location / {
    proxy_set_header  Host                $host;
    proxy_set_header  X-Forwarded-Proto   $scheme;
    proxy_set_header  X-Real-IP           $remote_addr;
    proxy_set_header  X-Forwarded-For     $proxy_add_x_forwarded_for;
    proxy_pass                            http://nextcloud:80;
  }
}

config.php

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => false,
    'port' => 6379,
  ),
  'overwriteprotocol' => 'https',
  'instanceid' => 'oc841g6vdwc3',
  'passwordsalt' => 'salty',
  'secret' => 'super-secret-secret',
  'trusted_domains' => 
  array (
    0 => 'sub.domain.tld',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'trusted_proxies' => array('nginx'),
  'forwarded_for_headers' => array('HTTP_X_FORWARDED', 'HTTP_X_FORWARDED_FOR')
  'overwrite.cli.url' => 'https://sub.domain.tld',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'db-username',
  'dbpassword' => 'db-password',
  'installed' => true,
  'objectstore' => 
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => 'bucket-name',
      'autocreate' => true,
      'key' => 'key-here',
      'secret' => 'secret-key-here',
      'use_ssl' => true,
      'region' => 'region-of-choice',
    ),
  ),
  'maintenance' => false,
);

Docker log output:

nextcloud_1  | 172.23.0.3 - - [16/May/2020:22:46:28 +0000] "PROPFIND /.well-known/carddav HTTP/1.0" 301 833 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nginx_1      | 174.250.28.10 - - [16/May/2020:22:46:28 +0000] "PROPFIND /.well-known/carddav HTTP/1.1" 301 363 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nginx_1      | 174.250.28.10 - - [16/May/2020:22:46:28 +0000] "PROPFIND /.well-known/carddav HTTP/1.1" 301 363 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nextcloud_1  | 172.23.0.3 - - [16/May/2020:22:46:28 +0000] "PROPFIND /.well-known/carddav HTTP/1.0" 301 833 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nginx_1      | 174.250.28.10 - - [16/May/2020:22:46:29 +0000] "PROPFIND / HTTP/1.1" 405 0 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nextcloud_1  | 172.23.0.3 - - [16/May/2020:22:46:28 +0000] "PROPFIND / HTTP/1.0" 405 1423 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nginx_1      | 174.250.28.10 - noahsbwilliams [16/May/2020:22:46:29 +0000] "PROPFIND /remote.php/dav/files/noahsbwilliams/ HTTP/1.1" 207 395 "-" "Mozilla/5.0 (Macintosh) mirall/2.6.4stable (build 20200303) (Nextcloud)"
nextcloud_1  | 172.23.0.3 - noahsbwilliams [16/May/2020:22:46:29 +0000] "PROPFIND /remote.php/dav/files/noahsbwilliams/ HTTP/1.0" 207 1129 "-" "Mozilla/5.0 (Macintosh) mirall/2.6.4stable (build 20200303) (Nextcloud)"
nginx_1      | 174.250.28.10 - - [16/May/2020:22:46:29 +0000] "PROPFIND / HTTP/1.1" 405 0 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nextcloud_1  | 172.23.0.3 - - [16/May/2020:22:46:28 +0000] "PROPFIND / HTTP/1.0" 405 1417 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nginx_1      | 174.250.28.10 - - [16/May/2020:22:46:29 +0000] "PROPFIND /principals/ HTTP/1.1" 405 0 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"
nextcloud_1  | 172.23.0.3 - - [16/May/2020:22:46:29 +0000] "PROPFIND /principals/ HTTP/1.0" 405 1413 "-" "iOS/13.4.1 (17E262) dataaccessd/1.0"