Google Home app redirects back to 'Set Up' screen after attempting to oauth test action

Tags: #<Tag:0x00007f73931576e8>

I’ve been trying to setup the google home assistant component with my home assistant. Every time when I go to add the test action from my Google Home app it sends me to my home assistant login screen, I login, it sends me back to the Google home app where it says “Linking your [test] Hass account”, and then it just sends me back to the ‘Set Up’ screen with no success or error message.

I have no idea what’s going on, because there’s no errors, but it’s definitely not getting added. Any ideas? Or is there anywhere I can see logs for this OAuth process?

I’m having this exact same issue. Does anyone know how to fix it please?

Edit: I’ve checked my Home Assistant logs and found that I get this error whenever I test my app on the Actions Console, I am using a self-signed certificate. Any ideas?

Log Details (ERROR)
Logger: homeassistant
Source: components/google_assistant/http.py:51
First occurred: 3:17:04 PM (1 occurrences)
Last logged: 3:17:04 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/jwt/algorithms.py”, line 205, in prepare_key
key = load_pem_private_key(key, password=None, backend=default_backend())
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/primitives/serialization/base.py”, line 16, in load_pem_private_key
return backend.load_pem_private_key(data, password)
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1098, in load_pem_private_key
password,
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1324, in _load_key
self._handle_key_loading_error()
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1382, in _handle_key_loading_error
raise ValueError(“Could not deserialize key data.”)
ValueError: Could not deserialize key data.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/google_assistant/report_state.py”, line 70, in inital_report
await google_config.async_report_state_all({“devices”: {“states”: entities}})
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/google_assistant/helpers.py”, line 125, in async_report_state_all
await gather(*jobs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/google_assistant/http.py”, line 224, in async_report_state
await self.async_call_homegraph_api(REPORT_STATE_BASE_URL, data)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/google_assistant/http.py”, line 199, in async_call_homegraph_api
await self._async_update_token()
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/google_assistant/http.py”, line 157, in _async_update_token
self._config[CONF_SERVICE_ACCOUNT][CONF_PRIVATE_KEY],
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/google_assistant/http.py”, line 51, in _get_homegraph_jwt
return jwt.encode(jwt_raw, key, algorithm=“RS256”).decode(“utf-8”)
File “/srv/homeassistant/lib/python3.7/site-packages/jwt/api_jwt.py”, line 65, in encode
json_payload, key, algorithm, headers, json_encoder
File “/srv/homeassistant/lib/python3.7/site-packages/jwt/api_jws.py”, line 113, in encode
key = alg_obj.prepare_key(key)
File “/srv/homeassistant/lib/python3.7/site-packages/jwt/algorithms.py”, line 207, in prepare_key
key = load_pem_public_key(key, backend=default_backend())
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/primitives/serialization/base.py”, line 20, in load_pem_public_key
return backend.load_pem_public_key(data)
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1124, in load_pem_public_key
self._handle_key_loading_error()
File “/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py”, line 1382, in _handle_key_loading_error
raise ValueError(“Could not deserialize key data.”)
ValueError: Could not deserialize key data.