Google calendar integration stopped working

Hello,

Since this morning the google calendar integration is not working anymore. Iv’ regenerated a new client security token but with no luck.

Anybody an idea?

Thanks
Stijn

2020-02-16 08_10_31-Window

AttributeError: ‘NoneType’ object has no attribute ‘authorize’

2020-02-16 08:06:56 ERROR (MainThread) [homeassistant.components.calendar] google: Error on device update!

Traceback (most recent call last):

File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 304, in _async_add_entity

await entity.async_device_update(warning=False)

File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 461, in async_device_update

await self.hass.async_add_executor_job(self.update)

File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run

result = self.fn(*self.args, **self.kwargs)

File “/usr/src/homeassistant/homeassistant/components/google/calendar.py”, line 106, in update

self.data.update()

File “/usr/src/homeassistant/homeassistant/util/init.py”, line 240, in wrapper

result = method(*args, **kwargs)

File “/usr/src/homeassistant/homeassistant/components/google/calendar.py”, line 169, in update

service, params = self._prepare_query()

File “/usr/src/homeassistant/homeassistant/components/google/calendar.py”, line 132, in _prepare_query

service = self.calendar_service.get()

File “/usr/src/homeassistant/homeassistant/components/google/init.py”, line 346, in get

http = credentials.authorize(httplib2.Http())

I have the same issue after perfomring all updates:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in _safe_execute
    await self._execute_service(handler, service_call)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
    await self._hass.async_add_executor_job(handler.func, service_call)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 256, in _scan_for_calendars
    service = calendar_service.get()
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 346, in get
    http = credentials.authorize(httplib2.Http())
AttributeError: 'NoneType' object has no attribute 'authorize'

2020-02-16 10:26:28 ERROR (MainThread) [homeassistant.components.calendar] google: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 106, in update
    self.data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 169, in update
    service, params = self._prepare_query()
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 132, in _prepare_query
    service = self.calendar_service.get()
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 346, in get
    http = credentials.authorize(httplib2.Http())
AttributeError: 'NoneType' object has no attribute 'authorize'
2020-02-16 10:26:28 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2020-02-16 10:26:28 ERROR (MainThread) [homeassistant.components.calendar] google: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 106, in update
    self.data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 169, in update
    service, params = self._prepare_query()
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 132, in _prepare_query
    service = self.calendar_service.get()
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 346, in get
    http = credentials.authorize(httplib2.Http())
AttributeError: 'NoneType' object has no attribute 'authorize'

2020-02-16 10:26:28 ERROR (MainThread) [homeassistant.components.calendar] google: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 106, in update
    self.data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 169, in update
    service, params = self._prepare_query()
  File "/usr/src/homeassistant/homeassistant/components/google/calendar.py", line 132, in _prepare_query
    service = self.calendar_service.get()
  File "/usr/src/homeassistant/homeassistant/components/google/__init__.py", line 346, in get
    http = credentials.authorize(httplib2.Http())
AttributeError: 'NoneType' object has no attribute 'authorize'

solution https://github.com/home-assistant/home-assistant/issues/27210#issuecomment-584471544

1 Like

Thank you MartinSnow. It worked.

Stijn

1 Like

@MartinSnow worked like a charm !
Thanks.

1 Like

Hi, I’m reviving this thread since the fix posted is no longer working for me. I’ve tried that a couple of months ago and it worked as expected but then the integration stop working (2-3 weeks ago) and when deleting the google.token file I get the following notification error when restarting HA

Google Calendar Setup
Error: Invalid response 401. Error: deleted_client
You will need to restart hass after fixing.

Any help would be greatly appreciated.

I’m getting the same issue (401) after just adding the Google Calendar. The solution (deleting the .google.token file and restarting) doesn’t work for me (the .google.token file doesn’t exist).