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

Google Calendar API returns invalid recurrence rules and fails with "Error evaluating recurrence rule" #85365

Closed
slovdahl opened this issue Jan 7, 2023 · 1 comment · Fixed by #85453
Assignees
Milestone

Comments

@slovdahl
Copy link
Contributor

slovdahl commented Jan 7, 2023

The problem

After updating from 2022.12.7 to 2023.1.1, I started getting an error in the log:

Error evaluating recurrence rule (RulesetIterable(dtstart=2022-11-18, rrule=['DTSTART:20221118T000000\nRRULE:FREQ=WEEKLY;UNTIL=20230216T000000;BYDAY=FR'], rdate=[], exdate=[datetime.datetime(2023, 1, 6, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Helsinki'))])): can't compare datetime.datetime to datetime.date

What version of Home Assistant Core has the issue?

2023.1.1

What was the last working version of Home Assistant Core?

2022.12.7

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Google Calendar

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-01-07 12:20:14.665 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/ical/iter.py", line 190, in __iter__
    for value in self._ruleset():
  File "/usr/local/lib/python3.10/site-packages/dateutil/rrule.py", line 1401, in _iter
    while exlist and exlist[0] < ritem:
  File "/usr/local/lib/python3.10/site-packages/dateutil/rrule.py", line 1338, in __lt__
    return self.dt < other.dt
TypeError: can't compare datetime.datetime to datetime.date

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 474, in refresh
    await self.coordinator.async_request_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 175, in async_request_refresh
    await self._debounced_refresh.async_call()
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 82, in async_call
    await task
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 201, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 316, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 121, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 508, in _handle_coordinator_update
    self._apply_coordinator_update()
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 491, in _apply_coordinator_update
    if api_event := next(
  File "/usr/local/lib/python3.10/site-packages/ical/iter.py", line 369, in active_after
    for item in self._iterable:
  File "/usr/local/lib/python3.10/site-packages/ical/iter.py", line 252, in __next__
    self._make_heap()
  File "/usr/local/lib/python3.10/site-packages/ical/iter.py", line 242, in _make_heap
    next_item = next(iterator)
  File "/usr/local/lib/python3.10/site-packages/ical/iter.py", line 222, in __iter__
    for dtvalue in self._recur:
  File "/usr/local/lib/python3.10/site-packages/gcal_sync/timeline.py", line 92, in __iter__
    for value in self._func:
  File "/usr/local/lib/python3.10/site-packages/ical/iter.py", line 193, in __iter__
    raise RecurrenceError(
ical.iter.RecurrenceError: Error evaluating recurrence rule (RulesetIterable(dtstart=2022-11-18, rrule=['DTSTART:20221118T000000\nRRULE:FREQ=WEEKLY;UNTIL=20230216T000000;BYDAY=FR'], rdate=[], exdate=[datetime.datetime(2023, 1, 6, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Helsinki'))])): can't compare datetime.datetime to datetime.date

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 7, 2023

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (google) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of google can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign google Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


google documentation
google source
(message by IssueLinks)

@allenporter allenporter changed the title Google Calendar error evaluating recurrence rule Google Calendar API returns invalid recurrence rules and fails with "Error evaluating recurrence rule" Jan 7, 2023
@allenporter allenporter added this to the 2023.1.2 milestone Jan 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants