core icon indicating copy to clipboard operation
core copied to clipboard

Google integration api error

Open Sathans opened this issue 1 year ago • 3 comments

The problem

I'm not able to connect to home assistant via google home. Tried relinking, but is not able to connect (from google home) after the login screen (Home assistant). Creating a new google action also fails at the linking from google home part.

What version of Home Assistant Core has the issue?

all

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Home Assistant WebSocket API

Link to integration documentation on our website

No response

Diagnostics information

config_entry-google_assistant-01JAG3BF69QVAQH6THRQJ6KJNM.json

Example YAML snippet

google_assistant:
  project_id: xxxxxx (removed)
  service_account: !include SERVICE_ACCOUNT.JSON
  report_state: true  
  exposed_domains:
    - switch
    - light

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 17:26:00 (1 occurrences)
Last logged: 17:26:00

[140296839776864] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 132, in _async_press_action
    await self.async_press()
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/button.py", line 60, in async_press
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Unable to sync devices with result code: 404, check log for more info.

Additional information

No response

Sathans avatar Oct 18 '24 15:10 Sathans

I am also seeing this all of the sudden since yesterday afternoon. Everything was working perfectly before.

To try and fix, I've relinked in the Google Home app with no changes. I've recreated the preview in the Google Action console and then tried resyncing, but nothing seems to be working.

I get the same errors as you and google home cannot communicate with HA.

Logger: homeassistant.components.google_assistant.http
Source: components/google_assistant/http.py:284
integration: Google Assistant ([documentation](https://www.home-assistant.io/integrations/google_assistant), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+google_assistant%22))
First occurred: 12:19:10 AM (4 occurrences)
Last logged: 10:42:19 AM

Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 404
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 12:19:10 AM (4 occurrences)
Last logged: 10:42:19 AM

[140328343877472] Unexpected exception
[140328097548896] Unexpected exception
[140328474118320] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 132, in _async_press_action
    await self.async_press()
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/button.py", line 60, in async_press
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Unable to sync devices with result code: 404, check log for more info.

LckyLuciano avatar Oct 18 '24 15:10 LckyLuciano

Same for me. Spent all day trying to setup HA GA integration - multiple projects in actions, multiple attempts. I am using nginx pm and static ip with my own domain. I am unable to connect to my test app. It is visible but I get: Could not reach [test app]. Please try again. In the logs I can see similar error connected to webapi that shows up near the homegraph error:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/button/init.py", line 132, in _async_press_action await self.async_press() File "/usr/src/homeassistant/homeassistant/components/google_assistant/button.py", line 60, in async_press raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Unable to sync devices with result code: 404, check log for more info.

and also compains regarding homegraph in logs: Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404 Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 404

lukaszzyla avatar Oct 19 '24 18:10 lukaszzyla

My issue is fixed, apparently I my ssl certificate is broken after switching dns provider. So google can't connect to the server thinking it is unsafe.

Sathans avatar Oct 20 '24 00:10 Sathans

I fixed my issue, too. If you're using Cloudflare as your DNS provider for home assistant, their "Bot Fight Mode" will prevent Google from connecting to HA. image

LckyLuciano avatar Oct 21 '24 19:10 LckyLuciano

@LckyLuciano OMG thanks, this was it for me!

dextorer avatar Nov 02 '24 09:11 dextorer

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.