synesthesiam / hassio-addons

My Hass.IO add-ons
44 stars 18 forks source link

Help please! Cannot connect Rhasspy to Hassio for entity lists etc. #25

Closed MikeLDPT closed 3 years ago

MikeLDPT commented 3 years ago

Hi,

I have had the same error for 3 days now and have run out of ideas and need some guidance please. I have installed all the changes required for the Hassio integration from the Rhasspy area, and configured everything in Hassio accordingly. When Rhasspy trains it fails to connect to hassio and its log contains:

[ERROR:2021-01-31 17:40:57,081] rhasspyserver_hermes: Command '['/share/rhasspy/profiles/en/slot_programs/hass/entities', 'light']' returned non-zero exit status 127. Traceback (most recent call last): File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py", line 1821, in full_dispatch_request result = await self.dispatch_request(request_context) File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py", line 1869, in dispatchrequest return await handler(**request.view_args) File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py", line 1321, in api_train result = await core.train() File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 364, in train word_transform=word_transform, File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/train.py", line 87, in sentences_to_graph slot_visitor=word_visitor, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/slots.py", line 87, in get_slot_replacements slot_command, universal_newlines=True File "/usr/lib/python3.7/subprocess.py", line 395, in check_output **kwargs).stdout File "/usr/lib/python3.7/subprocess.py", line 487, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['/share/rhasspy/profiles/en/slot_programs/hass/entities', 'light']' returned non-zero exit status 127. [DEBUG:2021-01-31 17:40:57,064] rhasspynlu.slots: Running program for slot hass/entities,light: ['/share/rhasspy/profiles/en/slot_programs/hass/entities', 'light'] [DEBUG:2021-01-31 17:40:56,837] rhasspynlu.slots: Running program for slot rhasspy/number,0,100,1: ['/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/en/slot_programs/rhasspy/number', '0', '100', '1']

I have searched the web, read and re-read all the documents I can find to make sure authentication is correct. Nothing appears in the HASSIO log so I don't know if the Rhasspy script in Entity is actually connecting (how can I debug this may be a way forward please?).

I have gone through the process of creating long lived tokens several times in case it was that. I have used various forms of auth_providers with and without the api_password, with and without trusted_networks. I have used localhost, 127.0.0.1, 192.168.0.21, I have tried with and without the long lived token. But whatever I do Rhasspy always returns returned non-zero exit status 127

Thanks in advance for any help you can give.

MikeLDPT commented 3 years ago

A few more days looking and I've now found a more helpful error line in the Rhasspy log in HASSIO itself. This line does not appear in the Rhasspy 12101 web page log: /usr/bin/env: ‘bash\r’: No such file or directory A search on this error identifies that there is a problem with the Entities file format. This was caused by: On not finding a way to download the file, I copied and pasted the file content into Notepad on my laptop and saved it to the Raspberry Pi. This corrupted it. I have now copied and pasted the content from Github directly into a new file in HASSIO's File Editor and the Entities file is now formatted correctly. The training of Rhasspy now works and calls HASSIO to gather a list of entities as defined within it. Maybe this will help someone else who finds themselves facing non-zero exit status 127

Wetzel402 commented 2 years ago

@MikeLDPT, This was my issue too!