Core: [Caldav] Crashes on startup

Created on 2 May 2019  路  6Comments  路  Source: home-assistant/core

Home Assistant release with the issue:
0.92.1

Last working Home Assistant release (if known):
Unknown, first attempt

Operating environment (Hass.io/Docker/Windows/etc.):
Official docker image, current as of today

Component/platform:

Caldav

Description of problem:

  • No calendar sensors loaded
  • Error messages in log (down in traceback)

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

calendar:
  - platform: caldav
    url: "https://p39-caldav.icloud.com/xxx/calenders/yyy"
    username: "zzz"
    password: "www (app specific)"
    calendars:
      - 'Calender Name'

Traceback (if applicable):

2019-05-01 17:34:22 ERROR (MainThread) [homeassistant.components.calendar] Error while setting up platform caldav
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/caldav/calendar.py", line 55, in setup_platform
    calendars = client.principal().calendars()
  File "/usr/local/lib/python3.7/site-packages/caldav/objects.py", line 417, in calendars
    return self.calendar_home_set.calendars()
  File "/usr/local/lib/python3.7/site-packages/caldav/objects.py", line 396, in calendar_home_set
    '{urn:ietf:params:xml:ns:caldav}calendar-home-set']
  File "/usr/local/lib/python3.7/site-packages/caldav/objects.py", line 405, in calendar_home_set
    if (sanitized_url.hostname and
AttributeError: 'NoneType' object has no attribute 'hostname'

Additional information:

  • If I curl -I https://p39-caldav.icloud.com/xxx/calenders/yyy, I get a 401 unauthorized
  • If I curl -I -u zzz:www https://p39-caldav.icloud.com/xxx/calenders/yyy, I get a 200 okay

So it's likely that auth is working, it's crashing on whatever it loads from the calendar.

caldav

Most helpful comment

Hi,

please change your url setting to

url: https://caldav.icloud.com

and test again. The underlying component can detect your calendars.

All 6 comments

Hi,

please change your url setting to

url: https://caldav.icloud.com

and test again. The underlying component can detect your calendars.

The underlying component can detect your calendars.

Ooh, awesome! Works great now, thanks! 馃槃

@ReneNulschDE is it possible to validate the url better during config validation to avoid an issue like this?

@MartinHjelmare : Not sure how to check this. (Was my first visit of the underlying CalDav repo.) How about adding this note to the docs:

# Example configuration.yaml entry for icloud.com, calendars will be found automatically, to set-up the app specific password see https://support.apple.com/en-us/HT204397
calendar:
  - platform: caldav
    username: john.doe
    password: !secret icloud_app_password
    url: https://caldav.icloud.com

Works for me as well !! Awesome.
Tx a lot !!

ive added my settings to my config but no calendar shows up in the front end how do I get it to show the calendar in the gui?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdraco picture bdraco  路  3Comments

sogeniusio picture sogeniusio  路  3Comments

aweb-01 picture aweb-01  路  3Comments

arangates picture arangates  路  3Comments

coolriku picture coolriku  路  3Comments