Rhasspy addon intent error

I have Hassio installed with Rhasspy add on and Rhasspy satellite on a RPI 3. I managed to configure the satellite and I can see text recognized in the master (running on Hassio).
On the master I have Rhasspy configured with Intent handling for Home Assistant and I have the URL their as https://xxxxx.duckdns.org:8123
I created a long lived token and add it as it was not filled automatically
I used the same example in this link for the configuration and the problem am seeing in master Rhasspy log is below

[WARNING:2021-03-19 17:53:34,289] rhasspydialogue_hermes: No session for id 1819bbd9-9247-411d-a69f-95c237516f1d. Dropping recognition.
[DEBUG:2021-03-19 17:53:34,291] rhasspyhomeassistant_hermes: https://caha.duckdns.org:8123/api/intent/handle
[ERROR:2021-03-19 17:53:34,375] rhasspyhomeassistant_hermes: handle_home_assistant_intent
Traceback (most recent call last):
  File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 169, in handle_home_assistant_intent
    response.raise_for_status()
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://xxxxx.duckdns.org:8123/api/intent/handle')
[ERROR:2021-03-19 17:53:34,376] rhasspyhomeassistant_hermes: handle_intent
Traceback (most recent call last):
  File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 88, in handle_intent
    assert response_dict, f"No response from {self.url}"
AssertionError: No response from https://xxxx.duckdns.org:8123
[ERROR:2021-03-19 17:53:34,377] asyncio: SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fafa42fd860>
transport: <_SelectorSocketTransport fd=12 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
    self._sslobj.unwrap()
  File "/usr/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)

If you have the addon, you can clear the Access Token field and put http://hassio/homeassistant/ or the local IP address in the Hass URL field
That should solve your connection problem, because the logs shows:
f"No response from {self.url}"
That implies a connection issue, not an intent issue.

I tried without the token, didn’t work. I am confused about this

I put https://xxxx.duckdns.org:8123 as this is the URL of my Hass (works locally with a split brain DNS), is that not correct ?
Is http://hassio/homeassistant/ a placeholder or the actual URL (with HTTPS)

The duckdns is the external URL, not the internal. That might might be the issue in the first place.
Your local ip address is without https, but you can http://hassio/homeassistant/ as well.

It is not https however, but I suggest to first go with http because it is a bit simpler.
If you use the addon, the token is retreived and used underwater, so no need to fill it in the box.
You can plunge into the deep here if you want to read more:

using http://hassio/homeassistant/ in a web browser in my network redirect me to https://hassio/homeassistant/ and I get 404 page not found
My whole setup is using https and I don’t want to go back reconfigure everything with http. Is there a way to work with https ?

I do not even have a http://hassio/homeassistant/ and those settings work in my setup :slight_smile:
Not really sure how that works actually.
You can put the internal url of your HA instance in there as well (with https).
That should also work with an Access Token

I am not sure what you mean with internal URL, I only have one URL that works from my internal network or outside and that is the duckdns url on port 8123 with ssl and I tried that and am receiving 404 in the log in my op

I changed the URL to https://hassio/homeassistant/ and now I see this in the log. I am running HassOS locally without any cloud

[WARNING:2021-03-22 22:11:26,240] rhasspydialogue_hermes: No session for id 186b4931-683f-42a6-8aca-adf2e171c233. Dropping recognition.
[ERROR:2021-03-22 22:11:26,243] rhasspyhomeassistant_hermes: handle_home_assistant_intent
Traceback (most recent call last):
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/lib/python3.7/asyncio/base_events.py", line 959, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.7/asyncio/base_events.py", line 946, in create_connection
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 464, in sock_connect
    return await fut
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 494, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('172.30.32.2', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 167, in handle_home_assistant_intent
    post_url, json=hass_intent, headers=headers, ssl=self.ssl_context
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request
    timeout=real_timeout
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection
    req, traces, timeout)
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection
    raise last_exc
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/connector.py", line 986, in _create_direct_connection
    req=req, client_error=client_error)
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host hassio:443 ssl:<ssl.SSLContext object at 0x7f64252b4f50> [Connect call failed ('172.30.32.2', 443)]
[ERROR:2021-03-22 22:11:26,246] rhasspyhomeassistant_hermes: handle_intent
Traceback (most recent call last):
  File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 88, in handle_intent
    assert response_dict, f"No response from {self.url}"
AssertionError: No response from https://hassio/homeassistant/

Well, you mentioned getting a 404 on https:://hassio/homeassistant/
That is exactly what you get now:

AssertionError: No response from https://hassio/homeassistant/

Try using your http://<ipaddress>:8123
ipaddress being your Home Assistants internal network IP. You duckdns is pointing to an internal ipaddress

I know you are using https, but I suggest trying to get it to work without it first :slight_smile:

No response is different than 404, 404 is a response from a web server saying not found.
I tried with IP address and port too, same error 404 (not connection refused)
I am using split brain DNS setup so from my internal network the duckdns name resolves to a 192.168.xxx.xx IP address and from the outside of my network it responds with my ISP IP address.

I switched HA to http, still no luck. Also getting errors in HA

File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 169, in handle_home_assistant_intent
   response.raise_for_status()
 File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status
   headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.6.10:8123/api/intent/handle')
[ERROR:2021-03-24 22:40:52,037] rhasspyhomeassistant_hermes: handle_intent
Traceback (most recent call last):
 File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 88, in handle_intent
   assert response_dict, f"No response from {self.url}"
AssertionError: No response from http://192.168.6.10:8123
2021-03-24 22:45:54 ERROR (MainThread) [aiohttp.server] Error handling request

Traceback (most recent call last):

File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 314, in data_received

messages, upgraded, tail = self._request_parser.feed_data(data)

File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data

aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"

Found the problem.
in configuration.yaml (Home Assistant)
add a line

intent:

In Rhasspy addon, under intent handling
leave the default for HASS URL (http://hassio/homeassistant/) even if you are using https

1 Like