If you try to fetch collections with wrong credentials (doe@example.org instead of john.doe@example.org), the the collectionfetchjob will happily complete and not report an error but not retrieve any collections. Which will delete all collections locally.
A potential response is:
BBE}@@PrJ#@i] 'm&HTTP/1.1 207 Multi-Status Date: Thu, 09 Mar 2017 17:23:46 GMT Server: Apache/2.4.6 (CentOS) PHP/5.4.16 X-Powered-By: PHP/5.4.16 X-Sabre-Version: 2.1.11 Vary: Brief,Prefer DAV: 1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-schedule, calendar-auto-schedule, addressbook, 2 Content-Length: 947 Keep-Alive: timeout=5, max=93 Connection: Keep-Alive Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="utf-8"?> <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav"><d:response><d:href>/iRony/addressbooks/doe@example.org/</d:href><d:propstat><d:prop><d:displayname/><d:resourcetype/><cs:getctag/></d:prop><d:status>HTTP/1.1 403 Forbidden</d:status></d:propstat></d:response><d:response><d:href>/iRony/addressbooks/doe@example.org/cd2ee6cd-b5f9-4639-9373-01784e367a49/</d:href><d:propstat><d:prop><d:displayname/><d:resourcetype/><cs:getctag/></d:prop><d:status>HTTP/1.1 403 Forbidden</d:status></d:propstat></d:response><d:response><d:href>/iRony/addressbooks/doe@example.org/f3283c17-8213-4d78-9dd1-7d24fbc250f2/</d:href><d:propstat><d:prop><d:displayname/><d:resourcetype/><cs:getctag/></d:prop><d:status>HTTP/1.1 403 Forbidden</d:status></d:propstat></d:response></d:multistatus>
The request:
BBE@@,rP#gJeY- &&<?xml version="1.0" encoding="utf-8"?> <propfind xmlns="DAV:"> <prop xmlns="DAV:"> <displayname xmlns="DAV:"/> <resourcetype xmlns="DAV:"/> <getctag xmlns="http://calendarserver.org/ns/"/> </prop> </propfind>
Another potential response:
BBE @@>PVVTZ KHKHTTP/1.1 401 Unauthorized Date: Thu, 09 Mar 2017 16:53:20 GMT Server: Apache/2.4.6 (CentOS) PHP/5.4.16 X-Powered-By: PHP/5.4.16 WWW-Authenticate: Basic realm="KolabDAV" Content-Length: 292 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="utf-8"?> <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:sabredav-version>2.1.11</s:sabredav-version> <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception> <s:message>No basic authentication headers were found</s:message> </d:error>
Not sure what triggers one or the other response, but both are not recognized as errors.