core: CalDAV-Error due to a location

The problem

Hi all,

Actually with the integration everything is working well but after restarting HA I realized the following problem with CalDAV. The thing is that suddenly no calendar data were loaded. Therefore I went to logs and got the following:

Logger: homeassistant.components.calendar
Source: components/caldav/calendar.py:201
Integration: Kalender (documentation, issues)
First occurred: 10:58:50 (6 occurrences)
Last logged: 10:58:53

caldav: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 646, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/caldav/calendar.py", line 135, in update
    self.data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/caldav/calendar.py", line 201, in update
    vevent = event.instance.vevent
  File "/usr/local/lib/python3.9/site-packages/caldav/objects.py", line 1058, in _get_vobject_instance
    self._set_vobject_instance(vobject.readOne(to_unicode(self._get_data())))
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 1155, in readOne
    return next(readComponents(stream, validate, transform, ignoreUnreadable,
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 1101, in readComponents
    vline = textLineToContentLine(line, n)
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 925, in textLineToContentLine
    return ContentLine(*parseLine(text, n), **{'encoded': True,
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 813, in parseLine
    raise ParseError("Failed to parse line: {0!s}".format(line), lineNumber)
vobject.base.ParseError: At line 13: Failed to parse line: X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-APPLE-MAPKIT-HANDLE=CAESoAIIrk0Q5cuty9Xtjc0ZGhIJvCAiNe3ySEARwCK/fojNJUAiZQoLRGV1dHNjaGxhbmQSAkRFGgZCYXllcm4qB0JhbWJlcmcyB0JhbWJlcmc6BTk2MDUwUhRLdW5pZ3VuZGVucnVoc3RyYcOfZVoCMzBiF0t1bmlndW5kZW5ydWhzdHJhw59lIDMwKhBUYXZlcm5hIEdlb3JnaW9zMhdLdW5pZ3VuZGVucnVoc3RyYcOfZSAzMDINOTYwNTAgQmFtYmVyZzILRGV1dHNjaGxhbmQ4L1pNCiQI5cuty9Xtjc0ZEhIJvCAiNe3ySEARwCK/fojNJUAYrk2QAwGiHyQI5cuty9Xtjc0ZGhgKEFRhdmVybmEgR2Vvcmdpb3MQACoCZGU=;X-APPLE-RADIUS=141.1750744752817;X-APPLE-REFERENCEFRAME=0;X-TITLE="Taverna Georgios

In the last line there is the parse error. What is really starnge for me is the fact that as soon as I delete the location from the corresponding event everything works fine again. Of course I have a lot of events with locations and only in some cases this error occur. In this case the address is as follows:

Taverna Georgios Kunigundenruhstraße 30, 96050 Bamberg, Deutschland

It seems the integration has a problem with locations.

The other strange thing is, that this event does not match the the search condition for the custom calendar.

Here’s the YAML:

calendar:
  - platform: caldav
    username: 'Marco'
    password: 'areallysuperpassword'
    url: https://my.syno.installation.de/caldav.php/Marco
    custom_calendars:
      - name: urlaub_marco
        calendar: "Gemeinsam"
        search: "Marco: Urlaub"

What is version of Home Assistant Core has the issue?

core-2021.9.3

What was the last working version of Home Assistant Core?

No response

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/int…

Example YAML snippet

calendar:
  - platform: caldav
    username: 'Marco'
    password: 'areallysuperpassword'
    url: https://my.syno.installation.de/caldav.php/Marco
    custom_calendars:
      - name: urlaub_marco
        calendar: "Gemeinsam"
        search: "Marco: Urlaub"

Anything in the logs that might be useful for us?

Logger: homeassistant.components.calendar
Source: components/caldav/calendar.py:201
Integration: Kalender (documentation, issues)
First occurred: 10:58:50 (6 occurrences)
Last logged: 10:58:53

caldav: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 646, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/caldav/calendar.py", line 135, in update
    self.data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 277, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/caldav/calendar.py", line 201, in update
    vevent = event.instance.vevent
  File "/usr/local/lib/python3.9/site-packages/caldav/objects.py", line 1058, in _get_vobject_instance
    self._set_vobject_instance(vobject.readOne(to_unicode(self._get_data())))
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 1155, in readOne
    return next(readComponents(stream, validate, transform, ignoreUnreadable,
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 1101, in readComponents
    vline = textLineToContentLine(line, n)
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 925, in textLineToContentLine
    return ContentLine(*parseLine(text, n), **{'encoded': True,
  File "/usr/local/lib/python3.9/site-packages/vobject/base.py", line 813, in parseLine
    raise ParseError("Failed to parse line: {0!s}".format(line), lineNumber)
vobject.base.ParseError: At line 13: Failed to parse line: X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-APPLE-MAPKIT-HANDLE=CAESoAIIrk0Q5cuty9Xtjc0ZGhIJvCAiNe3ySEARwCK/fojNJUAiZQoLRGV1dHNjaGxhbmQSAkRFGgZCYXllcm4qB0JhbWJlcmcyB0JhbWJlcmc6BTk2MDUwUhRLdW5pZ3VuZGVucnVoc3RyYcOfZVoCMzBiF0t1bmlndW5kZW5ydWhzdHJhw59lIDMwKhBUYXZlcm5hIEdlb3JnaW9zMhdLdW5pZ3VuZGVucnVoc3RyYcOfZSAzMDINOTYwNTAgQmFtYmVyZzILRGV1dHNjaGxhbmQ4L1pNCiQI5cuty9Xtjc0ZEhIJvCAiNe3ySEARwCK/fojNJUAYrk2QAwGiHyQI5cuty9Xtjc0ZGhgKEFRhdmVybmEgR2Vvcmdpb3MQACoCZGU=;X-APPLE-RADIUS=141.1750744752817;X-APPLE-REFERENCEFRAME=0;X-TITLE="Taverna Georgios

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 54 (13 by maintainers)

Most upvoted comments

@Friedi1970 will have to check if the bumped version fixes his problem or not.

(Short summary: server delivers some icalendar data that most likely is broken, the vobject library throws an error, since I don’t have the exact copy of the icalendar data I’m not able to reproduce the problem, but I’ve attempted to add a workaround in the caldav library for some issues reported by others)

Hi, i opened a PR #63280 to bump to 0.8.2 version

To just try the new library version, perform steps from #55778 (comment) but also change the library version in manifest file like

Ah 🤦‍♂️ Thanks for the hint! I will try after X-Mas. If I do before the WAF will decrease to a minus value 🙄

Right. Coordinate seemed a bit off indeed, I considered 55 degrees north must be the very south tip of Sweden, but it’s indeed a bit out in the Baltic sea already 😃

I’m able to read the ical data given into vobject without any errors and transform it back to a string, so the ical data that was sent to me by email seems to be valid. So this is a dead end. 😕

Got it.

Most likely not related, but it is probably a good idea to turn on logging as shown in https://github.com/home-assistant/core/issues/55778#issuecomment-925156198

@mib1185 I opened the issue.