Core: Carddav always returns a 403 saying sync token is invalid or unknown

Created on 19 Mar 2018  路  23Comments  路  Source: owncloud/core

Already searched and found no answer. Spotted this line in the log multiple times over again:

{"reqId":"FHyGsrrc72LGHjvRvnwY","level":4,"time":"2018-03-19T20:34:08+00:00","remoteAddr":"113.197.65.22","user":"michael.heuberger","app":"carddav","method":"REPORT","url":"\/remote.php\/carddav\/addressbooks\/michael.heuberger\/contacts\/","message":"Exception: {\"Message\":\"HTTP\\\/1.1 403 Invalid or unknown sync token\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InvalidSyncToken\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php(65): Sabre\\\\DAV\\\\Sync\\\\Plugin->syncCollection('addressbooks\\\/mi...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport))\\n#1 [internal function]: Sabre\\\\DAV\\\\Sync\\\\Plugin->Sabre\\\\DAV\\\\Sync\\\\{closure}('{DAV:}sync-coll...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport), 'addressbooks\\\/mi...')\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(718): Sabre\\\\Event\\\\EventEmitter->emit('report', Array)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpReport(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:REPORT', Array)\\n#7 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/carddav.php(85): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#10 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php\",\"Line\":123,\"User\":\"michael.heuberger\"}"}

My server config
config_report_20180319 (1).json.txt

Any clues what this could be?

Bug

Most helpful comment

The issue was marked "Duplicate" by Apple of issue 42566961. I don't have/get access to that issue but apparently they will update my ticket with the status of the original.

All 23 comments

GitMate.io thinks possibly related issues are https://github.com/owncloud/core/issues/10783 (CardDAV Sync: Sabre\DAV\Exception: Invalid result from updateProperties), https://github.com/owncloud/core/issues/18409 (PROPPATCH returns 403), https://github.com/owncloud/core/issues/16541 (Contact sync CardDAV issues), and https://github.com/owncloud/core/issues/27920 (Home folder unavailable after upgrade til version 10).

Same here. Client is macos 10.13.4 Contacts app.

Have same problem (?) with owncloud 10.0.10

Same sync problem and error on macOS Mojave (10.14.1) and ownCloud 10.0.10 syncing cardDAV with Contacts app.

Also see https://central.owncloud.org/t/owncloud-10-0-9-mac-os-x-10-13-6-high-sierra-problem-sync-contacts-carddav-v/15621

In my setup, the error is generated here:
https://github.com/sabre-io/dav/blob/3.2/lib/DAV/Sync/Plugin.php#L123

With modified logging, I see that self::SYNCTOKEN_PREFIX is 'http://sabre.io/ns/sync/' and $syncToken is '0ba8eaf8-0897-4a65-8e05-849145bfaf9a'

