Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_assistant.request_sync failed #20251

Closed
riddik14 opened this issue Jan 19, 2019 · 32 comments
Closed

google_assistant.request_sync failed #20251

riddik14 opened this issue Jan 19, 2019 · 32 comments

Comments

@riddik14
Copy link

No description provided.

@riddik14
Copy link
Author

riddik14 commented Jan 19, 2019

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

@leranp
Copy link
Contributor

leranp commented Jan 20, 2019

me to

@riddik14
Copy link
Author

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

@leranp
Copy link
Contributor

leranp commented Jan 21, 2019

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

@pszafer
Copy link
Contributor

pszafer commented Jan 21, 2019

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.

@leranp
Copy link
Contributor

leranp commented Jan 21, 2019

@pszafer Didn't work in my case

@konzolec
Copy link

konzolec commented Jan 24, 2019

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

@Devqon
Copy link
Contributor

Devqon commented Jan 24, 2019

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

@konzolec
Copy link

konzolec commented Jan 24, 2019

Unlinking and linking again did the trick, not really a solution tho.

Might be because of this
https://community.home-assistant.io/t/google-assistant-component-stopped-working-0-85-1/93708/4

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

@jokerigno
Copy link

Same here. Stop syncing after upgrade from 84 to 85

@Apolli
Copy link

Apolli commented Jan 26, 2019

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

@TheJulianJES
Copy link
Member

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

@Apolli
Copy link

Apolli commented Jan 26, 2019

@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?

@jokerigno
Copy link

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

@jokerigno
Copy link

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

@Devqon
Copy link
Contributor

Devqon commented Jan 29, 2019

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

@mirkochip88
Copy link

mirkochip88 commented Feb 22, 2019

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

@jasimancas
Copy link

jasimancas commented Feb 23, 2019

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.

@snakuzzo
Copy link

snakuzzo commented Feb 28, 2019

Same here

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`

@webdjoe
Copy link
Contributor

webdjoe commented Mar 22, 2019

@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

#16026

@andylebedev
Copy link

Push failed: <Response [404]>:

<title>Error 404 (Not Found)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/logos/errorpage/error_logo-150x54-2x.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px} </style>

404. That’s an error.

That’s all we know.

@freemiumdev
Copy link

try to reenable the simulator. for me working

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

@robwolff3
Copy link

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.

@aurelmarius
Copy link

aurelmarius commented May 1, 2019

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.

@stale
Copy link

stale bot commented Jul 30, 2019

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.

@stale stale bot added the stale label Jul 30, 2019
@stale stale bot closed this as completed Aug 7, 2019
@pilot1981
Copy link

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

@sibbl
Copy link

sibbl commented Aug 12, 2019

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

@VincentMasselis
Copy link

Reenabling the simulator did the job for me

@edif30
Copy link
Contributor

edif30 commented Sep 10, 2019

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.

@Betoniara
Copy link

Betoniara commented Sep 25, 2019

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

@Electronlibre2012
Copy link

try to reenable the simulator. for me working

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

thanks @freemiumdev ! it works back again! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests