Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalDav Support of the <limit> tag in order to support clients such as OneCalendar #18490

Closed
TomSH75 opened this issue Dec 19, 2019 · 17 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement

Comments

@TomSH75
Copy link

TomSH75 commented Dec 19, 2019

I would like to use on my Windows10 clients OneCalendar to access the NextCloud calendar (running on NextCloud 17.0.2) since the Microsoft calendar app does only synch the next 5 months properly. Unfortunately according to the OneCalendar hotline the NextCloud CalDav implementation does not support the limit tag and thus throws an exception:

Your CalDAV server doesn’t fully support the CalDAV protocol. We’re asking for all appointments with a limit, so we don’t get to process hundreds of thousands of appointments at once. But your server doesn’t support that.

Part of the error message:
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:exception>OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException</s:exception> <s:message/> <d:number-of-matches-within-limits/> </d:error>
...
RequestData: <sync-collection xmlns="DAV:"> <sync-token /> <sync-level>1</sync-level> <limit> <nresults>1000</nresults> </limit> <prop> <getetag /> </prop> </sync-collection> ResponseData: <?xml version="1.0" encoding="utf-8"?> <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:exception>OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException</s:exception> <s:message/> <d:number-of-matches-within-limits/> </d:error>

@TomSH75 TomSH75 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Dec 19, 2019
@kesselb
Copy link
Contributor

kesselb commented Dec 19, 2019

cc @nextcloud/calendar

I guess we don't support this case properly: https://tools.ietf.org/html/rfc6578#section-3.11

@tcitworld
Copy link
Member

Related PR #10842

@georgehrke
Copy link
Member

Just as a comment from my side:
The way i interpret the RFC, server side support for limit is optional. The server is legitimately allowed to throw this error.

It's up to OneCalendar to handle that case properly.

@lueppi
Copy link

lueppi commented Mar 18, 2020

I fixed this temporarily on my instance by editing /var/www/nextcloud/apps/dav/lib/CalDAV/Calendar.php and commenting out these lines:

  • use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException; (line 32)
  • throw new UnsupportedLimitOnInitialSyncException(); (line 399)

@georgehrke
Copy link
Member

georgehrke commented Mar 18, 2020

I strongly advise anyone against applying that temporary "fix", as there are reasons why that check is in place. There is the chance of silent errors and possibly even data-loss.

@lueppi
Copy link

lueppi commented Mar 18, 2020

I absolutely agree. Of course a backup should be made before applying this (and in general any) workarounds.
However, this "fix" provides a way to (re)enable synchronization until OneCalendar can handle the message. After a successful initial synchronization, the affected lines can and should be reactivated.

@stephanJG
Copy link

Hi,
I have exactly the same issue. I am currently moving from owncloud to nextcloud. For owncloud CalDav is working with OneCalendar, but I am very disappointed that it is not working for nextcloud.

@lueppi : where and how exactly did you apply your work around

I am also open for other calendar apps, but have not found any where I can just simply log in with the server and my log in details... any suggestions?

@lueppi
Copy link

lueppi commented Jun 22, 2020

I fixed this temporarily on my instance by editing /var/www/nextcloud/apps/dav/lib/CalDAV/Calendar.php and commenting out these lines:

  • use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException; (line 32)
  • throw new UnsupportedLimitOnInitialSyncException(); (line 399)

The path may differ depending on the system and configuration. For my instance running on Debian Buster it's the path mentioned above and this were the changes I made. Please pay attention to the comment from georgehrke, because this workaround can be dangerous and you should use it very carefully. Since this is mainly a problem during initialization, the workaround should be restored as soon as the app is initialized.

I now use the DAVx5 for Android devices, with which I was also able to synchronize my calendars.

@sofar
Copy link

sofar commented Jun 25, 2020

I've had this issue for a long time with onecalendar and nextcloud now, and it's severely breaking the usability of an otherwise very appealing combination due to onecalendar's features and widget. onecalendar fails to sync leaving deleted meetings on my calendar and fails to insert new meetings. I would look for alternatives but it took me forever to find something as good as onecalendar :(.

I'd love for this problem to get a structural solution.

edit: I'm using the android version for the widget+meeting reminders mainly.
edit: on top of that this generates an inconvenient amount of log errors that are very, very long (2k chars per failure, every few minutes).

@JeroenBer
Copy link

Hi,
I am one of the OneCalendar developers. In the newest version of OneCalendar we fixed a lot of caldav issues. This issue is solved as well now. All you need to do is update to the newest version of OneCalendar.

@sofar
Copy link

sofar commented Aug 24, 2020

I just updated both my android client, and my nextcloud to the latest beta stream, and I am still seeing these errors in my server logs:

