Open chaos-prevails opened 2 years ago
Hm I did a fresh installation and for me it seems to work properly. But I dont have a SoGo server to test with (but to my knowledge that should not make a difference).
Maybe SoGo is doing something weird? Have you tried if it works with other caldav providers? Just to narrow down where the problem is coming from?
Do you have a calendar that I could access and see if it does the same thing on my test server?
Hi,
In my case, i've need some modification to get rize of array_merge errors (rc15 too).
I use radicale as dav server, and event added by other client than rc calendar are never show. In radical's log, i don't show any request that let me think that rc's calendar try to sync from server.
Adding event from rc's calendar are ok for me, they are sync to radicale and displayed in rc
Dear all, thanks, so there seems to be something strange with array_merge. @kevin75001 could you share what you changed with array_merge to prevent the error messages?
Because with SOGo (latest 5.6 nightly), this is what happens: 1) I create an event in RC, and it is saved in the SOGo DB, and it shows up in SOGo frontend. As long as I do not refresh the webpage, the event also shows up in RC15 calendar, and it is saved in the table caldav_events in the RC database 2) I do F5 refresh, or simply click on another view, I see the array_merge error in the logs, and the event gets deleted from the RC database (but not from the SOGo database). --> any event created in SOGo does not show up in RC --> any event created in RC is saved in SOGo, and stays there
This is the full log file including the delete:
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Ctag indicates that calendar "23" needs update!
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Calendar "23" needs update.
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Syncing calendar id "23".
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Found new event /SOGo/dav/it5@mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C/
May 12 10:53:25 mail roundcube: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /opt/www/roundcubemail/plugins/calendar/drivers/caldav/caldav_driver.php on line 2204
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Could not perform event creation: Array
May 12 10:53:25 mail roundcube: (
May 12 10:53:25 mail roundcube: [url] => /SOGo/dav/it5@mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C/
May 12 10:53:25 mail roundcube: [etag] => None
May 12 10:53:25 mail roundcube: )
May 12 10:53:25 mail roundcube:
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Created 0 new events, updated 0 event.
May 12 10:53:25 mail roundcube: <p0d4k87c> caldav_driver: Successfully synced calendar id "23".
May 12 10:53:47 mail roundcube: <p0d4k87c> caldav_driver: Push new event to url /SOGo/dav/it5%40mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C//0BBC7F881234109BE04C8D3D55624D2E-1CB5DAFE4E2ABC8E.ics
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Ctag indicates that calendar "23" needs update!
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Calendar "23" needs update.
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Syncing calendar id "23".
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Found new event /SOGo/dav/it5@mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C/
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Found new event /SOGo/dav/it5%40mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C/0BBC7F881234109BE04C8D3D55624D2E-1CB5DAFE4E2ABC8E.ics
May 12 10:54:05 mail roundcube: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /opt/www/roundcubemail/plugins/calendar/drivers/caldav/caldav_driver.php on line 2204
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Could not perform event creation: Array
May 12 10:54:05 mail roundcube: (
May 12 10:54:05 mail roundcube: [url] => /SOGo/dav/it5@mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C/
May 12 10:54:05 mail roundcube: [etag] => None
May 12 10:54:05 mail roundcube: )
May 12 10:54:05 mail roundcube:
May 12 10:54:05 mail roundcube: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /opt/www/roundcubemail/plugins/calendar/drivers/caldav/caldav_driver.php on line 2204
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Could not perform event creation: Array
May 12 10:54:05 mail roundcube: (
May 12 10:54:05 mail roundcube: [url] => /SOGo/dav/it5%40mydomain.org/Calendar/2C15D9-627CCA80-13-E91B7C/0BBC7F881234109BE04C8D3D55624D2E-1CB5DAFE4E2ABC8E.ics
May 12 10:54:05 mail roundcube: [etag] => gcs00000000
May 12 10:54:05 mail roundcube: )
May 12 10:54:05 mail roundcube:
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Created 0 new events, updated 0 event.
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Remove event "23".
May 12 10:54:05 mail roundcube: <p0d4k87c> caldav_driver: Successfully synced calendar id "23".
(BTW this is the master from yesterday, so the 2 lines for postgres are not included (but we use mysql), so line where the error occurs should be 2206 I think)
I would like to test with a different source, and I would have chosen some free Nextcloud account. However, the signup page on nextcloud.com is currently offline, so I cannot create a test account. Is there another caldav server where I can have a limited free signup?
@JodliDev I'm happy to provide you with a test account of our SOGo 5.6 server (we are currently testing, so no relevant data on it). I will write you to the email address I found, which is most likely you. looking at the previous comment, there might really be an issue with different caldav servers? We use SOGo with RC1.3 and the faster-it caldav calendar addon (with some changes to be compatible with RC1.3) since many years, and didn't experience that issue.
Hi,
I've just added :
if (!isset($update["remote_event"]) || !is_array($update["remote_event"])) $update["remote_event"] = [];
Before calling array_merge, so, this just prevent throwing the error, i think the problem is in function _sync_calendar :
private function _sync_calendar($cal_id)
{
self::debug_log("Syncing calendar id \"$cal_id\".");
$cal_sync = $this->sync_clients[$cal_id];
$events = array();
// Ignore recurrence events and read caldav props
foreach($this->_load_all_events($cal_id) as $event) {
if($event["recurrence_id"] == 0) {
array_push($events, $event);
}
}
if($updates)
{
list($updates, $synced_event_ids) = $updates;
$updated_event_ids = $this->_perform_updates($updates);
...
I don't see any declaration for variable $updates
@kevin75001 Unfortunately that fix only masks the problem. The main problem is, that there should be new data, but there obviously isnt which is why array_merge fails. By declaring $update["remote_event"] with an empty array, you get rid of the error message, but the problem, that there is no data when there should be, remains. It should have been filled here: https://github.com/JodliDev/calendar/blob/9c6b8b4171c0ae3e61a2f81ca7c342aa0de6f803/drivers/caldav/caldav_sync.php#L201
I was now able to reproduce this issue on my end so Ill start investigating as well.
EDIT I just realised that your source seems to be altered. In the code you quoted, you are missing this line: https://github.com/JodliDev/calendar/blob/9c6b8b4171c0ae3e61a2f81ca7c342aa0de6f803/drivers/caldav/caldav_driver.php#L2114
Yes, that "patch" is only to allow php to continue executing code for test purpose.
I've maybe made a wrong manipulation that have removed the line, readding it and i'm in the same case than @chaos-prevails (added events are removed when reloading calendar)
I've actually no time to track it today, so it seems related to tags
I'll do more investigation monday
That was an interesting hunt that took me all the way through the code base but I am confident that I found the issue:
There were special characters (in this case "@") in the username. When creating the expected url, it was urlencoded which lead to a slightly different url than the one in the server response (using "%40" instead of "@")
I am leaving the issue open for a couple days in case there were other problems that I missed
Hi,
Thank you for your work.
After clonning the repo to get your change, this is not working for me, step to reproduce :
Roundcube error log show :
[16-May-2022 17:00:48 +0200]: <ad5b9226> PHP Error: iCal data parse error: Starting sabre/vobject 4.0 the children property is now protected. You should use the children() method instead in /var/www/roundcube15/plugins/libcalendaring/libvcalendar.php on line 163 (GET /roundcube15/?_task=calendar&source=6&_action=load_events&start=2022-05-16T00%3A00%3A00&end=2022-05-23T00%3A00%3A00&_=1652713248259)
[16-May-2022 17:00:48 Europe/Paris] PHP Warning: array_merge(): Argument #1 is not an array in /var/www/roundcube15/plugins/calendar/drivers/caldav/caldav_driver.php on line 2217
I've one line of each per event in my radicale server.
Roundcube sql log show :
[16-May-2022 17:00:48 +0200]: <ad5b9226> [9] DELETE FROM caldav_events
WHERE (event_id='43' OR recurrence_id='43')
AND calendar_id IN ('6');
Using evolution mail caldav, i can see that all my events are not deleted, it's only the mysql cache who is deleted
I found the problem, i've updated the libcalendaring and now it's seems to work !
I'll do some tests tomorrow, so i think this specific issue is solved for me
Thank you for your time
hi, thanks so much! Events are now shown!
The error in the logfile however still persists (using the latest master both for libcalendaring, and calendar):
May 19 17:53:14 mail roundcube: message repeated 2 times: [ <ejkqh6o9> caldav_driver: Sync period active: Assuming calendar "65" to be in sync.]
May 19 17:53:22 mail roundcube: <ejkqh6o9> caldav_driver: Push new event to url /SOGo/dav/it5@mydomain.net/Calendar/personal//7F6D5064F155DA6B3A1DDD6B2E0B91DF-1CB5DAFE4E2ABC8E.ics
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Ctag indicates that calendar "65" needs update!
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Calendar "65" needs update.
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Syncing calendar id "65".
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Found new event /SOGo/dav/it5@mydomain.net/Calendar/personal/
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Found new event /SOGo/dav/it5@mydomain.net/Calendar/personal/7F6D5064F155DA6B3A1DDD6B2E0B91DF-1CB5DAFE4E2ABC8E.ics
May 19 17:53:25 mail roundcube: PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /opt/www/roundcubemail/plugins/calendar/drivers/caldav/caldav_driver.php on line 2253
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Could not perform event creation: Array
May 19 17:53:25 mail roundcube: (
May 19 17:53:25 mail roundcube: [url] => /SOGo/dav/it5@mydomain.net/Calendar/personal/
May 19 17:53:25 mail roundcube: [etag] => None
May 19 17:53:25 mail roundcube: )
May 19 17:53:25 mail roundcube:
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Created event "256".
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Created 1 new events, updated 0 event.
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Remove event "255".
May 19 17:53:25 mail roundcube: <ejkqh6o9> caldav_driver: Successfully synced calendar id "65".
maybe this is of cosmetical nature?
Dear all,
I've tried to install this version with RC1.5, and I could get calendar running (using the composer.json file provided here, and the installation how to, incl initializing the DB) 1) I can add a dav resource, and it identifies, and adds all calendars 2) I can create an event, and even send out invitations. The event shows in RC, and is saved in the caldav backend 3) however, after one page refresh not a single event is shown (in no view), although the events exists. It also doesn't show events created e.g. via SOGo backend
I get the following error (with debugging enabled):
So it seems to find all events, but then when trying to show remote events, the parameter $update["remote_event"] seems to be null.
this is my composer.json (I had to manually download the calendar package and unzip it to plugins directory, as I couldn't add it via composer cli):
I did not do any changes in calendar/config.inc.php (I added the DAV source via RC)