home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.44k stars 30.67k forks source link

Nest authentication fails 'unknown error occured' #63410

Closed marcjansen89 closed 2 years ago

marcjansen89 commented 2 years ago

The problem

I am trying to add a nest intergration to Home Assistant by following this guide: https://www.home-assistant.io/integrations/nest

I have followed the guide word by word and got to the Device Setup > OAuth and Device Authorization steps Here I have to add the nest integration and authorize my google account. I accept my Oauth screen, and enter the access code that is provided by the Oauth. Then the screen will just keep on loading and eventually stop with the error: "unknown error occured":

image

I have tried to guide multiple times to make sure I didn't mess up. I also have verified if my nest account is a google account (it is) and I don't have any weird constructions with multiple homes (I used to but removed them as I read that sometimes that messes things up)

I am able to follow: https://developers.google.com/nest/device-access/authorize#modify_account_permissions which used a web server call, but the API works which means my SDM API is working.

Following that guide also resulted in my GCP to have a partner connection with nest (which is a good thing, I think?) which I can view from: https://nestservices.google.com/partnerconnections

What version of Home Assistant Core has the issue?

core-2021.12.7

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

nest

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nest

Example YAML snippet

nest:
  client_id: 85(omitted).apps.googleusercontent.com
  client_secret: GOC(omitted)
  # "Project ID" in the Device Access Console (not Cloud Project ID!)
  project_id: ce3(omitted)

Anything in the logs that might be useful for us?

No response

Additional information

The authentication call being made that keeps pending and fails is: http://homeassistant.local:8123/api/config/config_entries/flow/b44c184ddc35495db35063e28c2cf180

It has a payload of: {"code":"4/(omitted access token)"}

In the console (Google Chrome) it gives the error: Failed to load resource: the server responded with a status of 504 (Gateway Timeout) POST http://homeassistant.local:8123/api/config/config_entries/flow/b44c184ddc35495db35063e28c2cf180 504 (Gateway Timeout)

probot-home-assistant[bot] commented 2 years ago

nest documentation nest source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (nest) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

allenporter commented 2 years ago

Hi, do you see any error messages in the home assistant logs?

marcjansen89 commented 2 years ago

Hi, do you see any error messages in the home assistant logs?

Hi Allen, thanks for looking into this. This is the only entry that is added to the log around the time the request times out:

Logger: aiohttp.server Source: /usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py:405 First occurred: 11:16:56 PM (1 occurrences) Last logged: 11:16:56 PM

Error handling request

2022-01-04 23:16:56 ERROR (MainThread) [aiohttp.server] Error handling request

allenporter commented 2 years ago

Thanks, appreciate all the detail in the report.

Are there any other details in the full log available?

Would you also be able to add this to your configuration.yaml to turn on debug logging in a few different components?

logger:
  default: info
  logs:
    homeassistant.util.package: debug
    homeassistant.components.nest: debug
    homeassistant.helpers.config_entry_flow: debug
    homeassistant.helpers.config_entry_oauth2_flow: debug
    google_nest_sdm: debug
    google_nest_sdm.auth: debug

Since we're not getting anything useful from the logs, this may help us track down what is happening when things start to go wrong. It doesn't seem like its specific to the Nest API, so not sure where else the problem might be.

marcjansen89 commented 2 years ago

That was all there was in the logs. I have added the debugs to the configurarion.yaml and now I see this one as addition. My guess is this ons is from the start of the request:

Logger: py.warnings Source: /usr/local/lib/python3.9/warnings.py:109 First occurred: 11:41:07 PM (1 occurrences) Last logged: 11:41:07 PM

/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.2.158'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings warnings.warn(

And the next one is the one we saw already which occurs at timeout:

Logger: aiohttp.server Source: /usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py:405 First occurred: 11:46:11 PM (1 occurrences) Last logged: 11:46:11 PM

Error handling request

allenporter commented 2 years ago

Can you also double check the "full" log? My impression is it prints messages (info, warning, error, debug) on single line.

marcjansen89 commented 2 years ago

