Gladys 4 - Service CalDAV

I’m working on @Checconio’s request

As planned, the system for displaying events in the calendar on the « month » view is quite obscure and I don’t think I can answer the question exactly. In some cases, they display multiple events from the same calendar, in others 1 (or 2) with + more when clicked, you are redirected to the day page and the list of all events.
Meanwhile, in the latest version of the component, there are 2 possible alternatives:

The popup version is quite nice I think, do you have a preference while we find a better alternative?

I like the idea of the pop-up too… :slight_smile:

I also confirm that the pop-up version is simple and clear :slight_smile:

The plus that gives a pop-up also seems very nice to me too :wink:

The popup system seems cleaner than the other one

Hello @bertrandda,

After reinstalling Gladys following my DB issues, I switched to the new 64-bit version provided by @VonOx. I thought everything was fine, but this morning I didn’t receive my scheduled message in the scenes linked to the calendars. So I don’t know if this is related to the 64-bit version, the backup recovery via Gladys Plus, or something else. Here’s my feedback:

  • The calendar no longer displayed anything on the dashboard,

  • I went to the CalDav integration and tried a new synchronization, but there was an error:
    image

  • So I created a new application password (just in case), but same issue,

  • I went to the « Synchronization » tab and realized that I no longer have all my calendars, I had three additional calendars before (shared Google calendars and others).

  • I tried unchecking everything and resynchronizing one by one.

  • The first one (mine) synchronizes, but does not display all events, only some, and I don’t understand why. For example, the « Concours notre dame » appointment was created by my partner’s agenda (shared), which could explain this point, but not the others. I only have a few birthdays, but not others. Moreover, if I create a new event and synchronize, it appears well. However, if I click again on the « Save » button on the configuration page and resynchronize, this newly created event no longer appears. No Docker logs, nothing specific in the Chrome console, and nothing specific in the network requests via inspection:

March and April in Gladys


March and April in Google


  • The « French Public Holidays » calendar works perfectly.
April in Gladys

  • The « iMow » calendar works perfectly.
April in Gladys

  • The « Week Numbers » calendar, which used to work, caused a crash. After investigation, I realize that it is no longer visible in the Google calendar (so no way to delete it), and I assume that’s the reason for the crash… but is there a way for it not to appear anymore? ^^ The problem is that if I save the configuration again and resynchronize, all calendars are checked by default.
Error in Gladys

  • The « Moon Phases » calendar, appearing in the same way (and retrieved via Google Calendar via the same tab) as the « French Public Holidays » calendar, does not appear in the « Synchronization » tab.
Synchronization in Gladys


March and calendars in Google

Otherwise, once the « Week Numbers » calendar is deactivated, it works almost fine except for my main agenda, where only the newly created events appear along with a few birthdays:

April in Gladys with new test event

April in Google with new test event

Hopefully, the information will be sufficient to determine what’s going on. Thanks in advance.

I don’t think this is related to either the 64-bit version or your backup; it’s a bug in the Caldav integration.

Could you restart a sync and share the error in the Gladys logs here?

This will help @bertrandda understand what’s going wrong.

So for this part:

2022-03-30T18:58:42+0200 <info> calendar.requests.js:52 () CalDAV: Found calendar thomas.lemaistre76@gmail.com
2022-03-30T18:58:42+0200 <info> calendar.requests.js:52 () CalDAV: Found calendar iMow
2022-03-30T18:58:42+0200 <info> calendar.requests.js:52 () CalDAV: Found calendar Jours fériés en France
2022-03-30T18:58:42+0200 <info> calendar.requests.js:52 () CalDAV: Found calendar Week Numbers
2022-03-30T18:58:42+0200 <info> calendar.syncUserCalendars.js:38 (CalDAVHandler.syncUserCalendars) CalDAV: Found 4 calendars.
2022-03-30T18:58:43+0200 <error> calendar.syncUserCalendars.js:104 (Promise.map.concurrency) TypeError: Cannot read property 'childNodes' of undefined
    at /src/server/services/caldav/lib/calendar/calendar.requests.js:131:71
    at Array.map (<anonymous>)
    at CalDAVHandler.requestEventsData (/src/server/services/caldav/lib/calendar/calendar.requests.js:129:80)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.map.concurrency (/src/server/services/caldav/lib/calendar/calendar.syncUserCalendars.js:102:22)

But for the other issues (the missing calendar and the main calendar not displaying all events), I have no errors or logs ^^ Sorry

It’s perfect :slight_smile:

I created a GitHub issue with the crash error:

These issues stem from the first crash :slight_smile: When the sync crashes, I imagine it stops and cannot sync the rest.

Mmmh not sure, because there are no more crashes when I uncheck the « Week Numbers » calendar

And besides, the « iMow » and « Holidays » calendriers are fully recovered on their side.

Well in any case, it’s something to look at, my machine is available for remote access if needed @bertrandda ^^

Thanks again

Hi @Terdious, your feedback is very comprehensive :pray:

For your incomplete calendar, this PR Fix CalDAV events sync by bertrandda · Pull Request #1471 · GladysAssistant/Gladys · GitHub should fix your issue.

Regarding the « Week numbers » calendar errors, I get the same result as you. In the meantime, you can disable calendar synchronization here, then reset and resynchronize your calendars in Gladys, which should make the error disappear (but the calendar in question will be missing).

What speed @bertrandda :sweat_smile: I see you had already taken the lead ^^ My bad I should have checked the ongoing PRs!!
So do you need testers on this? I’ll get my test environment up and running this weekend, so let me know if needed.

