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

Components errors if speaker groups are used #11

Closed
djtimca opened this issue Nov 16, 2020 · 6 comments
Closed

Components errors if speaker groups are used #11

djtimca opened this issue Nov 16, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@djtimca
Copy link

djtimca commented Nov 16, 2020

Running version 0.3.5.

When I install and log in I get nothing created for entities (after waiting) and the following errors in my logs:

2020-11-16 15:00:18 ERROR (MainThread) [homeassistant.util.logging] Exception in async_cast_removed when dispatching 'cast_removed': (ChromecastInfo(services=set(), host=None, port=0, uuid='MASKED', model_name='Google Cast Group', friendly_name='Inside Speakers'),)
Traceback (most recent call last):
File "/config/custom_components/googlehome/helpers.py", line 55, in async_cast_removed
info = self._hass.data[DOMAIN][discover.uuid]["info"]
KeyError: 'MASKED'

This error appears for every speaker group I have in my system.

2020-11-16 15:17:05 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/googlehome/__init__.py", line 65, in refresh_tokens
resp = service.GetHomeGraph(GetHomeGraphRequest())
File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 826, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 729, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Internal error encountered."
debug_error_string = "{"created":"@1605557825.037701552","description":"Error received from peer ipv4:172.217.0.234:443","file":"src/core/lib/surface/call.cc","file_line":1061,"grpc_message":"Internal error encountered.","grpc_status":13}"
>

This error appears once.

@Drakulix
Copy link
Owner

Oh interesting, I do not have any speaker groups configured in my system, so that is probably the cause here.
I will try to debug/fix that soon.

@Drakulix Drakulix changed the title No entities created after installation and errors in logs Components errors if speaker groups are used Nov 17, 2020
@Drakulix Drakulix added the bug Something isn't working label Nov 17, 2020
@Drakulix
Copy link
Owner

Drakulix commented Nov 17, 2020

When I install and log in I get nothing created for entities (after waiting) and the following errors in my logs:

2020-11-16 15:00:18 ERROR (MainThread) [homeassistant.util.logging] Exception in async_cast_removed when dispatching 'cast_removed': (ChromecastInfo(services=set(), host=None, port=0, uuid='MASKED', model_name='Google Cast Group', friendly_name='Inside Speakers'),)
Traceback (most recent call last):
File "/config/custom_components/googlehome/helpers.py", line 55, in async_cast_removed
info = self._hass.data[DOMAIN][discover.uuid]["info"]
KeyError: 'MASKED'

This error appears for every speaker group I have in my system.

A fix for this is on the master branch. Can you report back, if it works for you?

2020-11-16 15:17:05 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/googlehome/__init__.py", line 65, in refresh_tokens
resp = service.GetHomeGraph(GetHomeGraphRequest())
File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 826, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/usr/local/lib/python3.8/site-packages/grpc/_channel.py", line 729, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Internal error encountered."
debug_error_string = "{"created":"@1605557825.037701552","description":"Error received from peer ipv4:172.217.0.234:443","file":"src/core/lib/surface/call.cc","file_line":1061,"grpc_message":"Internal error encountered.","grpc_status":13}"
>

This error appears once.

This error however appears to be the main reason, you are not getting any entities, because this is an internal communication error with googles servers. I have no good idea how to debug this. Is your home-assistant instance running behind some proxy by any chance?

You may try connecting to it manually and see if that works (indicating a problem with my code) or fails as well (indicating a problem on your side, but maybe giving more insight). The authentication process I am using is the same from the "google home local api" project: https://rithvikvibhu.github.io/GHLocalApi/#section/Google-Home-Local-API/Authentication

@djtimca
Copy link
Author

djtimca commented Nov 17, 2020

The update has cleared up the speaker group errors, but not the other. I am not running behind any proxy other than AdGuard, but monitoring the traffic there nothing is being blocked.

I do see another series of errors from googledevices which show timeouts:

2020-11-17 08:06:53 ERROR (MainThread) [googledevices] ClientError contacting https://192.168.86.242:8443/setup/bluetooth/scan_results - Cannot connect to host 192.168.86.242:8443 ssl:False [Connect call failed ('192.168.86.242', 8443)]
2020-11-17 08:06:56 ERROR (MainThread) [googledevices] ClientError contacting https://192.168.86.242:8443/setup/bluetooth/scan - Cannot connect to host 192.168.86.242:8443 ssl:False [Connect call failed ('192.168.86.242', 8443)]
2020-11-17 08:06:56 ERROR (MainThread) [googledevices] Error connecting to - 192.168.86.242

Not sure if this is related as it is marked to "googledevices" but I assumed by the bluetooth scan that it may be from this integration.

Not sure how to test locally (Ubuntu).

@Drakulix
Copy link
Owner

I don't know, how to debug this. Your home-assistant instance is neither connecting to google properly, nor to your local device (192.168.86.242) and now also not to the login servers it seems (#14).
While this absolutely can be an issue with my integration, I have no idea, what might cause this.

You can test the connection to your google home device using the following command:
curl -k https://192.168.86.242:8443/setup/eureka_info which should return some json from your device containing some infos. Does that work on any other system?

@djtimca
Copy link
Author

djtimca commented Nov 17, 2020

I can connect using the curl command and I get back the info data for that device. So it doesn't look like an issue connecting to the device itself, must be related to the authorization issue noted.

@Drakulix
Copy link
Owner

I will close this issue, as I think #14 is another symptom / cause of the same underlying issue and the speaker group error has been solved. Feel free to add any new informations to the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants