core: CalDAV Integration Authorization Error on Baikal CalDAV Server

The problem

After updating Home Assistant to version 2022.02.x, the CalDAV integration fails to connect to my Baikal server with an authorization error. Before the update everything worked well. I didn’t change anything in the integration settings.

What version of Home Assistant Core has the issue?

core-2022.2.0

What was the last working version of Home Assistant Core?

core-2021.12.10

What type of installation are you running?

Home Assistant Core

Integration causing the issue

CalDAV

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

- platform: caldav
    url: !secret caldav_url
    username: !secret caldav_username
    password: !secret caldav_password
    calendars:
      - vacations

Anything in the logs that might be useful for us?

ERROR (MainThread) [homeassistant.components.calendar] Error while setting up caldav platform for calendar
  File "/opt/homeassistant/lib/python3.9/site-packages/homeassistant/components/caldav/calendar.py", line 87, in setup_platform
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/davclient.py", line 350, in principal
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/objects.py", line 399, in __init__
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/objects.py", line 174, in get_property
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/objects.py", line 197, in get_properties
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/objects.py", line 141, in _query_properties
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/objects.py", line 159, in _query
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/davclient.py", line 398, in propfind
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/davclient.py", line 577, in request
  File "/opt/homeassistant/lib/python3.9/site-packages/caldav/davclient.py", line 560, in verify_login
caldav.lib.error.AuthorizationError: AuthorizationError at 'https://mydomain.com/cal.php/calendars/golds/default', reason 'Unauthorized'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 41 (20 by maintainers)

Most upvoted comments

Ok, so I had a bit of spare time and was able to fix it. I’ve patched a tst container (copy from my active HA container) with python-caldav v0.9.0 and the issue discussed here was resolved, unfortunately I ran into another error, this one:. https://github.com/sabre-io/Baikal/issues/982

Luckily I was able to fix it with this solution on the Baikal config: https://github.com/sabre-io/dav/issues/1318#issuecomment-757380175

So now I have a tst environment where the fix(es) were successfully applied. Now (probably tomorrow) time to check how to create the PR for python-caldav v0.9.0 🙂

So it took a while, bit it looks like it is resolved (until the next HA version)

@allenporter Hey Allen, I am seeing that You’re active in improving the Calendar integration. Would it be possible for You to include the newer python-caldav version of tobixen into HA?

I got busy with guests previous weekend, but I’m working on running tests for the caldav library now and will release 0.9 this weekend 😃

First I have to release 0.9. Then it has to be picked up by the HA-team. Then we have to wait for a release of HA. But I promise, I’ll do everything I can to have 0.9 released before or during the weekend.