Rooo lala sometimes I’m really out of it, I remembered this page very well and yet I searched (badly, we agree - maybe I’m getting old ^^) but didn’t find it!! This should perfectly resolve my other 2 issues:
The moon phases calendar was not checked and indeed I’m no longer bothered by the week numbers ^^ :heart_eyes::heart_eyes:

A big thank you to you!!

Edit: Well the « Moon Phases » calendar doesn’t work for the moment but we’ll see with the PR, maybe related to the same issue^^

Yes, thanks, any feedback will be useful. You can test with this Docker image:

For your « Moon Phase » calendar, do you confirm that it now appears in the Synchronization section? If so and it’s just the events that don’t appear in your calendar, then the PR should indeed fix this issue as well.

I confirm, thanks @bertrandda.

I’ll test this with docker and give you feedback.

Finally, I was able to run the test in 5 minutes this noon thanks to docker ^^

So the issue is indeed resolved for the main calendar!! Good job @bertrandda :wink:

However, during the first synchronization, it crashed. Only the main calendar was updated… and all this because of the « Phases of the Moon » calendar with the following logs:

2022-03-31T13:02:41+0200 <info> index.js:55 (CalDAVHandler.config) CalDAV : Principal URL found: https://www.google.com/calendar/dav/xxxxxxxxxxxxxxxxxx@gmail.com/user
2022-03-31T13:02:41+0200 <info> index.js:76 (CalDAVHandler.config) CalDAV : Home URL found: https://www.google.com/calendar/dav/xxxxxxxxxxxxxxxxxx%40gmail.com/
2022-03-31T13:02:41+0200 <info> calendar.cleanUp.js:12 (CalDAVHandler.cleanUp) Start cleaning CalDAV data for user: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
2022-03-31T13:02:41+0200 <info> calendar.cleanUp.js:14 (CalDAVHandler.cleanUp) 0 calendars to clean
2022-03-31T13:02:47+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar thomas.lemaistre76@gmail.com
2022-03-31T13:02:47+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar iMow
2022-03-31T13:02:47+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar Public Holidays in France
2022-03-31T13:02:47+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar Phases of the Moon
2022-03-31T13:02:47+0200 <info> calendar.syncUserCalendars.js:38 (CalDAVHandler.syncUserCalendars) CalDAV : Found 4 calendars.
2022-03-31T13:03:00+0200 <info> scene.checkCalendarTriggers.js:24 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Thu, 31 Mar 2022 11:03:00 GMT
2022-03-31T13:03:05+0200 <info> calendar.syncUserCalendars.js:132 (Promise.map.concurrency) CalDAV : 696 events updated for calendar xxxxxxxx@gmail.com.
2022-03-31T13:03:06+0200 <error> calendar.syncUserCalendars.js:104 (Promise.map.concurrency) TypeError: Cannot read property 'childNodes' of undefined
    at /src/server/services/caldav/lib/calendar/calendar.requests.js:136:71
    at Array.map (<anonymous>)
    at CalDAVHandler.requestEventsData (/src/server/services/caldav/lib/calendar/calendar.requests.js:134:80)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.map.concurrency (/src/server/services/caldav/lib/calendar/calendar.syncUserCalendars.js:102:22)
2022-03-31T13:04:00+0200 <info> scene.checkCalendarTriggers.js:24 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Thu, 31 Mar 2022 11:04:00 GMT
2022-03-31T13:04:13+0200 <info> calendar.disableCalendar.js:17 (CalDAVHandler.disableCalendar) Calendar phases-of-the-moon disabled & emptied
2022-03-31T13:04:16+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar thomas.lemaistre76@gmail.com
2022-03-31T13:04:16+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar iMow
2022-03-31T13:04:16+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar Public Holidays in France
2022-03-31T13:04:16+0200 <info> calendar.requests.js:52 () CalDAV : Found calendar Phases of the Moon
2022-03-31T13:04:16+0200 <info> calendar.syncUserCalendars.js:38 (CalDAVHandler.syncUserCalendars) CalDAV : Found 4 calendars.

In the second part, I disabled the « Phases of the Moon » calendar and tried to synchronize again, but nothing more appeared in the Calendar view. Since the other two calendars (« Public Holidays » and « iMow ») appear in the view after the « Phases of the Moon » calendar, I assume it does it in order and that if it crashes on a calendar, it stops. So I disabled the two additional calendars (« Public Holidays » and « iMow »), saved, and then reactivated them. After a new synchronization, it works for these two. I assume that it is the same problem for the « Phases of the Moon » calendar as for the « Week Numbers » (maybe I’m wrong ^^)


Feel free to ask for additional tests. I’m willing to put it in a dev environment if you want to see in the logs what the variable or the json returned for these calendars is, as the mention Cannot read property 'childNodes' of undefined seems to suggest that it doesn’t have the same structure?

How did you create this « Moon Phases » calendar in Google Calendar? Is it an import?

In the same way as the « French Public Holidays » via the menu « Other Calendars + » / « Browse Calendars That May Interest You » / « Local Public Holidays » for the first and « Others » for the second:


@bertrandda For this error, you’ll fix it in the same PR, so I won’t merge it in the meantime?

The issue has just been fixed with the latest commit, it was a character interpretation problem with the calendars offered by Google.

The docker image is currently being built

Edit: the image bertrandda/gladys:caldav is up to date

Great!