Screenshot_20220104-235745_Home Assistant

Currently on my phone, don't know if that matters?

marcjansen89 commented 2 years ago

The unverified https call message seems to be unrelated. I have ran the setup again and this time it only shows the following two entries in the full log:

2022-01-05 00:24:19 ERROR (MainThread) [aiohttp.server] Error handling request 2022-01-05 00:26:00 ERROR (MainThread) [aiohttp.server] Error handling request

Alas, no further details are given.

allenporter commented 2 years ago

OK thanks. Make sure you restart home assistant to pick up the configuration changes, then try again? I'm guessing the restart did not happen yet basted on the timestamps in the logs -- sorry forgot to mention that.

If this doesn't produce anything, then I don't have any great ideas.

marcjansen89 commented 2 years ago

I'm positive i restarted home assistant via the server control page. The log also shows more info than before, just not when the error occured.

Perhaps another bit of important info: i'm running home assistant via Virtualbox on a Windows host. Might that somehow mess up networking? Is it possible Windows firewall on the host device is in the way? I can't check it out right now as my partner is demanding me to go sleep, but I will verify that later just to be sure.

allenporter commented 2 years ago

Hi, I don't think we understand the problem yet. Have any debug logs as described above? Also seeing general network issues?

allenporter commented 2 years ago

I added an addition logger to the list that would be helpful to give more information about what is going on:

logger:
  default: info
  logs:
    homeassistant.util.package: debug
    homeassistant.components.nest: debug
    homeassistant.components.http.view: debug
    homeassistant.helpers.config_entry_flow: debug
    homeassistant.helpers.config_entry_oauth2_flow: debug
    google_nest_sdm: debug
    google_nest_sdm.auth: debug
nfisher83642 commented 2 years ago

Same issue! Running HA on RPi4.

Logger: aiohttp.server Source: helpers/config_entry_oauth2_flow.py:201 First occurred: 2:47:56 PM (4 occurrences) Last logged: 2:58:45 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/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 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 92, 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 78, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/nest/config_flow.py", line 224, in async_step_auth return await super().async_step_creation(user_input) File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 293, in async_step_creation token = await self.flow_impl.async_resolve_external_data(self.external_data) File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 165, in async_resolve_external_data return await self._token_request( File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 201, in _token_request resp.raise_for_status() File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://www.googleapis.com/oauth2/v4/token')

allenporter commented 2 years ago

Thanks, have any details in your logs?

nfisher83642 commented 2 years ago

Just updated my previous comment.

allenporter commented 2 years ago

Thanks, that is very helpful. Do you have the debug logs also though? There should be a line from. homeassistant.helpers.config_entry_oauth2_flow with important details to help debug from here

nfisher83642 commented 2 years ago

Is this what you're looking for:

2022-01-11 11:13:10 DEBUG (MainThread) [homeassistant.helpers.config_entry_oauth2_flow] Token request failed with status=401, body={ "error": "invalid_client", "error_description": "Unauthorized" }

allenporter commented 2 years ago

Yes! Exactly.

I am pretty sure this means the client id is incorrect.

nfisher83642 commented 2 years ago

Hmm - ok, thanks for your help. I'll verify on my end and update if the issue is resolved for me.

allenporter commented 2 years ago

@MarcHKV it is not clear if your issue is the same issue or not, but maybe you can check logs from desktop and verify your logging setup in configuration.yaml is setup as I mentioned before. There are a couple funny things about the log output where its not including the full stack trace like I would expect so I am a little puzzled, so maybe its a desktop vs mobile thing.

ChristofDC commented 2 years ago

I am having the exact same issue as @MarcHKV . Added the logger settings as mentioned above but no extra output is logged. Restarted the home assistant service as well as the machine itself but without any change.

2022-01-16 12:27:51 ERROR (MainThread) [aiohttp.server] Error handling request

Not sure if I need to create a seperate issue but this is my home assistant installation:

System Health

