Core: google_assistant.request_sync failed

Created on 19 Jan 2019  路  32Comments  路  Source: home-assistant/core

google_assistant stale

Most helpful comment

@pszafer Didn't work in my case

All 32 comments

i receive error in webpage and this in log

2019-01-19 19:18:50 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1701579152] Error handling message: {'type': 'call_service', 'service_data': {}, 'domain': 'google_assistant', 'id': 54, 'service': 'request_sync'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/client_reqrep.py", line 916, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/websocket_api/decorators.py", line 17, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/core.py", line 1121, in async_call
    self._execute_service(handler, service_call))
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/core.py", line 1143, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/google_assistant/__init__.py", line 80, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/client_reqrep.py", line 943, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/streams.py", line 319, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

tanks u

me to

For update entity in Google assistant I disconnect and reconnect my app google platform.
The error start when I send google request sync

The disconnect option is the last one for me, because everything in the routines will delete

For me name of the Smart home app was issue... if I don't put name I've got 404 Not found.
image

Let me know if this helps you too.

@pszafer Didn't work in my case

Same problem here, stopped working, don't know really when. Using the latest 0.86

Log Details (ERROR)
Thu Jan 24 2019 10:10:16 GMT+0100 (Central European Standard Time)

Error while executing automation automation.refresh_google_assistant. Unknown error for call_service at pos 1: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/automation/__init__.py", line 380, in action
    await script_obj.async_run(variables, context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 131, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 210, in _handle_action
    action, variables, context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 299, in _async_call_service
    context=context
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 85, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1126, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1148, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/google_assistant/__init__.py", line 80, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 969, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/streams.py", line 335, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

Automation yaml

# Refresh Google Assistant
- alias: "Refresh Google Assistant"
  hide_entity: true
  trigger:
    platform: homeassistant
    event: start
  action:
    service: google_assistant.request_sync

Same here, giving the action a name also doesn't work. The only difference is that I get a 403:

2019-01-24 14:48:22 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.547529709048] Error handling message: {'type': 'call_service', 'domain': 'google_assistant', 'service': 'request_sync', 'service_data': {}, 'id': 15}
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 916, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/websocket_api/decorators.py", line 17, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1121, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1143, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/google_assistant/__init__.py", line 80, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 943, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.6/site-packages/aiohttp/streams.py", line 319, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

Same here. Stop syncing after upgrade from 84 to 85

Same problem here. Is there a chance to fix it without unlinking? I don't want to setup the hole stuff again and again. :(

@Apolli Did you try what @konzolec suggested?
Basically restart the "test draft" in the Actions on Google console, then trying another resync?

@TheJulianJES Hm your right. My draft was timed out. But why do i need an active draft for sync but not for the daily usage?

After reactivating the draft i recieved an forbidden error.
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden'

Maybe my Auth-Token was invalid after the reactivating? Could it be?

Also my draft was timed out. I re do a test. But now i can not resync AND use google assistant at all.

0.86.3

Unlink and relink google assistant in GH app restored the link.

I have tried to unlink and relink, but now on both my wife's and my own device it won't relink again.
It says 'linking successfull', but the [test] app does not appear in the linked accounts, and the devices don't show up.
The HA logs don't say anything, except for a 403 when I request a google.sync_devices. Guess my only option is to start all over for the google part.

EDIT:
It seems that this was my issue
I had expose_by_default set to false, and nothing explicit set in the entity_config

Same here. Error 403

Error handling message: {'type': 'call_service', 'domain': 'google_assistant', 'service': 'request_sync', 'service_data':` {}, 'id': 35}
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/decorators.py", line 17, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 147, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1133, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1155, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/google_assistant/__init__.py", line 80, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 969, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 335, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

Same here:
Error handling message: {'type': 'call_service', 'domain': 'google_assistant', 'service': 'request_sync', 'service_data': {}, 'id': 25}

I have the account linked but the "ok google sync my devices" don't work.

Same here
```2019-02-28 14:18:53 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1973512528] Error handling message: {'service': 'request_sync', 'id': 19, 'type': 'call_service', 'service_data': {}, 'domain': 'google_assistant'}
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
res.raise_for_status()
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/websocket_api/decorators.py", line 17, in _handle_async_response
await func(hass, connection, msg)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/websocket_api/commands.py", line 147, in handle_call_service
connection.context(msg))
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1133, in async_call
self._execute_service(handler, service_call))
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1155, in _execute_service
await handler.func(service_call)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/google_assistant/__init__.py", line 80, in request_sync_service_handler
body = await res.read()
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/client_reqrep.py", line 969, in read
self._body = await self.content.read()
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/streams.py", line 335, in read
raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed`

@riddik14 have you resolved the issue? It seems to be the limitation of not using cloud due to the authentication timing out. Have you tried @Devqon's solution:

It seems that this was my issue
I had expose_by_default set to false, and nothing explicit set in the entity_config

https://github.com/home-assistant/home-assistant/issues/16026

Push failed:



Error 404 (Not Found)!!1


404. That鈥檚 an error.

That鈥檚 all we know.

try to reenable the simulator. for me working

https://developers.google.com/actions/tools/simulator

What @freemiumdev mentioned worked for me too. Go to https://console.actions.google.com/ then Test > Simulator and then run the test again which will re-enable it.

Having almost the same problem. When i call google_assistant.request_sync i get 2 errors:

First:
Log Details (ERROR) Thu May 02 2019 01:09:23 GMT+0300 (Eastern European Summer Time) Error doing job: Fatal error on transport Traceback (most recent call last): File "uvloop/sslproto.pyx", line 574, in uvloop.loop.SSLProtocol._do_shutdown File "/usr/local/lib/python3.7/ssl.py", line 767, in unwrap return self._sslobj.shutdown() ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2609)

and Second:

Connection closed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/google_assistant/__init__.py", line 76, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1138, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1160, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/google_assistant/__init__.py", line 78, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 969, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 335, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

If i say "Ok Google, sync devices", i have no errors, and the devices sync ok.

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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I have the same log error without using google assistant...

I'm still experiencing the issue and would love to have the issue reopened.

Reenabling the simulator did the job for me

For anyone that might be getting the 403 error. Try going to your API credentials, click the OAuth2.0 API edit button, and then just save it again. Don't ask me why it works but thats what I did when I just received a 403. Soon as I saved the API again (didn't change any settings), sync worked again. Weird.

Same here

Wed Sep 25 2019 17:27:11 GMT+0200
Error while executing automation automation.refresh_google_assistant_devices. Unknown error for call_service at pos 1: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/__init__.py", line 92, in request_sync_service_handler
    res.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 434, in action
    await script_obj.async_run(variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 162, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 246, in _handle_action
    await self._actions[_determine_action(action)](action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 329, in _async_call_service
    context=context,
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 98, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1259, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/google_assistant/__init__.py", line 94, in request_sync_service_handler
    body = await res.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 969, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 335, in read
    raise self._exception
aiohttp.client_exceptions.ClientConnectionError: Connection closed

try to reenable the simulator. for me working

https://developers.google.com/actions/tools/simulator

thanks @freemiumdev ! it works back again! ;)

Was this page helpful?
0 / 5 - 0 ratings