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

No such file or directory: 'sudo': 'sudo' (Home Assistant add-on) #169

Closed
TheGroundZero opened this issue Jan 18, 2021 · 6 comments
Closed
Labels
bug Something isn't working in progress

Comments

@TheGroundZero
Copy link

Using the big power button to restart the system instead of the seperate "Restart" button results in this error

Rhasspy add-on on Home Assistant
v2.5.9

[ERROR:2021-01-18 15:16:43,040] rhasspyserver_hermes: [Errno 2] No such file or directory: 'sudo': 'sudo'
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 dispatch_request
    return await handler(**request_.view_args)
  File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/__main__.py", line 2232, in api_system
    proc = await asyncio.create_subprocess_exec(*[str(v) for v in command_list])
  File "/usr/lib/python3.7/asyncio/subprocess.py", line 217, in create_subprocess_exec
    stderr=stderr, **kwds)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1533, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/lib/python3.7/asyncio/unix_events.py", line 190, in _make_subprocess_transport
    **kwargs)
  File "/usr/lib/python3.7/asyncio/base_subprocess.py", line 37, in __init__
    stderr=stderr, bufsize=bufsize, **kwargs)
  File "/usr/lib/python3.7/asyncio/unix_events.py", line 763, in _start
    universal_newlines=False, bufsize=bufsize, **kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo': 'sudo'
[DEBUG:2021-01-18 15:16:43,034] rhasspyserver_hermes: reboot: ['sudo', 'shutdown', '-r', 'now']
[DEBUG:2021-01-18 15:16:40,037] rhasspyserver_hermes: Handling Voices (topic=rhasspy/tts/voices, id=2ffe663f-ad21-4a33-b506-2e29a4e04d20)
@paulvt
Copy link

paulvt commented Jan 19, 2021

Yes, it tries to reboot the whole system instead of just a Rhasspy restart. However, it seems that the "sudo" command is not available in the Docker image.
Also I don't think restarting/rebooting should be an option or even work when Dockerized. Maybe Rhasspy could autodetect whether it should show the power button at all. Even if "sudo" exists, you are not assured that "sudo shutdown -r now" will work.

@RaspiManu
Copy link

I have the same problem with missing sudo rights.

@synesthesiam
Copy link
Contributor

OK, I'll hide the button if "sudo" isn't available 👍

@synesthesiam synesthesiam added bug Something isn't working in progress labels Jan 26, 2021
@Romkabouter
Copy link
Contributor

@TheGroundZero can you confirm this as fixed in 2.5.11?

@TheGroundZero
Copy link
Author

@TheGroundZero can you confirm this as fixed in 2.5.11?

Haven't used Rhasspy in quite some time anymore, so can't confirm nor deny

@Romkabouter
Copy link
Contributor

Ok cool. I think it is fixed since I do not see it in my Home Assistant (where no sudo is available)
Feel free to reopen if needed.

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

No branches or pull requests

5 participants