Daanoz / ha-google-photos

Home Assistant Google Photos integration
MIT License
84 stars 5 forks source link

Generic Error #12

Closed LEdiodes closed 1 year ago

LEdiodes commented 1 year ago

After installing the integration from HACS and attempting to add the integration, I get to the final step when I link it to my home assistant url I select the link and then I get a popup that says "Error". Any help would be greatly appreciated as I am really excited to get this integration working!

image

Here is the only log I am finding;

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/google_photos/config_flow.py:87 Integration: Google Photos (documentation, issues) First occurred: 1:00:08 PM (2 occurrences) Last logged: 1:04:42 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, 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 67, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, 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 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 234, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, 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 271, 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/helpers/config_entry_oauth2_flow.py", line 332, in async_step_creation return await self.async_oauth_create_entry( File "/config/custom_components/google_photos/config_flow.py", line 99, in async_oauth_create_entry (await self.hass.async_add_executor_job(_check_photoslibrary_access)) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) File "/config/custom_components/google_photos/config_flow.py", line 87, in _check_photoslibrary_access lib = build( File "/usr/local/lib/python3.10/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper return wrapped(args, **kwargs) TypeError: build() got an unexpected keyword argument 'static_discovery'

Daanoz commented 1 year ago

Happy to have look. I suspect there is a collision on the Google api dependency. Which version of homeassistent are you using? And maybe any other integrations that are using the Google api and their version?

LEdiodes commented 1 year ago

Home assistant information: Home Assistant 2023.3.6 Supervisor 2023.03.2 Operating System 9.5 Frontend 20230110.0 - latest

I'm using the following Google integrations: Google Nest Google Mail (gmail) Google Keep HACS

I'm not sure how to see the version unless there is a pending update, but all my integrations including HACS are all up to date and working

LEdiodes commented 1 year ago

I don't really know what I did but I finally got the integration to work. I was also having problems with Google Fit HACS integration so I removed the config from my configuration.yaml for google fit. remove both integrations from HACS, rebooted, then installed Google Photos integration and it worked!! I'm so excited to start playing around with this!

Daanoz commented 1 year ago

The Google Fit integration is very likely the problem. I couldn't find one in the HACS store directly, but assuming it's vmanuel/hacs-google-fit, it's using a pre 2.x version of the google api package. The version used, doesn't support the static_discovery flag which is needed for the google photos api (v1.12.11 vs v2.82.0).

It's actually surprising that the other Google integrations kept working, the Gmail integration for example also uses a 2.x version of the Google Api package, but apparently only uses functionality that was also available before 2.x was released.