Aug 24 13:08:53 grandcrema Nextcloud[1156]: {"reqId":"8BlllMvsJQeaebVTEYdB","level":4,"time":"2020-08-24T20:08:53+00:00","remoteAddr":"x.x.x.x","user":"sofar","app":"webdav","method":"REPORT","url":"/remote.php/dav/calendars/sofar/personal/","message":"{\"Exception\":\"OCA\\\\DAV\\\\Exception\\\\UnsupportedLimitOnInitialSyncException\",\"Message\":\"\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/cloud.foo-projects.org/3rdparty/sabre/dav/lib/DAV/Sync/Plugin.php\",\"line\":124,\"function\":\"getChanges\",\"class\":\"OCA\\\\DAV\\\\CalDAV\\\\Calendar\",\"type\":\"->\",\"args\":[null,\"1\",100]},{\"file\":\"/var/www/cloud/3rdparty/sabre/dav/lib/DAV/Sync/Plugin.php\",\"line\":64,\"function\":\"syncCollection\",\"class\":\"Sabre\\\\DAV\\\\Sync\\\\Plugin\",\"type\":\"->\",\"args\":[\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\"]},{\"file\":\"/var/www/cloud.foo-projects.org/3rdparty/sabre/event/lib/WildcardEmitterTrait.php\",\"line\":89,\"function\":\"Sabre\\\\DAV\\\\Sync\\\\{closure}\",\"class\":\"Sabre\\\\DAV\\\\Sync\\\\Plugin\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php\",\"line\":720,\"function\":\"emit\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[\"report\",[\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\",\"*** sensitive parameter replaced ***\"]]},{\"file\":\"/var/www/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php\",\"line\":89,\"function\":\"httpReport\",\"class\":\"Sabre\\\\DAV\\\\CorePlugin\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},{\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},{\"file\":\"/var/www/cloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":474,\"function\":\"emit\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[\"method:REPORT\",[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},{\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]]},{\"file\":\"/var/www/cloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":251,\"function\":\"invokeMethod\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},{\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},{\"file\":\"/var/www/cloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":319,\"function\":\"start\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/cloud/apps/dav/lib/Server.php\",\"line\":325,\"function\":\"exec\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/cloud/apps/dav/appinfo/v2/remote.php\",\"line\":35,\"function\":\"exec\",\"class\":\"OCA\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/cloud/remote.php\",\"line\":167,\"args\":[\"/var/www/cloud/apps/dav/appinfo/v2/remote.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/cloud/apps/dav/lib/CalDAV/Calendar.php\",\"Line\":397,\"CustomMessage\":\"--\"}","userAgent":"ie Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)","version":"20.0.0.3"}

Note: I flushed my onecalendar cache/data entirely (twice). In nextcloud itself, the calendar appears normal. Thunderbird also connects to this caldav server from 2 places and it has no issues getting updates/syncing.

@sofar
Copy link

sofar commented Aug 24, 2020

@JeroenBer If it's not clear from my post, onecalendar tries to sync (generating the error on the server) and doesn't see any item at all. I've enabled logging (both logging and debug) and after pushing the sync button once, "view log file" appears to hang the client, but it eventually shows. However, "copy text" causes it to crash :) - it's obviously filled with tons of request output, not sure other than screenshots how I can extract this for you - is it on the device as a file?

@sofar
Copy link

sofar commented Aug 24, 2020

@JeroenBer interesting data point: I tried adding the server as "caldav" instead of "nextcloud" type and while it threw the above posted error message on the server, I am now seeing calendar entries appear on onecalendar. So, that's progress at least.

@stephanJG
Copy link

Its great that one calendar is trying to fix the issue. However, I have given up and changed to a new app.
Working very well for me:
OpenSync, which establishes the calendar on the phone. Hence I can use any calendar app.
I am very satisfied with Etar, I also realized I don't need a calendar with nice widget, but can use a separate widget app: Calendar Widget Month with Agenda is my choice here.

@georgehrke
Copy link
Member

I will close this issue, because it is not an issue in the server, but in a 3rdparty client software that was fixed.

@rfc2822
Copy link
Contributor

rfc2822 commented Aug 29, 2020

OpenSync, which establishes the calendar on the phone. Hence I can use any calendar app.

Maybe it should be noted that OpenSync is just an unmaintained (and for some versions broken) clone of DAVx5 :)

@JeroenBer
Copy link

@JeroenBer interesting data point: I tried adding the server as "caldav" instead of "nextcloud" type and while it threw the above posted error message on the server, I am now seeing calendar entries appear on onecalendar. So, that's progress at least.

Hi, If you have any more problems regarding OneCalendar please contact us at: [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement
Projects
None yet
Development

No branches or pull requests

9 participants