We have about 400 Nextcloud accounts, syncing caldav calendars with Android and iOS devices (and Thunderbird). On 2 Iphones devices of 2 different users, some events are missing. Not all the events, only some. We cannot find a pattern on these particular events. Recreating caldav accounts on the devices doesn’t solve the problem.
After few days, some missing events (not all) are showing up.
By the way, missing events are perfectly visible on Thunderbird and other caldav client on other devices (even other iOS devices).
Maybe a sync token is corrupted on the devices ? How to reset it (delete the account doesn’t work !).
Maybe a particular event is blocking sync ? How can we find it ?
Any help will be appreciated.
Nextcloud 29.0.4
Iphone 13 with iOS 17.X
Last week, 2 users have encountered the problem : some events are missing on the iOS device. Events are good on Thunderbird and Nextcloud Calendar.
These 2 users are sharing some calendars, I was thinking a particular event on one of a shared calendar was causing the problem, but I am unable to find it if it’s the root cause.
What have we test :
Trying to sync with another iOS device, with same credentials => some (other !) events are not synced
Remove all shared calendars, keeping only the personal calendar of the user => some (other !) events are not synced
Testing about 40 events modified some days before the problem occurred on an online ics validator => it seems not to be a syntax problem
Creating a new nextcloud user, giving him read/write rights on the personal calendar => it works but of course, we can’t see the private events (shared private events are not visible to sharee)
Is there any way to debug caldav server side ? Nextcloud log is not showing anything wrong for these users.
Got it !
There was some non-unicode chars on the calendardata field in the table oc_calendarobjects.
If you have sync issues between iOS and nextcloud, find faulty events in the nextcloud database with this SQL request :
SELECT oc_calendarobjects.id,calendardata,calendarid,principaluri FROM oc_calendarobjects,oc_calendars where oc_calendarobjects.calendarid=oc_calendars.id and
CONVERT(calendardata USING binary) RLIKE '([\\xC0-\\xC1]|[\\xF5-\\xFF]|\\xE0[\\x80-\\x9F]|\\xF0[\\x80-\\x8F]|[\\xC2-\\xDF](?![\\x80-\\xBF])|[\\xE0-\\xEF](?![\\x80-\\xBF]{2})|[\\xF0-\\xF4](?![\\x80-\\xBF]{3})|(?<=[\\x00-\\x7F\\xF5-\\xFF])[\\x80-\\xBF]|(?<![\\xC2-\\xDF]|[\\xE0-\\xEF]|[\\xE0-\\xEF][\\x80-\\xBF]|[\\xF0-\\xF4]|[\\xF0-\\xF4][\\x80-\\xBF]|[\\xF0-\\xF4][\\x80-\\xBF]{2})[\\x80-\\xBF]|(?<=[\\xE0-\\xEF])[\\x80-\\xBF](?![\\x80-\\xBF])|(?<=[\\xF0-\\xF4])[\\x80-\\xBF](?![\\x80-\\xBF]{2})|(?<=[\\xF0-\\xF4][\\x80-\\xBF])[\\x80-\\xBF](?![\\x80-\\xBF]))';
and delete them or convert the calendardata value in a well encoded format (I personally dit it with a php script).
mysqli_query($database, "update oc_calendarobjects set calendardata='".addslashes(mb_convert_encoding($event["calendardata"], 'UTF-8', 'UTF-8'))."' where id=".$event["id"]);