[Calendar] Very slow Google Calendar integration

I’m facing a slowdown since a few weeks regarding google calendar.
When I have google: configured in my configuration.yaml, my HA takes ages to start up (>5min).
If I remove that from my config, HA is superfast (< 30sec to start).

Analyzing logs (with some debug on caledar) I have following entries:

2022-01-05 22:20:12 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: google, met, ble_monitor

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:12 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.google

2022-01-05 22:20:14 WARNING (MainThread) [homeassistant.components.ssdp] Failed to setup listener for fe80::6a96:2e14:4ed4:c46a: [Errno -2] Name does not resolve

2022-01-05 22:20:14 WARNING (MainThread) [homeassistant.components.ssdp] Failed to setup listener for fda8:1129:473c:0:8308:acf:9415:9c6: [Errno -2] Name does not resolve

2022-01-05 22:20:14 WARNING (MainThread) [homeassistant.components.ssdp] Failed to setup listener for fda8:1129:473c:10:eb75:14be:2e94:4fb: [Errno -2] Name does not resolve

2022-01-05 22:20:14 WARNING (MainThread) [homeassistant.components.ssdp] Failed to setup listener for fe80::60e2:2d3d:142c:a92e: [Errno -2] Name does not resolve

2022-01-05 22:20:22 WARNING (MainThread) [homeassistant.components.calendar] Setup of calendar platform google is taking over 10 seconds.

2022-01-05 22:35:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.tobi06_gmail_com is taking over 10 seconds

2022-01-05 22:36:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.day_off is taking over 10 seconds

2022-01-05 22:36:12 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.amaelle is taking over 10 seconds

2022-01-05 22:51:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.tobi06_gmail_com is taking over 10 seconds

2022-01-05 22:51:58 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.day_off is taking over 10 seconds

2022-01-05 22:52:11 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.amaelle is taking over 10 seconds

2022-01-05 23:07:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.tobi06_gmail_com is taking over 10 seconds

2022-01-05 23:08:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.day_off is taking over 10 seconds

2022-01-05 23:08:13 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.amaelle is taking over 10 seconds

2022-01-05 23:23:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.tobi06_gmail_com is taking over 10 seconds

2022-01-05 23:24:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.day_off is taking over 10 seconds

2022-01-05 23:24:13 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.amaelle is taking over 10 seconds

2022-01-05 23:39:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.tobi06_gmail_com is taking over 10 seconds

2022-01-05 23:40:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.day_off is taking over 10 seconds

2022-01-05 23:40:13 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.amaelle is taking over 10 seconds

2022-01-05 23:55:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.tobi06_gmail_com is taking over 10 seconds

2022-01-05 23:56:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.day_off is taking over 10 seconds

2022-01-05 23:56:13 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.amaelle is taking over 10 seconds

I’ve already attempted to delete the .google_token and google_calendars.yaml, but issue persists.

Anyone facing the same ?

Google calendar starts quicker if you disable IPV6 on your HA server (but still slow)

I’ve got the same issue. When I enable Google integration, HA starts very slowly. eth0 has IPv6 address, assigned by DHCP, and it can’t be disabled by config somehow. Config - General - Network only has a flag to assign it with DHCP. There’s no info about disablint IPv6 here: Network Configuration - Home Assistant

I’ve noticed that the delay of HA startup may be due to some network issue…
You can leave ipv6 enabled, but make sure your host and HA can ping6 towards the web.

In my case I’ve been securing my network and disabled the ping (except for some cases where I know it was necessary).
I now added another ping exception for HA and Google Calendar now loads super fast (couple of seconds tops)

I’ve configured IPv6 support on my HA interface, I can see it from LAN. But when I try to ping any LAN machine from HA, I get:

 [core-ssh ~]$ ping 2a05:3580:f909:7201:529:2836:a161:f26b
 PING 2a05:3580:f909:7201:529:2836:a161:f26b (2a05:3580:f909:7201:529:2836:a161:f26b): 56 data bytes
 ping: sendto: Address not available

Any advices?

Try ping6 2a05:3580:f909:7201:529:2836:a161:f26b

I’ve found the issue. SSH addin starts in its own docker container with its own ip address. That’s why it can’t ping v6 adresses. HA CAN do it. With IPv6 support HA starts really fast. To enable IPv6 support I just enabled it on my router, HA picked an IPv6 address automatically.