After removing & adding the account (through macOS System Preferences > Accounts > cardDAV) the following happens in the logfile (debug level 0)

  1. Add account (successfully)
{"reqId":"W@63iC0s2qdTNtrs6ztMwAAAAAM","level":0,"time":"2018-11-16T12:26:48+00:00","remoteAddr":"x.x.x.x","user":"--","app":"webdav","method":"OPTIONS","url":"\/remote.php\/dav\/principals\/users\/xxxxx","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#7 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}
{"reqId":"W@63iS0s2qdTNtrs6ztMxAAAAAk","level":0,"time":"2018-11-16T12:26:50+00:00","remoteAddr":"x.x.x.x","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#7 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}
  1. After some time (just waiting doing nothing)
{"reqId":"W@63qC0s2qdTNtrs6ztM5AAAABU","level":0,"time":"2018-11-16T12:27:21+00:00","remoteAddr":"x.x.x.x","user":"--","app":"webdav","method":"OPTIONS","url":"\/remote.php\/dav\/principals\/users\/xxxxx","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#7 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}
{"reqId":"W@63qi0s2qdTNtrs6ztM6AAAAAo","level":0,"time":"2018-11-16T12:27:22+00:00","remoteAddr":"x.x.x.x","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#7 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}
{"reqId":"W@63rS0s2qdTNtrs6ztM8AAAAAc","level":4,"time":"2018-11-16T12:27:25+00:00","remoteAddr":"x.x.x.x","user":"xxxxx","app":"webdav","method":"REPORT","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/Contactpersonen\/","message":"Exception: HTTP\/1.1 403 Invalid or unknown sync token: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InvalidSyncToken\",\"Message\":\"Invalid or unknown sync token\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php(65): Sabre\\\\DAV\\\\Sync\\\\Plugin->syncCollection('addressbooks\\\/us...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport))\\n#1 [internal function]: Sabre\\\\DAV\\\\Sync\\\\Plugin->Sabre\\\\DAV\\\\Sync\\\\{closure}('{DAV:}sync-coll...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport), 'addressbooks\\\/us...')\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(718): Sabre\\\\Event\\\\EventEmitter->emit('report', Array)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpReport(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:REPORT', Array)\\n#7 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#10 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#11 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php\",\"Line\":123}"}
{"reqId":"W@63ri0s2qdTNtrs6ztM8wAAAAA","level":4,"time":"2018-11-16T12:27:27+00:00","remoteAddr":"x.x.x.x","user":"xxxxx","app":"webdav","method":"REPORT","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/Contactpersonen\/","message":"Exception: HTTP\/1.1 403 Invalid or unknown sync token: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InvalidSyncToken\",\"Message\":\"Invalid or unknown sync token\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php(65): Sabre\\\\DAV\\\\Sync\\\\Plugin->syncCollection('addressbooks\\\/us...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport))\\n#1 [internal function]: Sabre\\\\DAV\\\\Sync\\\\Plugin->Sabre\\\\DAV\\\\Sync\\\\{closure}('{DAV:}sync-coll...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport), 'addressbooks\\\/us...')\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(718): Sabre\\\\Event\\\\EventEmitter->emit('report', Array)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpReport(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:REPORT', Array)\\n#7 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#10 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#11 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php\",\"Line\":123}"}
{"reqId":"W@63wy0s2qdTNtrs6ztNHwAAABI","level":4,"time":"2018-11-16T12:27:47+00:00","remoteAddr":"x.x.x.x","user":"xxxxx","app":"webdav","method":"REPORT","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/Contactpersonen\/","message":"Exception: HTTP\/1.1 403 Invalid or unknown sync token: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InvalidSyncToken\",\"Message\":\"Invalid or unknown sync token\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php(65): Sabre\\\\DAV\\\\Sync\\\\Plugin->syncCollection('addressbooks\\\/us...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport))\\n#1 [internal function]: Sabre\\\\DAV\\\\Sync\\\\Plugin->Sabre\\\\DAV\\\\Sync\\\\{closure}('{DAV:}sync-coll...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport), 'addressbooks\\\/us...')\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(718): Sabre\\\\Event\\\\EventEmitter->emit('report', Array)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpReport(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:REPORT', Array)\\n#7 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#10 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#11 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php\",\"Line\":123}"}
  1. After opening Contacts app:
{"reqId":"W@64dS0s2qdTNtrs6ztOUQAAAD8","level":0,"time":"2018-11-16T12:30:45+00:00","remoteAddr":"x.x.x.x","user":"--","app":"webdav","method":"OPTIONS","url":"\/remote.php\/dav\/principals\/users\/xxxxx","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#7 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}
{"reqId":"W@64di0s2qdTNtrs6ztOVQAAACE","level":0,"time":"2018-11-16T12:30:47+00:00","remoteAddr":"x.x.x.x","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#7 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}
{"reqId":"W@64dy0s2qdTNtrs6ztOVwAAADo","level":4,"time":"2018-11-16T12:30:48+00:00","remoteAddr":"x.x.x.x","user":"xxxxx","app":"webdav","method":"REPORT","url":"\/remote.php\/dav\/addressbooks\/users\/xxxxx\/Contactpersonen\/","message":"Exception: HTTP\/1.1 403 Invalid or unknown sync token: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InvalidSyncToken\",\"Message\":\"Invalid or unknown sync token\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php(65): Sabre\\\\DAV\\\\Sync\\\\Plugin->syncCollection('addressbooks\\\/us...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport))\\n#1 [internal function]: Sabre\\\\DAV\\\\Sync\\\\Plugin->Sabre\\\\DAV\\\\Sync\\\\{closure}('{DAV:}sync-coll...', Object(Sabre\\\\DAV\\\\Xml\\\\Request\\\\SyncCollectionReport), 'addressbooks\\\/us...')\\n#2 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\\n#3 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(718): Sabre\\\\Event\\\\EventEmitter->emit('report', Array)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpReport(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:REPORT', Array)\\n#7 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/lib\\\/Server.php(298): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#10 \\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/remote.php(165): require_once('\\\/home\\\/xxxxx\\\/dom...')\\n#11 {main}\",\"File\":\"\\\/home\\\/xxxxx\\\/domains\\\/xxx.xxxxx.xx\\\/public_html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Sync\\\/Plugin.php\",\"Line\":123}"}

After first successful sync, the sync does not work anymore! Even after changing a contact in ownCloud contacts, those changes are not synced to macOS Contacts.

I hope this helps...

Ok, final results of my research of today:

On macOS Mojave (10.14) the sync system issues the following for the REPORT http request:

<?xml version="1.0" encoding="UTF-8"?>
<A:sync-collection xmlns:A="DAV:">
  <A:sync-token>b905a5fd-ce23-4190-9be3-236969d071a8</A:sync-token>
  <A:sync-level>1</A:sync-level>
  <A:prop>
    <A:getetag/>
  </A:prop>
</A:sync-collection>

The cardDAV sync agent on my Android phone issues the following (which is supported)

<?xml version="1.0" encoding="utf-8" ?>
<D:sync-collection xmlns:D="DAV:">
<D:sync-token>http://sabre.io/ns/sync/2285</D:sync-token>
<D:sync-level>1</D:sync-level>
<D:prop>
<D:getcontenttype />
<D:getetag />
</D:prop>
</D:sync-collection>

So it seems in Mojave Apple has changed the way it requests REPORT statements and thus breaks the sync?

@joostdekeijzer It's the same with CalDav

I found out several weeks ago that Apple doesn't send credentials when using http

Are you guys using http or https?

I'm using https.

I used https://central.owncloud.org/t/owncloud-9-1-1-1-2-macos-sierra-carddav-not-working-solved/3481/18 to setup the account.

Since I really wanted the sync to work, I hacked my own system as follows:
After https://github.com/sabre-io/dav/blob/3.2/lib/DAV/Sync/Plugin.php#L119 (which is in lib/composer/sabre/dav/lib/DAV/Sync/Plugin.php) I added the following.
Definitely not a final solution; use at your own risk, I don't know the cardDAV specs nor the ownCloud system.

        $syncToken = $report->syncToken;
        // very crude macOS Mojave (10.14) Contacts sync "fix"
        // @see https://github.com/owncloud/core/issues/30820
        if ( \preg_match('/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/', $syncToken) ) {
          $syncToken = null;
        }

ownCloud now just outputs the full REPORT and the contacts app syncs correctly (as far as I have tested it with ownCloud, macOS and my Android phone).

@joostdekeijzer It's the same with CalDav

Ok. That seems to work fine though on macOS 10.14 Mojave. Do you have sync issues?

b905a5fd-ce23-4190-9be3-236969d071a8

This is the issue - no idea where Apple is taking the sync token from. Sync tokens are generated by us(sabre dav) in the format http://sabre.io/ns/sync/2285

Any other synctoken cannot be used by us.

As per https://tools.ietf.org/html/rfc6578#section-4 the sync token has to be a valid URI and has to be used as returned in the sync collection.

Afaik we never return a sync token in this format.

This should be reported to Apple afaik

Just filed a bug report with Apple (#46163430) referencing this post.

Just filed a bug report with Apple (#46163430) referencing this post.

Awesome - thanks a lot! Please keep us in the loop so that we can find a solution together. THX

@joostdekeijzer Is it possible for you to duplicate your issue on openradar so we can see what's happening? Thanks in advance!

@Julian1998 you mean http://openradar.appspot.com/ ?

@joostdekeijzer Exactly!

The issue was marked "Duplicate" by Apple of issue 42566961. I don't have/get access to that issue but apparently they will update my ticket with the status of the original.

@joostdekeijzer Thanks for sharing infos!

Is this bug already fixed? In openradar is this bug still open.

My ticket with Apple is also still open. No real hopes this will change btw.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dpeger picture dpeger  路  3Comments

tommis picture tommis  路  5Comments

patrickjahns picture patrickjahns  路  4Comments

michaelstingl picture michaelstingl  路  3Comments

fridaynext picture fridaynext  路  5Comments