version core-2021.12.9
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.88
arch x86_64
timezone Europe/Brussels
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | failed to load: timeout can_reach_cloud_auth | failed to load: timeout can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 7.1 -- | -- update_channel | stable supervisor_version | supervisor-2021.12.2 docker_version | 20.10.9 disk_total | 31.3 GB disk_used | 4.0 GB healthy | true supported | true board | ova supervisor_api | ok version_api | failed to load: timeout installed_addons | Studio Code Server (4.0.0)
bikeshop45 commented 2 years ago

Summary

I too was seeing this exact problem (can't connect, no useful error reports, etc.), but I have fixed it; turns out the issue isn't HA. My fix was to turn off IPv6 on my router. Make sure you can manually ping google on the same machine on which HA is installed.

Running in a Docker container on Raspberry Pi 4, HA version 2021.12.9.

More details

I have my router set up to use IPv6 for the LAN even though my ISP (Verizon Fios) doesn't support IPv6. As a result, when I try to ping google my pi tries to use the IPv6 address and it doesn't work. Forcing it to use IPv4 works.

$ ping google.com
PING google.com(lga25s73-in-x0e.1e100.net (2607:f8b0:4006:816::200e)) 56 data bytes
^C
--- google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 162ms
$ ping google.com -4
PING google.com (142.250.65.238) 56(84) bytes of data.
64 bytes from lga25s73-in-f14.1e100.net (142.250.65.238): icmp_seq=1 ttl=118 time=11.2 ms
64 bytes from lga25s73-in-f14.1e100.net (142.250.65.238): icmp_seq=2 ttl=118 time=12.0 ms
64 bytes from lga25s73-in-f14.1e100.net (142.250.65.238): icmp_seq=3 ttl=118 time=9.89 ms

I turned off IPv6 on my router and now I'm able to add my Nest device. As an added bonus, on the /config/info page it now says I can reach the Home Assistant Cloud server (previously it wasn't connecting there either).

Is there any way to add helpful error messages to prevent this problem coming up in the future?

allenporter commented 2 years ago

Yeah, that's a really bad failure mode for a network problem!

I recently was able to upgrade cloud pubsub and grpc for the next home assistant release and I would love to see if that helps with the failure modes. If someone reproducing this was feeling brave enough to try on a dev/nightly build that would be cool.

Otherwise, may need to figure out steps to reproduce this...

ChristofDC commented 2 years ago

OMG Thanks @bikeshop45 ! That was it indeed. Disabled IPv6 on my host machine network card and everything works now.

bikeshop45 commented 2 years ago

@allenporter I'm happy to test any fixes. I did try a fresh install of the dev branch (basically used the container installation instructions and replaced stable with dev). Version info below. Unfortunately wasn't able to test the original bug because as soon as I copied over the same nest YAML configuration from my working example to configuration.yaml and restarted the server, it gives the following error, i.e., this happens before I can even try to add the Nest integration. There is no error when I remove that part of the config:

2022-01-17 09:15:53 ERROR (MainThread) [homeassistant.setup] Setup failed for nest: Unable to import component: Error relocating /usr/local/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEv: symbol not found

System Health

version core-2022.2.0.dev20220116
installation_type Home Assistant Container
dev true
hassio false
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.63-v7l+
arch armv7l
timezone UTC
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | pending
Lovelace dashboards | 1 -- | -- resources | 0 mode | auto-gen
allenporter commented 2 years ago

Damn, I spent months attempting to resolve ethat. Can you delete that all that form this issue and discuss in https://github.com/home-assistant/core/issues/56669 ?

bikeshop45 commented 2 years ago

Will continue that separate discussion. I tried adding a Nest device using 2022.2.0.dev20220112 which doesn't have the import error and this original "unknown error" message still appears and there's still no additional notes in the log. Sounds like we should return to this once #56669 is fixed.

allenporter commented 2 years ago

Just for context #56669 only applies if you are on armv7 so I wouldn't say that is true in general.

allenporter commented 2 years ago

I am curious if folks still see this running the home assistant beta?

bikeshop45 commented 2 years ago

