CalDAV-Error due to a location

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.

Nobody who have an idea? :flushed:

Looks like CalDAV doesn’t like entries made by (some?) Apple devices. Best is to open an issue about the matter at Github.

Additionally it would be helpful to show your CalDAV configuration inside configuration.yaml and to tell us which CalDAV-server you are connecting to.

Well, it is the CalDAV of Synology and as I wrote I have tons of appointments with locations but the thing is, sometimes this error occurs.
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"

Regarding the issue: I thought so but I just wanted to wait what you guys know about this.

I opened an issue: https://github.com/home-assistant/core/issues/55778

It’s a parse error at line 13 of the referring entry. It doesn’t matter at this point whether the event matches a given search condition or not. CalDAV parses all entries inside calendar "Gemeinsam" to look for the search term "Marco: Urlaub". And as the error log already is pointing it out it fails at line 13 at this particular calendar entry.

Hello @Friedi have you fixed the problem? I’m experiencing the same error in the logs. I’m also using a Synology Caldav server .

Nope :-1:
I opened an issue at github for python caldav but I am not able to help.

Sorry, but for this I am to Un-Linux …

If you are interested to help: https://github.com/python-caldav/caldav/issues/151#issuecomment-921007069

@Friedi I am running the CalDAV of Synology as well and can’get this working. Did you ever get this solved?

Well, meanwhile it works almost well for me.
Could you describe your problem more precisely?

I think I first have to install the CalDav addon first via the HA OS commandline interface on my HASS server. I did not do that so far

HA> HA addons install caldav

And then edit the configuration yaml file.

Is that correct?

I just edited my yaml. Never installed anything.

1 Like

Can you post the yaml that works for you with fake credentials

Here you are :slight_smile:


calendar:
  - platform: caldav
    username: !secret calendar_caldav_username
    password: !secret calendar_caldav_calendar_caldav_password
    url: https://myurl.de/caldav.php/User
    days: 14
    custom_calendars:
      - name: nuernberg
        calendar: "Gemeinsam"
        search: "Marco: NĂĽrnberg"
      - name: herzogenaurach
        calendar: "Gemeinsam"
        search: "Marco: Herzogenaurach" 
      - name: homeoffice
        calendar: "Gemeinsam"
        search: "Marco: Homeoffice" 

1 Like