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 Integration - Calender not available after update #134649

Open
pvillmann opened this issue Jan 4, 2025 · 6 comments
Open

CalDav Integration - Calender not available after update #134649

pvillmann opened this issue Jan 4, 2025 · 6 comments

Comments

@pvillmann
Copy link

The problem

after updating to HA Core 2025.1 my calender entity from CalDav integration is not available anymore.
I have already done a reconfiguration etc. but it's still not available

What version of Home Assistant Core has the issue?

core-2025.1.0

What was the last working version of Home Assistant Core?

core-2024.12.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

caldav

Link to integration documentation on our website

https://www.home-assistant.io/integrations/caldav

Diagnostics information

2025-01-04 08:11:23.188 ERROR (MainThread) [homeassistant.components.caldav.coordinator] Unexpected error fetching CalDAV Persönlicher Kalender data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/caldav/coordinator.py", line 96, in _async_update_data
results = await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.13/site-packages/caldav/objects.py", line 1105, in search
o.expand_rrule(start, end)
~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/caldav/objects.py", line 1796, in expand_rrule
import recurring_ical_events
File "/usr/local/lib/python3.13/site-packages/recurring_ical_events.py", line 1530, in
class CalendarQuery:
...<193 lines>...
raise IndexError("No components found.")
File "/usr/local/lib/python3.13/site-packages/recurring_ical_events.py", line 1547, in CalendarQuery
icalendar.InvalidCalendar,
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'icalendar' has no attribute 'InvalidCalendar'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 4, 2025

@xeor
Copy link

xeor commented Jan 4, 2025

There is an issue with importing recurring_ical_events from 2025.1, I have the same issue.

import icalendar works fine.

import recurring_ical_events gives (tested from jupyter shell)

Exception in <jupyter_0> line 1:
    import recurring_ical_events
    ^
AttributeError: module 'icalendar' has no attribute 'InvalidCalendar'

@xeor
Copy link

xeor commented Jan 4, 2025

Some additional debugging

import pkg_resources
pkg_resources.get_distribution("recurring-ical-events").version

shows 3.4.0

recurring_ical_events refers to the missing icalendar.InvalidCalendar which got introduced at niccokunzmann/python-recurring-ical-events@8156e1c about a month ago.

https://github.com/niccokunzmann/python-recurring-ical-events/blob/v3.4.0/requirements.txt#L4 shows icalendar 6.1.0 upto 7.x is supported.

pkg_resources.get_distribution("icalendar").version

shows home-assistant is at 5.0.13.
icalendar on this version worked with recurring_ical_events version 3.3.2.

icalendar in home-assistant should be 6.1.0 tho. See https://github.com/home-assistant/core/blob/2025.1.0/requirements_all.txt#L1181

@xeor
Copy link

xeor commented Jan 4, 2025

So it looks like icalevents is the one that depends on 5.0.13, see https://github.com/jazzband/icalevents/blob/master/pyproject.toml#L12

From pipdeptree

icalevents==0.1.29
├── httplib2 [required: >=0.22.0,<0.23.0, installed: 0.22.0]
│   └── pyparsing [required: >=2.4.2,<4,!=3.0.3,!=3.0.2,!=3.0.1,!=3.0.0, installed: 3.2.1]
├── icalendar [required: ==5.0.13, installed: 5.0.13]
│   ├── python-dateutil [required: Any, installed: 2.9.0.post0]
│   │   └── six [required: >=1.5, installed: 1.17.0]
│   └── pytz [required: Any, installed: 2024.2]
├── python-dateutil [required: >=2.9.0,<3.0.0, installed: 2.9.0.post0]
│   └── six [required: >=1.5, installed: 1.17.0]
└── pytz [required: >=2024.1,<2025.0, installed: 2024.2]

# and

caldav==1.3.9
├── icalendar [required: Any, installed: 5.0.13]
│   ├── python-dateutil [required: Any, installed: 2.9.0.post0]
│   │   └── six [required: >=1.5, installed: 1.17.0]
│   └── pytz [required: Any, installed: 2024.2]
├── lxml [required: Any, installed: 5.3.0]
├── pytz [required: Any, installed: 2024.2]
├── recurring-ical-events [required: >=2.0.0, installed: 3.4.0]
│   ├── icalendar [required: >=6.1.0,<7.0.0, installed: 5.0.13]
│   │   ├── python-dateutil [required: Any, installed: 2.9.0.post0]
│   │   │   └── six [required: >=1.5, installed: 1.17.0]
│   │   └── pytz [required: Any, installed: 2024.2]
│   ├── python-dateutil [required: >=2.8.1,<3.0.0, installed: 2.9.0.post0]
│   │   └── six [required: >=1.5, installed: 1.17.0]
│   ├── tzdata [required: Any, installed: 2024.2]
│   └── x-wr-timezone [required: >=1.0.0,<3.0.0, installed: 2.0.0]
│       ├── click [required: Any, installed: 8.1.8]
│       ├── icalendar [required: >=6.1.0, installed: 5.0.13]
│       │   ├── python-dateutil [required: Any, installed: 2.9.0.post0]
│       │   │   └── six [required: >=1.5, installed: 1.17.0]
│       │   └── pytz [required: Any, installed: 2024.2]
│       └── tzdata [required: Any, installed: 2024.2]

The only reference to icalevents dependency that I could find (at least that I had) was https://github.com/mampfes/hacs_waste_collection_schedule, which looks like depends on icalevents.

So; it might be nuking the correct icalendar version and replacing it.. :( Do you have a similar hacs plugin?

@override80
Copy link

In my specific case:

calendar:
  - platform: caldav
    username: caldav
    password: !secret caldav
    url: https://nextcloud.xxx.yyy/remote.php/dav
    custom_calendars:
      - name: holiday
        calendar: Holiday
        search: '.*'

It's failing only if the search value contains a regex. I only have all-day events in that calendar. Setting search key to a non-regex values seems not to cause issues.

@pvillmann
Copy link
Author

From my side since yesterday the integration works fine, whyever... no update or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants