Error integrating Google Calendar

Hi everyone,

I’m trying to integrate Google Calendar to Home Assistant. Everything is working well until I reach the Oauth and Device Authorization steps. After I copy the code into Google’s page, I succeed to authorize however when I go back to Home Assistant, I get the following message:
image

Checking the logs I have the following entries:

Logger: aiohttp.server
Source: components/google/config_flow.py:148
First occurred: 12:36:03 (1 occurrences)
Last logged: 12:36:03

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 171, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 96, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/google/config_flow.py", line 130, in async_step_creation
    return await super().async_step_creation(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 314, in async_step_creation
    return await self.async_oauth_create_entry(
  File "/usr/src/homeassistant/homeassistant/components/google/config_flow.py", line 148, in async_oauth_create_entry
    primary_calendar = await calendar_service.async_get_calendar("primary")
  File "/usr/local/lib/python3.10/site-packages/gcal_sync/api.py", line 330, in async_get_calendar
    return Calendar.parse_obj(result)
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Calendar
accessRole
  field required (type=value_error.missing)

Could you please help me solve this issue?

Thanks!

3 Likes

Same problem here…

I ran into the same today and found out there is an issue open for it on github with a pull request to resolve it so I guess we need to be patient and wait for it to be included in a future minor update: Google Calendar config flow setup fails · Issue #81825 · home-assistant/core · GitHub

2 Likes

me too
same Issue

I have similar issue. Please update.

Same here. Thought my integration was broken. So i deleted the integration with keeping data. Then adding it again, but… failed…

As it is indicated here, a fix will be available in the release 2022.11.3.

Still getting this error after the update

2022.11.3 is not out yet…

Any idea about when the fix will be out?

Looking here, it seems the release will be out on the 7th December.

Same issue here.
Home Assistant 2022.11.2

2nd December should be 2022.12.0, the fix should be available in 2022.11.3 which should be earlier.

2 Likes

Update is out and it’s working. :tada:

1 Like

Problem solved with update 2022.11.3

Team - a note of thanks. Love this platform and all of you who make it work.

1 Like

Good morning!

I just updated to 2023.1 and based on the changes in the Google Calendar add-on I decided to try to add it to my HA.

But is got the ‘failed to connect’ message.

I went throught the install with OAuth ID, switching to google to verify the app and in google’s devices Home Assistant with Calendar permission is showing.

The add-on won’t add.

Have you tried to add it prior to this latest update? I have an installed the newest version as I like to wait a bit before I do in case there are bugs that will affect me.

No only after 23.1 the latest update. But I followed the tutorial and it’s in Google’s list.

That makes me afraid to update until I hear about other successfully using Google calendar on the 2023 version.