I wasn't able to recreate the same conditions as when I originally saw this error; for some reason even with IPv6 enabled on my router, ping defaults to an IPv4 address and all is right with the world. Tried to simulate the effect by disconnecting my internet connection while keeping my LAN connected, did this in both the most recent container dev version (2022.3.0.dev20220130) and the current stable version (core-2021.12.10).

In both cases, it still times out with an "Unknown Error" as in the original screenshot. The good news is that it fails within a few seconds (before it would take ~minutes to time out), but still shows the unhelpful "unknown error" message.

With the caveat that this may not be the original issue exactly, I attach the relevant portion of the log, which does show a ClientConnectorError.

System Health

version core-2022.3.0.dev20220130
installation_type Home Assistant Container
dev true
hassio false
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.63-v7l+
arch armv7l
timezone UTC
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | failed to load: unreachable can_reach_cloud_auth | failed to load: unreachable can_reach_cloud | failed to load: unreachable
Lovelace dashboards | 1 -- | -- resources | 0 mode | auto-gen
log ``` 2022-01-30 19:22:04 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow/b51efdfbb27b74b56cb7bb1c1df93c01 to 192.168.1.8 (auth: True) 2022-01-30 19:22:09 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection hosts = await asyncio.shield(host_resolved) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 880, in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) File "/usr/local/lib/python3.9/site-packages/aiohttp/resolver.py", line 33, in resolve infos = await self._loop.getaddrinfo( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 856, in getaddrinfo return await self.run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Try again The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/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 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, 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 79, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/nest/config_flow.py", line 277, in async_step_auth return await super().async_step_creation(user_input) File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 293, in async_step_creation token = await self.flow_impl.async_resolve_external_data(self.external_data) File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 165, in async_resolve_external_data return await self._token_request( File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 193, in _token_request resp = await session.post(self.token_url, data=data) File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection raise ClientConnectorError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host www.googleapis.com:443 ssl:default [Try again] ```
allenporter commented 2 years ago

getaddrinfo there implies that maybe this is a DNS issue? as it can't look up www.google.com. I'm not sure what the nest integration can do about this, or whats triggering it. e.g. https://community.home-assistant.io/t/mayor-problems-api-github-com/209366

allenporter commented 2 years ago

Hi, anyone else who was hitting this have anything else to report about this issue with the latest version of home assistant?

benyafai commented 2 years ago

I also ran into this issue with IPv6, for anyone that finds it.

allenporter commented 2 years ago

@benyafai what version of home assistant? I'm trying to understand if recent cloud pubsub subscriber library updates helped with this.

benyafai commented 2 years ago

Sure... core-2022.2.6 supervisor-2022.01.1 Home Assistant OS 7.4

allenporter commented 2 years ago

Thanks, so the issue still is present. I think the next step to solve the root cause is to get more details about here the problem is, since we have no error messages. Maybe someone hitting this is (before disabling ipv6) is willing to turn up more debug logging to capture more details. I don't have an ipv6 setup, so haven't tried to reproduce this yet myself.

flamingotter commented 2 years ago

I am having this issue. Running core-2022.2.6 in docker and I haven't disable ipv6, but am able to ping 'google.com' from my HA container.

below is my log dump.

`Logger: aiohttp.server Source: helpers/config_entry_oauth2_flow.py:201 First occurred: 2:49:55 PM (1 occurrences) Last logged: 2:49:55 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/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 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 220, 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 79, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 164, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/nest/config_flow.py", line 277, in async_step_auth return await super().async_step_creation(user_input) File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 293, in async_step_creation token = await self.flow_impl.async_resolve_external_data(self.external_data) File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 165, in async_resolve_external_data return await self._token_request( File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 201, in _token_request resp.raise_for_status() File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://www.googleapis.com/oauth2/v4/token') `

allenporter commented 2 years ago

@flamingotter I think your issue is different and that the client id is likely incorrect -- see the discussion above https://github.com/home-assistant/core/issues/63410#issuecomment-1010292646 including the extra logging above to get a detailed error message

github-actions[bot] commented 2 years ago

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.