apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
484 stars 136 forks source link

emClient complaining about "Report not supported on this resource" #494

Closed f1-outsourcing closed 7 years ago

f1-outsourcing commented 7 years ago

I have 9.1 calendarserver with caldavd-test.plist


21:50:58 1admin [CalDAV / CardDAV]  Synchronizing items: Sync of 1admin/calendar/ finished: 0 uploaded, 0 deleted, 0 obsolete, 0 items,  0 downloaded
21:50:58 1admin [CalDAV / CardDAV]  Synchronizing items: Done
21:50:58 1admin [CalDAV / CardDAV]  Synchronizing items: For folder 1admin/
21:50:58 1admin [CalDAV / CardDAV]  MailClient.Storage.Application.OperationException: Sync of 1admin/ failed due to the following error: 1admin (Forbidden)
21:50:58 <?xml version='1.0' encoding='UTF-8'?>
21:50:58 <error xmlns='DAV:'>
21:50:58   <supported-report/>
21:50:58   <error-description xmlns='http://twistedmatrix.com/xml_namespace/dav/'>Report not supported on this resource</error-description>
21:50:58 </error>
21:50:58 1admin [CalDAV / CardDAV]  Synchronizing items: Sync of 1admin/ finished: 0 uploaded, 0 deleted, 0 obsolete, 0 items,  0 downloaded
21:50:58 1admin [CalDAV / CardDAV]  Synchronizing items: Done
21:50:58 1admin [CalDAV / CardDAV]  Synchronizing items: For folder 1admin/accounting/
21:50:59 1admin [CalDAV / CardDAV]  Synchronizing items: Sync of 1admin/accounting/ finished: 0 uploaded, 0 deleted, 0 obsolete, 0 items,  0 downloaded
21:50:59 1admin [CalDAV / CardDAV]  Synchronizing items: Done
21:50:59 1admin [CalDAV / CardDAV]  Synchronizing items: For folder 1admin/tasks/
21:50:59 1admin [CalDAV / CardDAV]  Synchronizing items: Sync of 1admin/tasks/ finished: 0 uploaded, 0 deleted, 0 obsolete, 0 items,  0 downloaded
21:50:59 1admin [CalDAV / CardDAV]  Synchronizing items: Done

Anyone an idea how to resolve this?

dreness commented 7 years ago

Enable detailed protocol logging for this account, then reproduce the above. This produces a set of logs, one file per request, containing complete headers, request, and response payloads for all requests on this user's account.

For a configuration example, see https://github.com/apple/ccs-calendarserver/blob/master/conf/caldavd-test.plist#L511

If you want these logs to go somewhere special, set AccountingLogRoot.

Be sure to disable this logging after you're done. These logs can become rather voluminous over time. Not so much in bytes, but definitely inodes...

f1-outsourcing commented 7 years ago

somehow I got only the HTTP log file, maybe because I am running it in foreground and logging goes to stdout? Is this supported-report not a configuration setting?

emclient.txt stdout.txt http.txt

dreness commented 7 years ago

The http log says:

>>>> Request starting at: 1498750933.010

REPORT /principals/users/1admin/ HTTP/1.1
User-Agent: eM Client/7.0.30068.0
...

<?xml version="1.0" encoding="utf-8"?><D:sync-collection xmlns:D="DAV:"><D:sync-token>data:,37_57/6fd686e900e1f9d89a321bb0cf76281e</D:sync-token><D:prop><D:getetag /><D:getcontenttype /></D:prop></D:sync-collection>

>>>> Request complete at: 1498750933.045 (elapsed: 35.2 ms)

<<<< Response sending at: 1498750933.047 (elapsed: 37.2 ms)

HTTP/1.1 403 Forbidden
...

<?xml version='1.0' encoding='UTF-8'?>
<error xmlns='DAV:'>
  <supported-report/>
  <error-description xmlns='http://twistedmatrix.com/xml_namespace/dav/'>Report not supported on this resource</error-description>
</error>

<<<< Response complete at: 1498750933.048 (elapsed: 37.8 ms)

emClient is issuing a sync-collection report request on /principals/users/1admin, which is not a collection, hence the error message that this report isn't supported here. I see that emClient eventually gets to a collection where this report request succeeds.

Is the "Report not supported on this resource" error handled gracefully by emClient? If so, might be OK to just ignore. In any case, CalDAV provides a mechanism for servers to advertise (and clients to discover) which kinds of REPORTs are supported for any given resource, and that is the supported-report-set property. For a /principals/users/foo resource, the supported report set is:

<?xml version='1.0' encoding='UTF-8'?>
<supported-report-set xmlns='DAV:'>
  <supported-report>
    <report>
      <acl-principal-prop-set/>
    </report>
  </supported-report>
  <supported-report>
    <report>
      <principal-match/>
    </report>
  </supported-report>
  <supported-report>
    <report>
      <principal-property-search/>
    </report>
  </supported-report>
  <supported-report>
    <report>
      <expand-property/>
    </report>
  </supported-report>
  <supported-report>
    <report>
      <calendarserver-principal-search xmlns='http://calendarserver.org/ns/'/>
    </report>
  </supported-report>
</supported-report-set>
f1-outsourcing commented 7 years ago

Thanks for the detailed explanation, I thought I might not have enabled something in the config. I will let emClient people know about this.